| 1 |
/* Copyright (C) 2003 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
#include <gtkmm/toolbutton.h> |
| 18 |
_DEFS(gtkmm,gtk) |
| 19 |
_PINCLUDE(gtkmm/private/toolbutton_p.h) |
| 20 |
|
| 21 |
|
| 22 |
namespace Gtk |
| 23 |
{ |
| 24 |
|
| 25 |
/** A Gtk::ToolItem containing a toggle button. |
| 26 |
* |
| 27 |
* A ToggleToolButton is a Gtk::ToolItem that contains a toggle button. |
| 28 |
* |
| 29 |
* A ToggleToolButton widget looks like this: |
| 30 |
* @image html toggletoolbutton1.png |
| 31 |
* |
| 32 |
* @ingroup Widgets |
| 33 |
*/ |
| 34 |
class GTKMM_API ToggleToolButton : public ToolButton |
| 35 |
{ |
| 36 |
_CLASS_GTKOBJECT(ToggleToolButton, GtkToggleToolButton, GTK_TOGGLE_TOOL_BUTTON, Gtk::ToolButton, GtkToolButton, , , GTKMM_API) |
| 37 |
public: |
| 38 |
|
| 39 |
/** Creates a new ToggleToolButton. |
| 40 |
*/ |
| 41 |
_CTOR_DEFAULT() |
| 42 |
|
| 43 |
// _WRAP_CTOR does not take a 'deprecated' parameter. |
| 44 |
// _WRAP_CTOR(ToggleToolButton(const Gtk::StockID& stock_id), gtk_toggle_tool_button_new_from_stock) |
| 45 |
#ifndef GTKMM_DISABLE_DEPRECATED |
| 46 |
/** Creates a new ToggleToolButton from a StockID. |
| 47 |
* |
| 48 |
* The ToggleToolButton will be created according to the @a stock_id properties. |
| 49 |
* |
| 50 |
* @param stock_id The StockID which determines the look of the ToggleToolButton. |
| 51 |
* @deprecated Use one of the other constructors instead. |
| 52 |
*/ |
| 53 |
explicit ToggleToolButton(const Gtk::StockID& stock_id); |
| 54 |
_IGNORE(gtk_toggle_tool_button_new_from_stock) |
| 55 |
#endif // GTKMM_DISABLE_DEPRECATED |
| 56 |
|
| 57 |
/** Creates a new ToggleToolButton with a label. |
| 58 |
* |
| 59 |
* The ToggleToolButton will have the label @a label. |
| 60 |
* |
| 61 |
* @param label The string used to display the label for this ToggleToolButton. |
| 62 |
*/ |
| 63 |
explicit ToggleToolButton(const Glib::ustring& label); |
| 64 |
|
| 65 |
/** Creates a new ToggleToolButton with an image. |
| 66 |
* |
| 67 |
* The ToggleToolButton will have the label @a label and an image widget @a icon_widget. |
| 68 |
* |
| 69 |
* @param icon_widget The widget placed as the ToggleToolButton's icon. |
| 70 |
* @param label The string used to display the label for this ToggleToolButton. |
| 71 |
*/ |
| 72 |
explicit ToggleToolButton(Widget& icon_widget, const Glib::ustring& label = Glib::ustring()); |
| 73 |
|
| 74 |
_WRAP_METHOD(void set_active(bool is_active = true), gtk_toggle_tool_button_set_active) |
| 75 |
_WRAP_METHOD(bool get_active() const, gtk_toggle_tool_button_get_active) |
| 76 |
|
| 77 |
_WRAP_SIGNAL(void toggled(), toggled) |
| 78 |
|
| 79 |
_WRAP_PROPERTY("active", bool) |
| 80 |
}; |
| 81 |
|
| 82 |
} // namespace Gtk |