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

button.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-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 00024 00025 #ifndef GFC_GTK_BUTTON_HH 00026 #define GFC_GTK_BUTTON_HH 00027 00028 #ifndef GFC_GTK_BIN_HH 00029 #include <gfc/gtk/bin.hh> 00030 #endif 00031 00032 #ifndef __GTK_BUTTON_H__ 00033 #include <gtk/gtkbutton.h> 00034 #endif 00035 00036 namespace GFC { 00037 00038 namespace Gtk { 00039 00040 class Image; 00041 class StockId; 00042 00050 00051 class Button : public Bin 00052 { 00053 friend class G::Object; 00054 00055 Button(const Button&); 00056 Button& operator=(const Button&); 00057 00058 protected: 00061 00062 explicit Button(GtkButton *button, bool owns_reference = false); 00069 00073 00074 typedef G::Signal<void> PressedSignalType; 00075 typedef G::SignalProxy<TypeInstance, PressedSignalType> PressedSignalProxy; 00076 static const PressedSignalType pressed_signal; 00081 00082 typedef G::Signal<void> ReleasedSignalType; 00083 typedef G::SignalProxy<TypeInstance, ReleasedSignalType> ReleasedSignalProxy; 00084 static const ReleasedSignalType released_signal; 00089 00090 typedef G::Signal<void> ClickedSignalType; 00091 typedef G::SignalProxy<TypeInstance, ClickedSignalType> ClickedSignalProxy; 00092 static const ClickedSignalType clicked_signal; 00097 00098 typedef G::Signal<void> EnterSignalType; 00099 typedef G::SignalProxy<TypeInstance, EnterSignalType> EnterSignalProxy; 00100 static const EnterSignalType enter_signal; 00105 00106 typedef G::Signal<void> LeaveSignalType; 00107 typedef G::SignalProxy<TypeInstance, LeaveSignalType> LeaveSignalProxy; 00108 static const LeaveSignalType leave_signal; 00113 00114 typedef G::Signal<void> ActivateSignalType; 00115 typedef G::SignalProxy<TypeInstance, ActivateSignalType> ActivateSignalProxy; 00116 static const ActivateSignalType activate_signal; 00121 00123 00124 public: 00127 00128 Button(); 00130 00131 explicit Button(Image& image); 00134 00135 explicit Button(const char *label, bool use_underline = false); 00136 explicit Button(const String& label, bool use_underline = false); 00145 00146 Button(Image& image, const char *label, bool use_underline = false, bool horizontal = false); 00147 Button(Image& image, const String& label, bool use_underline = false, bool horizontal = false); 00157 00158 explicit Button(const StockId& stock_id); 00164 00165 virtual ~Button(); 00167 00171 00172 GtkButton* gtk_button() const; 00174 00175 operator GtkButton* () const; 00177 00178 ReliefStyle get_relief() const; 00180 00181 String get_label() const; 00187 00188 bool get_use_underline() const; 00190 00191 bool get_use_stock() const; 00195 00196 bool get_focus_on_click() const; 00199 00200 void get_alignment(float *xalign, float *yalign); 00207 00208 void pressed(); 00210 00211 void released(); 00213 00214 void clicked(); 00216 00217 void enter(); 00219 00220 void leave(); 00222 00223 void set_relief(ReliefStyle newstyle); 00229 00230 void set_label(const char *label); 00231 void set_label(const String& label); 00237 00238 void set_stock_id(const StockId& stock_id); 00246 00247 void set_use_underline(bool use_underline); 00251 00252 void set_use_stock(bool use_stock); 00256 00257 void set_image(Image& image, const String& label, bool use_underline = false, bool horizontal = false); 00268 00269 void set_focus_on_click(bool focus_on_click); 00275 00276 void set_alignment(float xalign, float yalign); 00283 00287 00288 const PressedSignalProxy sig_pressed(); 00290 00291 const ReleasedSignalProxy sig_released(); 00294 00295 const ClickedSignalProxy sig_clicked(); 00299 00300 const EnterSignalProxy sig_enter(); 00302 00303 const LeaveSignalProxy sig_leave(); 00305 00306 const ActivateSignalProxy sig_activate(); 00308 00310 }; 00311 00312 } // namespace Gtk 00313 00314 } // namespace GFC 00315 00316 #include <gfc/gtk/inline/button.inl> 00317 00318 #endif // GFC_GTK_BUTTON_HH 00319

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