| 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 |
_CONFIGINCLUDE(gtkmmconfig.h) |
| 18 |
|
| 19 |
#include <gtkmm/toolbutton.h> |
| 20 |
#include <gtkmm/menu.h> |
| 21 |
|
| 22 |
_DEFS(gtkmm,gtk) |
| 23 |
_PINCLUDE(gtkmm/private/toolbutton_p.h) |
| 24 |
|
| 25 |
namespace Gtk |
| 26 |
{ |
| 27 |
|
| 28 |
/** A Gtk::ToolItem containing a toggle button. |
| 29 |
* |
| 30 |
* A MenuToolButton is a Gtk::ToolItem that contains a menu. |
| 31 |
* @ingroup Widgets |
| 32 |
*/ |
| 33 |
class GTKMM_API MenuToolButton : public ToolButton |
| 34 |
{ |
| 35 |
_CLASS_GTKOBJECT(MenuToolButton, GtkMenuToolButton, GTK_MENU_TOOL_BUTTON, Gtk::ToolButton, GtkToolButton, , , GTKMM_API) |
| 36 |
|
| 37 |
public: |
| 38 |
/** Creates a new MenuToolButton. |
| 39 |
*/ |
| 40 |
_CTOR_DEFAULT() |
| 41 |
|
| 42 |
// _WRAP_CTOR does not take a 'deprecated' parameter. |
| 43 |
// _WRAP_CTOR(MenuToolButton(const Gtk::StockID& stock_id), gtk_toggle_tool_button_new_from_stock) |
| 44 |
#ifndef GTKMM_DISABLE_DEPRECATED |
| 45 |
/** Creates a new MenuToolButton from a StockID. |
| 46 |
* |
| 47 |
* The MenuToolButton will be created according to the @a stock_id properties. |
| 48 |
* |
| 49 |
* @param stock_id The StockID which determines the look of the MenuToolButton. |
| 50 |
* @deprecated Use one of the other constructors instead. |
| 51 |
*/ |
| 52 |
explicit MenuToolButton(const Gtk::StockID& stock_id); |
| 53 |
_IGNORE(gtk_menu_tool_button_new_from_stock) |
| 54 |
#endif // GTKMM_DISABLE_DEPRECATED |
| 55 |
|
| 56 |
/** Creates a new MenuToolButton with a label. |
| 57 |
* |
| 58 |
* The MenuToolButton will have the label @a label. |
| 59 |
* |
| 60 |
* @param label The string used to display the label for this MenuToolButton. |
| 61 |
*/ |
| 62 |
explicit MenuToolButton(const Glib::ustring& label); |
| 63 |
|
| 64 |
/** Creates a new MenuToolButton with an image. |
| 65 |
* |
| 66 |
* The MenuToolButton will have the label @a label and an image widget @a icon_widget. |
| 67 |
* |
| 68 |
* @param icon_widget The widget placed as the MenuToolButton's icon. |
| 69 |
* @param label The string used to display the label for this MenuToolButton. |
| 70 |
*/ |
| 71 |
explicit MenuToolButton(Widget& icon_widget, const Glib::ustring& label = Glib::ustring()); |
| 72 |
|
| 73 |
_WRAP_METHOD(void set_menu(Menu& menu), gtk_menu_tool_button_set_menu) |
| 74 |
_WRAP_METHOD(Menu* get_menu(), gtk_menu_tool_button_get_menu) |
| 75 |
_WRAP_METHOD(const Menu* get_menu() const, gtk_menu_tool_button_get_menu, constversion) |
| 76 |
|
| 77 |
_WRAP_METHOD(void set_arrow_tooltip_text(const Glib::ustring& text), gtk_menu_tool_button_set_arrow_tooltip_text) |
| 78 |
_WRAP_METHOD(void set_arrow_tooltip_markup(const Glib::ustring& markup), gtk_menu_tool_button_set_arrow_tooltip_markup) |
| 79 |
|
| 80 |
_WRAP_SIGNAL(void show_menu(), show_menu) |
| 81 |
_WRAP_PROPERTY("menu", Menu*) |
| 82 |
}; |
| 83 |
|
| 84 |
} // namespace Gtk |