Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

togglebutton.h

Go to the documentation of this file.
00001 /*  Inti: Integrated Foundation Classes
00002  *  Copyright (C) 2002-2003 The Inti Development Team.
00003  *  Copyright (C) 2000 Red Hat, Inc.
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU Library General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU Library General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018  */
00019  
00025 
00026 #ifndef INTI_GTK_TOGGLE_BUTTON_H
00027 #define INTI_GTK_TOGGLE_BUTTON_H
00028 
00029 #ifndef INTI_GTK_BUTTON_H
00030 #include <inti/gtk/button.h>
00031 #endif
00032 
00033 #ifndef __GTK_TOGGLE_BUTTON_H__
00034 #include <gtk/gtktogglebutton.h>
00035 #endif
00036 
00037 namespace Inti {
00038 
00039 namespace Gtk {
00040 
00041 class ToggleButtonClass;
00042 
00053  
00054 class ToggleButton : public Button
00055 {
00056         friend class G::Object;
00057         friend class ToggleButtonClass;
00058 
00059         ToggleButton(const ToggleButton&);
00060         ToggleButton& operator=(const ToggleButton&);
00061 
00062 protected:
00065 
00066         explicit ToggleButton(GtkToggleButton *toggle_button, bool reference = false);
00073         
00077 
00078         virtual void on_toggled();
00080                 
00082 //  Properties
00083 
00084         typedef G::Property<bool> ActivePropertyType;
00085         typedef G::PropertyProxy<G::Object, ActivePropertyType> ActivePropertyProxy;
00086         static const ActivePropertyType active_property;
00087 
00088         typedef G::Property<bool> InconsistentPropertyType;
00089         typedef G::PropertyProxy<G::Object, InconsistentPropertyType> InconsistentPropertyProxy;
00090         static const InconsistentPropertyType inconsistent_property;
00091 
00092         typedef G::Property<bool> DrawIndicatorPropertyType;
00093         typedef G::PropertyProxy<G::Object, DrawIndicatorPropertyType> DrawIndicatorPropertyProxy;
00094         static const DrawIndicatorPropertyType draw_indicator_property;
00095 
00096 //  Signals
00097 
00098         typedef G::Signal0<void> ToggledSignalType;
00099         typedef G::SignalProxy<TypeInstance, ToggledSignalType> ToggledSignalProxy;
00100         static const ToggledSignalType toggled_signal;
00101 
00102 public:
00105 
00106         ToggleButton();
00109          
00110         explicit ToggleButton(const String& label, bool use_underline = false);
00119         
00120         virtual ~ToggleButton();
00122         
00126 
00127         GtkToggleButton* gtk_toggle_button() const { return (GtkToggleButton*)instance; }
00129         
00130         GtkToggleButtonClass* gtk_toggle_button_class() const;
00132         
00133         operator GtkToggleButton* () const;
00135 
00136         bool get_active() const;
00139 
00140         bool get_mode() const; 
00143         
00144         bool get_inconsistent() const;
00147          
00151         
00152         void set_mode(bool draw_indicator);
00161 
00162         void set_active(bool is_active);
00168         
00169         void set_inconsistent(bool setting);
00179         
00180         void toggled();
00182 
00186         
00187         const ActivePropertyProxy prop_active()
00188         {
00189                 return ActivePropertyProxy(this, &active_property);
00190         }
00192 
00193         const InconsistentPropertyProxy prop_inconsistent()
00194         {
00195                 return InconsistentPropertyProxy(this, &inconsistent_property);
00196         }
00198 
00199         const DrawIndicatorPropertyProxy prop_draw_indicator()
00200         {
00201                 return DrawIndicatorPropertyProxy(this, &draw_indicator_property);
00202         }
00204 
00208         
00209         const ToggledSignalProxy sig_toggled()
00210         {
00211                 return ToggledSignalProxy(this, &toggled_signal);
00212         }
00214         
00216 };
00217 
00218 } // namespace Gtk
00219 
00220 } // namespace Inti
00221 
00222 #endif // INTI_GTK_TOGGLE_BUTTON_H
00223 
Main Page - Footer


Generated on Sun Sep 14 20:08:04 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002