/* $Id: radiomenuitem.hg,v 1.7 2005/04/07 08:46:44 murrayc Exp $ */

/* radiomenuitem.h
 * 
 * Copyright (C) 1998-2002 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <gtkmm/checkmenuitem.h>
#include <gtkmm/radiobutton.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/checkmenuitem_p.h)

namespace Gtk
{

class RadioMenuItem;

/** A CheckMenuItem that belongs to a group.
 * At each instant exactly one of the menu items from a group is selected.
 * @ingroup Menus
 * @ingroup Widgets
 */
class RadioMenuItem : public CheckMenuItem
{
  _CLASS_GTKOBJECT(RadioMenuItem, GtkRadioMenuItem, GTK_RADIO_MENU_ITEM, Gtk::CheckMenuItem, GtkCheckMenuItem)
public:
  
  typedef RadioButtonGroup Group;

  RadioMenuItem(Group& groupx);
  _IGNORE(gtk_radio_menu_item_new)
  RadioMenuItem(Group& groupx, const Glib::ustring& label, bool mnemonic = false);
  _IGNORE(gtk_radio_menu_item_new_with_label, gtk_radio_menu_item_new_with_mnemonic)

  //We ignore the _new_*_from_widget() functions because they are just the same as calling get_group() and set_group() ourselves.
  _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)
                    
  _WRAP_METHOD(Group get_group(), gtk_radio_menu_item_get_group)
  _IGNORE(gtk_radio_menu_item_set_group)
  void set_group(Group& group);
  void reset_group();

  /** Emitted when the group of radio menu items that a radio menu item belongs
   * to changes. This is emitted when a radio menu item switches from
   * being alone to being part of a group of 2 or more menu items, or
   * vice-versa, and when a buttton is moved from one group of 2 or
   * more menu items to a different one, but not when the composition
   * of the group that a menu item belongs to changes.
   */
  _WRAP_SIGNAL(void group_changed(), "group_changed")

  //Probably wouldn't work: _WRAP_PROPERTY("group", Group)

protected:
  void constructor(const Group& group);
};

} /* namspace Gtk */

