X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fcellrenderer_value.cpp;h=7538607ff36111ba0445697580e054668e6bf3d3;hb=c3ad95144d148602f672e95ddda1f18fc35502f8;hp=8a52ff78576e84388ece3c3f9ed5368b5d0c9350;hpb=02252941b29de64037116f4d37991a38d9ff0d94;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/cellrenderer_value.cpp b/synfig-studio/trunk/src/gtkmm/cellrenderer_value.cpp index 8a52ff7..7538607 100644 --- a/synfig-studio/trunk/src/gtkmm/cellrenderer_value.cpp +++ b/synfig-studio/trunk/src/gtkmm/cellrenderer_value.cpp @@ -2,19 +2,20 @@ /*! \file cellrenderer_value.cpp ** \brief Template File ** -** $Id: cellrenderer_value.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $ +** $Id$ ** ** \legal -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. ** \endlegal */ /* ========================================================================= */ @@ -103,18 +104,18 @@ public: //set_flags(Gtk::CAN_FOCUS); //set_events(Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK); - + /* set_events(//(Gdk::ALL_EVENTS_MASK) - ~( Gdk::EXPOSURE_MASK - | Gdk::ENTER_NOTIFY_MASK - | Gdk::LEAVE_NOTIFY_MASK - | Gdk::FOCUS_CHANGE_MASK - | Gdk::STRUCTURE_MASK - | Gdk::PROPERTY_CHANGE_MASK - | Gdk::VISIBILITY_NOTIFY_MASK - | Gdk::PROXIMITY_IN_MASK - | Gdk::PROXIMITY_OUT_MASK + ~( Gdk::EXPOSURE_MASK + | Gdk::ENTER_NOTIFY_MASK + | Gdk::LEAVE_NOTIFY_MASK + | Gdk::FOCUS_CHANGE_MASK + | Gdk::STRUCTURE_MASK + | Gdk::PROPERTY_CHANGE_MASK + | Gdk::VISIBILITY_NOTIFY_MASK + | Gdk::PROXIMITY_IN_MASK + | Gdk::PROXIMITY_OUT_MASK | Gdk::SUBSTRUCTURE_MASK ) ); @@ -123,14 +124,14 @@ public: //signal_remove_widget().connect(sigc::mem_fun(*this, &studio::ValueBase_Entry::hide)); show_all_children(); - + //signal_show().connect(sigc::mem_fun(*this, &ValueBase_Entry::grab_focus)); } ~ValueBase_Entry() { DEBUGPOINT(); } - + void on_editing_done() { hide(); @@ -153,7 +154,7 @@ public: if(parent)parent->grab_focus(); Gtk::CellEditable::on_remove_widget(); } - void start_editing_vfunc(GdkEvent *event) + void start_editing_vfunc(GdkEvent */*event*/) { valuewidget->signal_activate().connect(sigc::mem_fun(*this, &studio::ValueBase_Entry::editing_done)); show(); @@ -198,7 +199,7 @@ public: if(valuewidget) valuewidget->set_param_desc(data); } - + const synfig::ValueBase &get_value() { if(valuewidget) @@ -240,13 +241,13 @@ bool get_paragraph(synfig::String& text) entry.set_activates_default(true); dialog.get_vbox()->pack_start(entry); */ - + dialog.add_button(Gtk::StockID("gtk-ok"),Gtk::RESPONSE_OK); dialog.add_button(Gtk::StockID("gtk-cancel"),Gtk::RESPONSE_CANCEL); dialog.set_default_response(Gtk::RESPONSE_OK); - + //text_entry.signal_activate().connect(sigc::bind(sigc::mem_fun(dialog,&Gtk::Dialog::response),Gtk::RESPONSE_OK)); - + dialog.show(); if(dialog.run()!=Gtk::RESPONSE_OK) @@ -269,7 +270,7 @@ CellRenderer_ValueBase::CellRenderer_ValueBase(): CellRendererText::signal_edited().connect(sigc::mem_fun(*this,&CellRenderer_ValueBase::string_edited_)); value_entry=new ValueBase_Entry(); value_entry->hide(); - + Pango::AttrList attr_list; { Pango::AttrInt pango_size(Pango::Attribute::create_attr_size(Pango::SCALE*8)); @@ -278,7 +279,7 @@ CellRenderer_ValueBase::CellRenderer_ValueBase(): attr_list.change(pango_size); } property_attributes()=attr_list; - + property_foreground()=Glib::ustring("#7f7f7f"); property_inconsistant()=false; } @@ -293,14 +294,14 @@ CellRenderer_ValueBase::string_edited_(const Glib::ustring&path,const Glib::ustr { ValueBase old_value=property_value_.get_value(); ValueBase value; - + if(old_value.get_type()==ValueBase::TYPE_TIME) { value=ValueBase(Time((String)str,get_canvas()->rend_desc().get_frame_rate())); } - else + else value=ValueBase((String)str); - + if(old_value!=value) signal_edited_(path,value); } @@ -366,7 +367,7 @@ CellRenderer_ValueBase::render_vfunc( property_text()=(Glib::ustring)strprintf("(%i)",data.get(int())); std::list enum_list=((synfig::ParamDesc)property_param_desc_).get_enum_list(); std::list::iterator iter; - + for(iter=enum_list.begin();iter!=enum_list.end();iter++) if(iter->value==data.get(int())) { @@ -374,7 +375,7 @@ CellRenderer_ValueBase::render_vfunc( break; } } - + break; case ValueBase::TYPE_VECTOR: { @@ -385,9 +386,9 @@ CellRenderer_ValueBase::render_vfunc( property_text()=static_cast(strprintf("%s,%s",x.get_string(6).c_str(),y.get_string(6).c_str())); } break; - + case ValueBase::TYPE_STRING: - + if(data.get_type()==ValueBase::TYPE_STRING) { if(!data.get(synfig::String()).empty()) @@ -416,7 +417,7 @@ CellRenderer_ValueBase::render_vfunc( case ValueBase::TYPE_BOOL: { widget.get_style()->paint_check( - Glib::RefPtr::cast_static(window), state, + Glib::RefPtr::cast_static(window), state, data.get(bool())?Gtk::SHADOW_IN:Gtk::SHADOW_OUT, ca, widget, "cellcheck", ca.get_x()/* + x_offset + cell_xpad*/, @@ -444,7 +445,7 @@ CellRenderer_ValueBase::render_vfunc( break; default: property_text()=static_cast(_("UNKNOWN")); - break; + break; } CellRendererText::render_vfunc(window,widget,background_area,ca,expose_area,flags); } @@ -504,7 +505,7 @@ CellRenderer_ValueBase::start_editing_vfunc( // If we aren't editable, then there is nothing to do if(!property_editable()) return 0; - + ValueBase data=property_value_.get_value(); switch(data.get_type()) @@ -515,7 +516,7 @@ CellRenderer_ValueBase::start_editing_vfunc( //case ValueBase::TYPE_TIME: // property_text()=(Glib::ustring)data.get(Time()).get_string(get_canvas()->rend_desc().get_frame_rate(),App::get_time_format()|Time::FORMAT_FULL); // return CellRendererText::start_editing_vfunc(event,widget,path,background_area,cell_area,flags); - + case ValueBase::TYPE_GRADIENT: App::dialog_gradient->reset(); App::dialog_gradient->set_gradient(data.get(Gradient())); @@ -526,7 +527,7 @@ CellRenderer_ValueBase::start_editing_vfunc( ) ); App::dialog_gradient->present(); - + return NULL; case ValueBase::TYPE_COLOR: @@ -539,7 +540,7 @@ CellRenderer_ValueBase::start_editing_vfunc( ) ); App::dialog_color->present(); - + return NULL; case ValueBase::TYPE_STRING: if(get_param_desc().get_hint()=="paragraph") @@ -549,7 +550,7 @@ CellRenderer_ValueBase::start_editing_vfunc( if(get_paragraph(string)) { signal_edited_(path,ValueBase(string)); - } + } return NULL; } if(get_param_desc().get_hint()!="filename") @@ -581,8 +582,8 @@ CellRenderer_ValueBase::on_value_editing_done() if(old_value!=value) signal_edited_(value_entry->get_path(),value); - + //delete value_entry; //value_entry=0; - } + } }