/*
 * 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/button.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/button_p.h)

namespace Gtk
{

/** Create buttons which retain their state.
 *
 * A %Gtk::ToggleButton is a Gtk::Button which will remain “pressed-in” when
 * clicked. Clicking again will cause the toggle button to return to its
 * normal state.
 *
 * The state of a %Gtk::ToggleButton can be set specifically using
 * set_active(), and retrieved using get_active().
 *
 * @see Button, CheckButton
 * @ingroup Widgets
 */
class GTKMM_API ToggleButton : public Button
{
  _CLASS_GTKOBJECT(ToggleButton, GtkToggleButton, GTK_TOGGLE_BUTTON, Gtk::Button, GtkButton,,,GTKMM_API)
public:

  /** Create an empty toggle button.
   * With an empty button, you can Gtk::Button::add() a widget such as a
   * Gtk::Image or Gtk::Box.
   *
   * If you just wish to add a Gtk::Label, you may want to use the
   * Gtk::ToggleButton(const Glib::ustring &label, bool mnemonic)
   * constructor directly instead.
   */
  _CTOR_DEFAULT

  /** Create a toggle button with a label.
   * You won't be able to add a widget to this button since it
   * already contains a Gtk::Label.
   */
  explicit ToggleButton(const Glib::ustring& label, bool mnemonic = false);

  _WRAP_METHOD(void set_active(bool is_active = true),gtk_toggle_button_set_active)
  _WRAP_METHOD(bool get_active() const,gtk_toggle_button_get_active)

  _WRAP_METHOD(void toggled(), gtk_toggle_button_toggled,
    deprecated "There is no good reason for an application ever to call this function.")

  _WRAP_METHOD(void set_group(ToggleButton& group), gtk_toggle_button_set_group)
  void unset_group();

  _WRAP_SIGNAL(void toggled(), "toggled")

  _WRAP_PROPERTY("active", bool)
  _WRAP_PROPERTY("group", ToggleButton*)
};

} //namespace Gtk

