[gtkmm] Gtk: Move some methods from ToggleButton to CheckButton
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Gtk: Move some methods from ToggleButton to CheckButton
- Date: Tue, 31 Jan 2017 17:47:23 +0000 (UTC)
commit 62efa110bde5d83739cb2aaa966e59e6292f81c2
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Tue Jan 31 18:42:44 2017 +0100
Gtk: Move some methods from ToggleButton to CheckButton
ToggleButton::[set|get]_mode() are also renamed to
CheckButton::[set|get]_draw_indicator().
CheckButton::draw_indicator_vfunc() is removed.
Corresponding changes have been made in gtk+.
demos/gtk-demo/example_iconbrowser.cc | 4 ++--
gtk/src/checkbutton.hg | 23 ++++++-----------------
gtk/src/togglebutton.hg | 8 --------
3 files changed, 8 insertions(+), 27 deletions(-)
---
diff --git a/demos/gtk-demo/example_iconbrowser.cc b/demos/gtk-demo/example_iconbrowser.cc
index 76ef850..5fd2165 100644
--- a/demos/gtk-demo/example_iconbrowser.cc
+++ b/demos/gtk-demo/example_iconbrowser.cc
@@ -200,8 +200,8 @@ Example_IconBrowser::Example_IconBrowser()
m_header.pack_end(m_header_radio_button_box);
m_header_radio_button_box.pack_start(m_normal_radio);
m_header_radio_button_box.pack_start(m_symbolic_radio);
- m_normal_radio.set_mode(false); // Make it look as a normal button
- m_symbolic_radio.set_mode(false);
+ m_normal_radio.set_draw_indicator(false); // Make it look as a normal button
+ m_symbolic_radio.set_draw_indicator(false);
m_symbolic_radio.join_group(m_normal_radio);
m_button_size_group = Gtk::SizeGroup::create(Gtk::SIZE_GROUP_VERTICAL);
diff --git a/gtk/src/checkbutton.hg b/gtk/src/checkbutton.hg
index 53bbdd4..f67789f 100644
--- a/gtk/src/checkbutton.hg
+++ b/gtk/src/checkbutton.hg
@@ -56,24 +56,13 @@ public:
*/
explicit CheckButton(const Glib::ustring& label, bool mnemonic = false);
+ _WRAP_METHOD(void set_draw_indicator(bool draw_indicator = true), gtk_check_button_set_draw_indicator)
+ _WRAP_METHOD(bool get_draw_indicator() const, gtk_check_button_get_draw_indicator)
+ _WRAP_METHOD(void set_inconsistent(bool inconsistent = true), gtk_check_button_set_inconsistent)
+ _WRAP_METHOD(bool get_inconsistent() const, gtk_check_button_get_inconsistent)
-protected:
-
-#m4begin
-dnl This extra conversion does the extra reference, often needed by code for vfuncs and signal.
-_CONVERSION(`cairo_t*',`const ::Cairo::RefPtr< ::Cairo::Context>&',`::Cairo::make_refptr_for_instance<
::Cairo::Context>(new ::Cairo::Context($3, false /* has_reference */))')
-#m4end
-
- /** Emited on button redraw to update indicator.
- * Triggered when the button is redrawn (e.g.after being toggled)
- * Overload this signal if you want to implement your own check button
- * look. Otherwise, you most likely don't care about it.
- * The GdkRectangle specifies the area of the widget which will get
- * redrawn.
- */
- _WRAP_VFUNC(void draw_indicator(const ::Cairo::RefPtr< ::Cairo::Context>& cr), "draw_indicator")
-
+ _WRAP_PROPERTY("inconsistent", bool)
+ _WRAP_PROPERTY("draw-indicator", bool)
};
-
} //namespace Gtk
diff --git a/gtk/src/togglebutton.hg b/gtk/src/togglebutton.hg
index 8117cb0..d4cd981 100644
--- a/gtk/src/togglebutton.hg
+++ b/gtk/src/togglebutton.hg
@@ -50,22 +50,14 @@ public:
*/
explicit ToggleButton(const Glib::ustring& label, bool mnemonic = false);
- _WRAP_METHOD(void set_mode(bool draw_indicator = true),gtk_toggle_button_set_mode)
- _WRAP_METHOD(bool get_mode() const,gtk_toggle_button_get_mode)
-
_WRAP_METHOD(void set_active(bool is_active = true),gtk_toggle_button_set_active)
_WRAP_METHOD(bool get_active() const,gtk_toggle_button_get_active)
- _WRAP_METHOD(void set_inconsistent(bool setting = true), gtk_toggle_button_set_inconsistent)
- _WRAP_METHOD(bool get_inconsistent() const, gtk_toggle_button_get_inconsistent)
-
_WRAP_METHOD(void toggled(), gtk_toggle_button_toggled)
_WRAP_SIGNAL(void toggled(), "toggled")
_WRAP_PROPERTY("active", bool)
- _WRAP_PROPERTY("inconsistent", bool)
- _WRAP_PROPERTY("draw-indicator", bool)
};
} //namespace Gtk
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]