libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GtkCRNScaleAction.h
Go to the documentation of this file.
1 /* Copyright 2010-2016 CoReNum, INSA-Lyon, ENS-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: GtkCRNScaleAction.h
19  * \author Yann LEYDIER
20  */
21 
22 #ifndef GtkCRNScaleAction_HEADER
23 #define GtkCRNScaleAction_HEADER
24 
25 #include <libgtkcrnmm_config.h>
26 #include <gtkmm.h>
27 
28 #ifndef CRN_USING_GTKMM3
29 namespace GtkCRN
30 {
38  : public Gtk::Action
39  {
40  public:
42  static Glib::RefPtr<ScaleAction> create();
44  static Glib::RefPtr<ScaleAction> create(const Glib::ustring& name, const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring());
46  static Glib::RefPtr<ScaleAction> create(const Glib::ustring& name, const Gtk::StockID& stock_id, const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring());
48  static Glib::RefPtr<ScaleAction> create_with_icon_name(const Glib::ustring& name, const Glib::ustring& icon_name, const Glib::ustring& label, const Glib::ustring& tooltip);
49 
51  Gtk::Adjustment& get_adjustment() { return adj; }
53  void set_icons(const Glib::StringArrayHandle& icons);
54 
56  Glib::SignalProxy0<void> signal_changed() { return adj.signal_value_changed(); }
57 
59  virtual ~ScaleAction() override { }
60 
61  protected:
62  ScaleAction();
63  ScaleAction(const Glib::ustring& name, const Gtk::StockID& stock_id = Gtk::StockID(), const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring());
64  ScaleAction(const Glib::ustring& name, const Glib::ustring& icon_name, const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring());
65 
66  virtual Gtk::Widget* create_menu_item_vfunc() override;
67  virtual Gtk::Widget* create_tool_item_vfunc() override;
68  void dialog();
69 
70  Gtk::Adjustment adj;
71  Glib::ustring lab;
72  std::vector<Glib::ustring> iconlist;
73  };
74 }
75 #endif
76 
77 #endif
void set_icons(const Glib::StringArrayHandle &icons)
Sets the icons to display depending of the value of the scale.
static Glib::RefPtr< ScaleAction > create()
Creates a blank ScaleAction.
static Glib::RefPtr< ScaleAction > create_with_icon_name(const Glib::ustring &name, const Glib::ustring &icon_name, const Glib::ustring &label, const Glib::ustring &tooltip)
Creates a ScaleAction.
virtual ~ScaleAction() override
Destructor.
virtual Gtk::Widget * create_tool_item_vfunc() override
A proxy action for a scale widget.
virtual Gtk::Widget * create_menu_item_vfunc() override
std::vector< Glib::ustring > iconlist
Gtk::Adjustment adj
Glib::SignalProxy0< void > signal_changed()
Signals when the value was changed. Connect to void on_value_changed();.
Gtk::Adjustment & get_adjustment()
Gets the Adjustment object to configure the scale.