| 1 |
/* Copyright (C) 1998-2002 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/checkmenuitem.h> |
| 18 |
#include <gtkmm/radiobutton.h> |
| 19 |
_DEFS(gtkmm,gtk) |
| 20 |
_PINCLUDE(gtkmm/private/checkmenuitem_p.h) |
| 21 |
|
| 22 |
namespace Gtk |
| 23 |
{ |
| 24 |
|
| 25 |
class GTKMM_API RadioMenuItem; |
| 26 |
|
| 27 |
/** A CheckMenuItem that belongs to a group. |
| 28 |
* At each instant exactly one of the menu items from a group is selected. |
| 29 |
* @ingroup Menus |
| 30 |
* @ingroup Widgets |
| 31 |
*/ |
| 32 |
class GTKMM_API RadioMenuItem : public CheckMenuItem |
| 33 |
{ |
| 34 |
_CLASS_GTKOBJECT(RadioMenuItem, GtkRadioMenuItem, GTK_RADIO_MENU_ITEM, Gtk::CheckMenuItem, GtkCheckMenuItem, , , GTKMM_API) |
| 35 |
public: |
| 36 |
using Group = RadioButtonGroup; |
| 37 |
|
| 38 |
/** @newin{3,22} |
| 39 |
*/ |
| 40 |
_CTOR_DEFAULT() |
| 41 |
|
| 42 |
/** @newin{3,22} |
| 43 |
*/ |
| 44 |
explicit RadioMenuItem(const Glib::ustring& label, bool mnemonic = false); |
| 45 |
|
| 46 |
RadioMenuItem(Group& groupx); |
| 47 |
_IGNORE(gtk_radio_menu_item_new) |
| 48 |
RadioMenuItem(Group& groupx, const Glib::ustring& label, bool mnemonic = false); |
| 49 |
_IGNORE(gtk_radio_menu_item_new_with_label, gtk_radio_menu_item_new_with_mnemonic) |
| 50 |
|
| 51 |
//We ignore the _new_*_from_widget() functions because they are just the same as calling join_group() ourselves. |
| 52 |
_IGNORE(gtk_radio_menu_item_new_from_widget, gtk_radio_menu_item_new_with_mnemonic_from_widget, gtk_radio_menu_item_new_with_label_from_widget) |
| 53 |
|
| 54 |
_WRAP_METHOD(Group get_group(), gtk_radio_menu_item_get_group) |
| 55 |
_IGNORE(gtk_radio_menu_item_set_group) |
| 56 |
void set_group(Group& group); |
| 57 |
|
| 58 |
/** Removes the radio menu item from the group. |
| 59 |
*/ |
| 60 |
void reset_group(); |
| 61 |
|
| 62 |
#m4 _CONVERSION(`RadioMenuItem&',`GtkRadioMenuItem*',`($3).gobj()') |
| 63 |
_WRAP_METHOD(void join_group(RadioMenuItem& group_source), gtk_radio_menu_item_join_group, newin "3,22") |
| 64 |
|
| 65 |
_WRAP_SIGNAL(void group_changed(), "group_changed") |
| 66 |
|
| 67 |
/// Note that %property_group() corresponds to join_group(), rather than to get_group() and set_group(). |
| 68 |
_WRAP_PROPERTY("group", RadioMenuItem*, newin "3,22") |
| 69 |
|
| 70 |
protected: |
| 71 |
void constructor(const Group& group); |
| 72 |
}; |
| 73 |
|
| 74 |
} /* namspace Gtk */ |