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

spinbutton.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 00023 00024 #ifndef GFC_GTK_SPIN_BUTTON_HH 00025 #define GFC_GTK_SPIN_BUTTON_HH 00026 00027 #ifndef GFC_GTK_ENTRY_HH 00028 #include <gfc/gtk/entry.hh> 00029 #endif 00030 00031 #ifndef __GTK_SPIN_BUTTON_H__ 00032 #include <gtk/gtkspinbutton.h> 00033 #endif 00034 00035 namespace GFC { 00036 00037 namespace Gtk { 00038 00042 00043 enum SpinType 00044 { 00045 SPIN_STEP_FORWARD = GTK_SPIN_STEP_FORWARD, 00046 SPIN_STEP_BACKWARD = GTK_SPIN_STEP_BACKWARD, 00047 SPIN_PAGE_FORWARD = GTK_SPIN_PAGE_FORWARD, 00048 SPIN_PAGE_BACKWARD = GTK_SPIN_PAGE_BACKWARD, 00049 SPIN_HOME = GTK_SPIN_HOME, 00050 SPIN_END = GTK_SPIN_END, 00051 SPIN_USER_DEFINED = GTK_SPIN_USER_DEFINED 00052 }; 00053 00056 00057 enum SpinButtonUpdatePolicy 00058 { 00059 UPDATE_ALWAYS = GTK_UPDATE_ALWAYS, 00061 00062 UPDATE_IF_VALID = GTK_UPDATE_IF_VALID 00065 }; 00066 00172 00173 class SpinButton : public Entry 00174 { 00175 friend class G::Object; 00176 00177 SpinButton(const SpinButton&); 00178 SpinButton& operator=(const SpinButton&); 00179 00180 protected: 00183 00184 explicit SpinButton(GtkSpinButton *spin_button, bool owns_reference = false); 00191 00195 00196 typedef G::Signal<int, double*> InputSignalType; 00197 typedef G::SignalProxy<TypeInstance, InputSignalType> InputSignalProxy; 00198 static const InputSignalType input_signal; 00205 00206 typedef G::Signal<int> OutputSignalType; 00207 typedef G::SignalProxy<TypeInstance, OutputSignalType> OutputSignalProxy; 00208 static const OutputSignalType output_signal; 00213 00214 typedef G::Signal<void> ValueChangedSignalType; 00215 typedef G::SignalProxy<TypeInstance, ValueChangedSignalType> ValueChangedSignalProxy; 00216 static const ValueChangedSignalType value_changed_signal; 00221 00223 00224 public: 00227 00228 SpinButton(); 00230 00231 SpinButton(Adjustment *adjustment, double climb_rate, unsigned int digits); 00236 00237 SpinButton(double min, double max, double step = 1.0); 00247 00248 virtual ~SpinButton(); 00250 00254 00255 GtkSpinButton* gtk_spin_button() const; 00257 00258 operator GtkSpinButton* () const; 00260 00261 Adjustment* get_adjustment() const; 00263 00264 unsigned int get_digits() const; 00267 00268 void get_increments(double *step, double *page) const; 00272 00273 void get_range(double *min, double *max) const; 00277 00278 double get_value() const; 00280 00281 int get_value_as_int() const; 00284 00285 SpinButtonUpdatePolicy get_update_policy() const; 00288 00289 bool get_numeric() const; 00292 00293 bool get_wrap() const; 00297 00298 bool get_snap_to_ticks() const; 00301 00305 00306 void configure(Adjustment *adjustment, double climb_rate, unsigned int digits); 00314 00315 void set_adjustment(Adjustment *adjustment); 00318 00319 void set_digits(unsigned int digits); 00324 00325 void set_increments(double step, double page); 00331 00332 void set_range(double min, double max); 00336 00337 void set_value(double value); 00340 00341 void set_update_policy(SpinButtonUpdatePolicy policy); 00346 00347 void set_numeric(bool numeric); 00350 00351 void spin(SpinType direction, double increment); 00355 00356 void set_wrap(bool wrap); 00360 00361 void set_snap_to_ticks(bool snap_to_ticks); 00365 00366 void update(); 00368 00372 00373 const InputSignalProxy sig_input(); 00375 00376 const OutputSignalProxy sig_output(); 00378 00379 const ValueChangedSignalProxy sig_value_changed(); 00381 00383 }; 00384 00385 } // namespace Gtk 00386 00387 } // namespace GFC 00388 00389 #include <gfc/gtk/inline/spinbutton.inl> 00390 00391 #endif // GFC_GTK_SPIN_BUTTON_HH 00392

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