GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

radioaction.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2004 The GFC 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 00026 00027 #ifndef GFC_GTK_RADIO_ACTION_HH 00028 #define GFC_GTK_RADIO_ACTION_HH 00029 00030 #ifndef GFC_GTK_TOGGLE_ACTION_HH 00031 #include <gfc/gtk/toggleaction.hh> 00032 #endif 00033 00034 #ifndef GFC_STACK_OBJECT_HH 00035 #include <gfc/stackobject.hh> 00036 #endif 00037 00038 #ifndef __GTK_RADIO_ACTION_H__ 00039 #include <gtk/gtkradioaction.h> 00040 #endif 00041 00042 namespace GFC { 00043 00044 namespace Gtk { 00045 00046 class AccelKey; 00047 00053 00054 class RadioAction : public ToggleAction 00055 { 00056 friend class G::Object; 00057 00058 RadioAction(const RadioAction&); 00059 RadioAction& operator=(const RadioAction&); 00060 00061 protected: 00064 00065 explicit RadioAction(GtkRadioAction *action, bool owns_reference = true); 00072 00076 00077 typedef G::Signal<void, RadioAction&> ChangedSignalType; 00078 typedef G::SignalProxy<TypeInstance, ChangedSignalType> ChangedSignalProxy; 00079 static const ChangedSignalType changed_signal; 00085 00087 00088 public: 00089 typedef GSList Group; 00091 00094 00095 RadioAction(const RadioAction *group, const char *name, const char *label, int value); 00096 RadioAction(const RadioAction *group, const String& name, const String& label, int value); 00105 00106 RadioAction(const RadioAction *group, const char *name, const StockId& stock_id, int value); 00107 RadioAction(const RadioAction *group, const String& name, const StockId& stock_id, int value); 00116 00117 RadioAction(const RadioAction *group, const char *name, const char *label, const StockId& stock_id, int value); 00118 RadioAction(const RadioAction *group, const String& name, const String& label, const StockId& stock_id, int value); 00129 00130 virtual ~RadioAction(); 00132 00136 00137 GtkRadioAction* gtk_radio_action() const; 00139 00140 operator GtkRadioAction* () const; 00142 00143 Group* get_group() const; 00146 00147 int get_value() const; 00150 00151 int get_current_value() const; 00154 00158 00159 void set_group(Group *group); 00162 00166 00167 const ChangedSignalProxy sig_changed(); 00173 00175 }; 00176 00186 00187 class RadioActions : public StackObject 00188 { 00189 friend class ActionGroup; 00190 00191 RadioActions(const RadioActions&); 00192 RadioActions& operator=(const RadioActions&); 00193 00194 std::vector<RadioAction*> actions_; 00195 RadioAction *group_; 00196 00197 public: 00200 00201 RadioActions(); 00204 00205 ~RadioActions(); 00207 00211 00212 RadioAction* add(const char *name, const char *label, int value, const char *tooltip = 0); 00218 00219 RadioAction* add(const char *name, const char *label, const AccelKey& accel_key, int value, const char *tooltip = 0); 00226 00227 RadioAction* add(const char *name, const StockId& stock_id, int value, const char *tooltip = 0); 00233 00234 RadioAction* add(const char *name, const StockId& stock_id, const AccelKey& accel_key, int value, const char *tooltip = 0); 00241 00242 RadioAction* add(const char *name, const char *label, const StockId& stock_id, int value, const char *tooltip = 0); 00249 00250 RadioAction* add(const char *name, const char *label, const StockId& stock_id, const AccelKey& accel_key, int value, const char *tooltip = 0); 00258 00259 void clear(); 00261 }; 00262 00263 } // namespace Gtk 00264 00265 } // namespace GFC 00266 00267 #include <gfc/gtk/inline/radioaction.inl> 00268 00269 #endif // GFC_GTK_RADIO_ACTION_HH 00270

Generated on Tue Aug 24 00:34:31 2004 for GFC-UI by doxygen 1.3.8