1 /* === S Y N F I G ========================================================= */
2 /*! \file widget_value.cpp
3 ** \brief Template File
5 ** $Id: widget_value.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_GTKMM_VALUE_H
26 #define __SYNFIG_GTKMM_VALUE_H
28 /* === H E A D E R S ======================================================= */
30 //#include <gtk/gtk.h>
31 //#include <gtkmm/ruler.h>
32 //#include <gtkmm/arrow.h>
33 //#include <gtkmm/image.h>
34 //#include <gdkmm/pixbufloader.h>
35 //#include <gtkmm/viewport.h>
36 #include <gtkmm/adjustment.h>
37 //#include <gtkmm/scrolledwindow.h>
38 #include <gtkmm/table.h>
39 //#include <gtkmm/statusbar.h>
40 #include <gtkmm/button.h>
41 #include <gtkmm/label.h>
42 //#include <atkmm/stateset.h>
43 //#include <gtkmm/paned.h>
44 //#include <gtkmm/treeview.h>
45 //#include <gtkmm/treestore.h>
46 #include <gtkmm/box.h>
47 #include <gtkmm/spinbutton.h>
48 //#include <gtkmm/cellrenderer.h>
49 #include <gtkmm/checkbutton.h>
51 //#include <gtkmm/colorselection.h>
52 #include <gtkmm/optionmenu.h>
54 //#include <synfig/synfig.h>
55 #include <synfig/paramdesc.h>
56 #include <synfig/value.h>
57 #include <synfig/canvas.h>
60 /* === M A C R O S ========================================================= */
62 /* === T Y P E D E F S ===================================================== */
64 /* === C L A S S E S & S T R U C T S ======================================= */
69 class Widget_ColorEdit;
70 class Widget_CanvasChooser;
72 class Widget_Filename;
75 class Widget_Distance;
77 class Widget_ValueBase : public Gtk::HBox
80 synfig::ValueBase value;
82 Widget_Vector *vector_widget;
83 Gtk::SpinButton *real_widget;
84 Gtk::Adjustment real_adjustment;
85 Gtk::SpinButton *integer_widget;
86 Gtk::Adjustment integer_adjustment;
87 Gtk::SpinButton *angle_widget;
88 Gtk::Adjustment angle_adjustment;
90 Gtk::CheckButton *bool_widget;
91 //Gtk::ColorSelection *color_widget;
92 Widget_ColorEdit *color_widget;
93 Widget_CanvasChooser *canvas_widget;
94 Widget_Enum *enum_widget;
95 Widget_Filename *filename_widget;
96 Widget_Time *time_widget;
97 Gtk::Entry *string_widget;
98 Widget_Distance *distance_widget;
102 synfig::ParamDesc param_desc;
103 etl::handle<synfig::Canvas> canvas;
104 sigc::signal<void> signal_value_changed_;
105 sigc::signal<void> signal_activate_;
108 sigc::signal<void> &signal_value_changed() { return signal_value_changed_; }
112 sigc::signal<void>& signal_activate() { return signal_activate_; }
114 void set_value(const synfig::ValueBase &data);
115 const synfig::ValueBase &get_value();
117 void on_grab_focus();
119 void set_param_desc(const synfig::ParamDesc &x) { param_desc=x; }
120 const synfig::ParamDesc &get_param_desc() { return param_desc; }
122 void set_sensitive(bool x);
124 //void set_hint(std::string x) { hint=x; }
125 // std::string get_hint() { return hint; }
127 void set_canvas(etl::handle<synfig::Canvas> x) { canvas=x; assert(canvas); }
128 void inside_cellrenderer();
133 }; // END of namespace studio
135 /* === E N D =============================================================== */