/* Copyright (C) 2015 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see .
*/
#include
#include
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/button_p.h)
namespace Gtk
{
_WRAP_ENUM(ButtonRole, GtkButtonRole, decl_prefix GTKMM_API)
/** A button that uses a Gio::Action as model.
*
* ModelButton is a button class that can use a Gio::Action as its model.
* In contrast to ToggleButton or RadioButton, which can also
* be backed by a Gio::Action via Actionable::property_action_name(),
* ModelButton will adapt its appearance according to the kind of
* action it is backed by, and appear either as a plain, check or radio button.
*
* Model buttons are used with popovers from a menu model bound to the popover.
* They can also be used manually in a PopoverMenu.
*
* When the action is specified via Actionable::property_action_name()
* and Actionable::property_action_target(), the role of the button
* (i.e. whether it is a plain, check or radio button) is determined by
* the type of the action and doesn't have to be explicitly specified
* with property_role().
*
* The content of the button is specified by property_text() and property_icon().
*
* The appearance of model buttons can be influenced with
* property_centered() and property_iconic().
*
* Model buttons have built-in support for submenus in PopoverMenu.
* To make a ModelButton that opens a submenu when activated, set
* property_menu_name(). To make a button that goes
* back to the parent menu, you should set property_inverted()
* to place the submenu indicator at the opposite side.
*
* @newin{3,18}
*
* @ingroup Widgets
*/
class GTKMM_API ModelButton : public Button
{
_CLASS_GTKOBJECT(ModelButton, GtkModelButton, GTK_MODEL_BUTTON, Gtk::Button, GtkButton, , , GTKMM_API)
public:
_CTOR_DEFAULT
_WRAP_PROPERTY("role", ButtonRole)
_WRAP_PROPERTY("icon", Gio::Icon)
_WRAP_PROPERTY("text", Glib::ustring)
_WRAP_PROPERTY("active", bool)
_WRAP_PROPERTY("menu-name", Glib::ustring)
_WRAP_PROPERTY("inverted", bool)
_WRAP_PROPERTY("centered", bool)
_WRAP_PROPERTY("iconic", bool)
// ModelButton has no methods, signals, child properties nor vfuncs.
};
} //namespace Gtk