#ifndef _GTKMM_TOGGLEBUTTON_H
#define _GTKMM_TOGGLEBUTTON_H
+
#include <glibmm.h>
/* $Id$ */
public:
//C++ methods used to invoke GTK+ virtual functions:
+#ifdef GLIBMM_VFUNCS_ENABLED
+#endif //GLIBMM_VFUNCS_ENABLED
protected:
//GTK+ Virtual Functions (override these to change behaviour):
+#ifdef GLIBMM_VFUNCS_ENABLED
+#endif //GLIBMM_VFUNCS_ENABLED
//Default Signal Handlers::
+#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
virtual void on_toggled();
+#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
private:
* to add a widget to this button since it already contains a Gtk::Label
*/
explicit ToggleButton(const Glib::ustring& label, bool mnemonic = false);
-
+ /** Creates a toggle button containing the image and text from a stock item.
+ * Stock ids have identifiers like Gtk::Stock::OK and Gtk::Stock::APPLY.
+ * @param stock_id The stock item.
+ */
+ explicit ToggleButton(const StockID& stock_id);
+
+
/** Sets whether the button is displayed as a separate indicator and label.
* You can call this function on a checkbutton or a radiobutton with
* @a draw_indicator = <tt>false</tt> to make the button look like a normal button
*
- * This function only effects instances of classes like Gtk::CheckButton
+ * This function only affects instances of classes like Gtk::CheckButton
* and Gtk::RadioButton that derive from Gtk::ToggleButton,
* not instances of Gtk::ToggleButton itself.
* @param draw_indicator If <tt>true</tt>, draw the button as a separate indicator
void toggled();
-
+ /** Emitted whenever the toggle tool button changes state.
+ *
+ * @par Prototype:
+ * <tt>void on_my_%toggled()</tt>
+ */
+
Glib::SignalProxy0< void > signal_toggled();
- /** If the toggle button should be pressed in or not.
+ #ifdef GLIBMM_PROPERTIES_ENABLED
+/** If the toggle button should be pressed in or not.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy<bool> property_active() ;
+#endif //#GLIBMM_PROPERTIES_ENABLED
+#ifdef GLIBMM_PROPERTIES_ENABLED
/** If the toggle button should be pressed in or not.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly<bool> property_active() const;
+#endif //#GLIBMM_PROPERTIES_ENABLED
- /** If the toggle button is in an in-between state.
+ #ifdef GLIBMM_PROPERTIES_ENABLED
+/** If the toggle button is in an in between state.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy<bool> property_inconsistent() ;
+#endif //#GLIBMM_PROPERTIES_ENABLED
-/** If the toggle button is in an in-between state.
+#ifdef GLIBMM_PROPERTIES_ENABLED
+/** If the toggle button is in an in between state.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly<bool> property_inconsistent() const;
+#endif //#GLIBMM_PROPERTIES_ENABLED
- /** If the toggle part of the button is displayed.
+ #ifdef GLIBMM_PROPERTIES_ENABLED
+/** If the toggle part of the button is displayed.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy<bool> property_draw_indicator() ;
+#endif //#GLIBMM_PROPERTIES_ENABLED
+#ifdef GLIBMM_PROPERTIES_ENABLED
/** If the toggle part of the button is displayed.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly<bool> property_draw_indicator() const;
+#endif //#GLIBMM_PROPERTIES_ENABLED
};
namespace Glib
{
- /** @relates Gtk::ToggleButton
- * @param object The C instance
+ /** A Glib::wrap() method for this object.
+ *
+ * @param object The C instance.
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
* @result A C++ instance that wraps this C instance.
+ *
+ * @relates Gtk::ToggleButton
*/
Gtk::ToggleButton* wrap(GtkToggleButton* object, bool take_copy = false);
-}
+} //namespace Glib
+
+
#endif /* _GTKMM_TOGGLEBUTTON_H */