libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GtkCRNProp3.h
Go to the documentation of this file.
1 /* Copyright 2010-2014 CoReNum, INSA-Lyon
2  *
3  * This file is part of libgtkcrnmm.
4  *
5  * libgtkcrnmm is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * libgtkcrnmm is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with libgtkcrnmm. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * file: GtkCRNProp3.h
19  * \author Yann LEYDIER
20  */
21 
22 #ifndef GtkSProp3_HEADER
23 #define GtkSProp3_HEADER
24 
25 #include <libgtkcrnmm_config.h>
26 #include <gtkmm.h>
27 #include <CRNMath/CRNProp3.h>
28 
29 namespace GtkCRN
30 {
40  class Prop3: public Gtk::EventBox
41  {
42  public:
44  Prop3(Gtk::IconSize is, const crn::Prop3 &p = crn::Prop3::Unknown());
45  virtual ~Prop3() override {}
46 
48  void set_value(const crn::Prop3 &p);
50  const crn::Prop3& get_value() const { return prop; }
51 
53  void set_icon_size(Gtk::IconSize is);
55  Gtk::IconSize get_icon_size() const { return size; }
56 
58  bool click(GdkEventButton *ev);
59 
61  sigc::signal<void, crn::Prop3> signal_value_changed() { return value_changed; }
62 
63  private:
65  void set_image();
66 
67  crn::Prop3 prop;
68  Gtk::IconSize size;
69  Gtk::Image img;
70  sigc::signal<void, crn::Prop3> value_changed;
71  };
72 }
73 #endif
74 
static Prop3 Unknown()
Definition: CRNProp3.h:90
virtual ~Prop3() override
Definition: GtkCRNProp3.h:45
Prop3(Gtk::IconSize is, const crn::Prop3 &p=crn::Prop3::Unknown())
Constructor.
Definition: GtkCRNProp3.cpp:27
void set_icon_size(Gtk::IconSize is)
Sets the icon size.
Definition: GtkCRNProp3.cpp:44
const crn::Prop3 & get_value() const
Gets the value.
Definition: GtkCRNProp3.h:50
bool click(GdkEventButton *ev)
Emulates a mouse button release on the image.
Definition: GtkCRNProp3.cpp:89
Gtk::IconSize get_icon_size() const
Gets the icon size.
Definition: GtkCRNProp3.h:55
A widget for ternary values representation.
Definition: GtkCRNProp3.h:40
void set_value(const crn::Prop3 &p)
Sets the value.
Definition: GtkCRNProp3.cpp:37
A ternary proposition.
Definition: CRNProp3.h:40
sigc::signal< void, crn::Prop3 > signal_value_changed()
Signals when the value was changed. Connect to void on_value_changed(crn::Prop3). ...
Definition: GtkCRNProp3.h:61