00001
00021
00022
00023
00024
00025 #ifndef __SYNFIG_STUDIO_CELLRENDERER_TIME_H
00026 #define __SYNFIG_STUDIO_CELLRENDERER_TIME_H
00027
00028
00029
00030 #include <gtkmm/entry.h>
00031 #include <gtkmm/cellrenderertext.h>
00032
00033 #include <sigc++/signal.h>
00034 #include <sigc++/slot.h>
00035
00036 #include <synfig/time.h>
00037
00038
00039
00040
00041
00042
00043
00044 namespace Gtk { class Entry; class Button; };
00045
00046 namespace studio {
00047
00048 class CellRenderer_Time : public Gtk::CellRendererText
00049 {
00050 sigc::signal<void, const Glib::ustring&> signal_secondary_click_;
00051 sigc::signal<void, const Glib::ustring&, synfig::Time> signal_edited_;
00052
00053 Glib::Property<synfig::Time> property_time_;
00054 Glib::Property<synfig::Time> property_fps_;
00055
00056 void string_edited_(const Glib::ustring&,const Glib::ustring&);
00057
00058 void on_value_editing_done();
00059
00060 public:
00061 sigc::signal<void, const Glib::ustring&, synfig::Time> &signal_edited()
00062 {return signal_edited_; }
00063
00064 Glib::PropertyProxy<synfig::Time> property_time() { return property_time_.get_proxy();}
00065 Glib::PropertyProxy<synfig::Time> property_fps() { return property_fps_.get_proxy();}
00066
00067 CellRenderer_Time();
00068 ~CellRenderer_Time();
00069
00070 protected:
00071
00072 virtual void
00073 render_vfunc(
00074 const Glib::RefPtr<Gdk::Drawable>& window,
00075 Gtk::Widget& widget,
00076 const Gdk::Rectangle& background_area,
00077 const Gdk::Rectangle& ca,
00078 const Gdk::Rectangle& expose_area,
00079 Gtk::CellRendererState flags);
00080
00081 virtual Gtk::CellEditable* start_editing_vfunc(GdkEvent* event,
00082 Gtk::Widget& widget,
00083 const Glib::ustring& path,
00084 const Gdk::Rectangle& background_area,
00085 const Gdk::Rectangle& cell_area,
00086 Gtk::CellRendererState flags);
00087
00088 };
00089
00090 };
00091
00092
00093
00094 #endif