Main Page - Header
Author: The Inti Development Team

Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# checkmenuitem.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002 The Inti Development Team.
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU Library General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  */
    00018
    00021
    00022 #ifndef INTI_GTK_MENU_CHECK_ITEM_H
    00023 #define INTI_GTK_MENU_CHECK_ITEM_H
    00024
    00025 #ifndef INTI_GTK_MENU_ITEM_H
    00026 #include <inti/gtk/menuitem.h>
    00027 #endif
    00028
    00029 #ifndef __GTK_MENU_CHECK_ITEM_H__
    00030 #include <gtk/gtkcheckmenuitem.h>
    00031 #endif
    00032
    00033 namespace Inti {
    00034
    00035 namespace Gtk {
    00036
    00037 class CheckMenuItemClass;
    00038
    00046
    00047 class CheckMenuItem : public MenuItem
    00048 {
    00049         friend class G::Object;
    00050         friend class CheckMenuItemClass;
    00051
    00052         CheckMenuItem(const CheckMenuItem&);
    00053         CheckMenuItem& operator=(const CheckMenuItem&);
    00054
    00055 protected:
    00058
    00059         explicit CheckMenuItem(GtkCheckMenuItem *check_menu_item, bool reference = false);
    00066
    00068 //  Override this do_ method when you want to change the default behaviour of the GtkCheckMenuItem.
    00069
    00070         virtual void do_draw_indicator(GdkRectangle *area);
    00071
    00074         virtual void on_toggled();
    00076
    00078 //  Properties
    00079
    00080         typedef G::Property<bool> ActivePropertyType;
    00081         typedef G::PropertyProxy<G::Object, ActivePropertyType> ActivePropertyProxy;
    00082         static const ActivePropertyType active_property;
    00083
    00084         typedef G::Property<bool> InconsistentPropertyType;
    00085         typedef G::PropertyProxy<G::Object, InconsistentPropertyType> InconsistentPropertyProxy;
    00086         static const InconsistentPropertyType inconsistent_property;
    00087
    00088 //  Signals
    00089
    00090         typedef G::Signal0<void> ToggledSignalType;
    00091         typedef G::SignalProxy<TypeInstance, ToggledSignalType> ToggledSignalProxy;
    00092         static const ToggledSignalType toggled_signal;
    00093
    00094 public:
    00097
    00098         CheckMenuItem();
    00100
    00101         explicit CheckMenuItem(const String& label, bool use_underline = false);
    00108
    00109         virtual ~CheckMenuItem();
    00111
    00115
    00116         GtkCheckMenuItem* gtk_check_menu_item() const { return (GtkCheckMenuItem*)instance; }
    00118
    00119         GtkCheckMenuItemClass* gtk_check_menu_item_class() const;
    00121
    00122         operator GtkCheckMenuItem* () const;
    00124
    00125         bool get_active() const;
    00127
    00128         bool get_inconsistent() const;
    00130
    00134
    00135         void set_active(bool is_active);
    00138
    00139         void set_inconsistent(bool setting);
    00150
    00151         void toggled();
    00153
    00157
    00158         const ActivePropertyProxy prop_active()
    00159         {
    00160                 return ActivePropertyProxy(this, &active_property);
    00161         }
    00163
    00164         const InconsistentPropertyProxy prop_inconsistent()
    00165         {
    00166                 return InconsistentPropertyProxy(this, &inconsistent_property);
    00167         }
    00169
    00173
    00174         const ToggledSignalProxy sig_toggled()
    00175         {
    00176                 return ToggledSignalProxy(this, &toggled_signal);
    00177         }
    00179
    00181 };
    00182
    00183 } // namespace Gtk
    00184
    00185 } // namespace Inti
    00186
    00187 #endif // INTI_GTK_MENU_CHECK_ITEM_H
    00188

Main Page - Footer