vdk 2.4.0
spins.h
1 /*
2  * ===========================
3  * VDK Visual Development Kit
4  * Version 0.4
5  * October 1998
6  * ===========================
7  *
8  * Copyright (C) 1998, Mario Motta
9  * Developed by Mario Motta <mmotta@guest.net>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Library General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Library General Public License for more details.
20  *
21  * You should have received a copy of the GNU Library General Public
22  * License along with this library; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24  * 02111-1307, USA.
25  */
26 
27 #ifndef SPINS_H
28 #define SPINS_H
29 #include <vdk/vdkobj.h>
30 #include <vdk/vdkprops.h>
51 class VDKSpinButton: public VDKObject
52 {
53  static void ValueChanged(GtkWidget *wid, gpointer gp);
54  static void OnValueChanged(GtkWidget *wid, gpointer gp);
55  GtkObject* adj;
56  public:
57  //properties
61  VDKReadWriteValueProp<VDKSpinButton,float> ValueAsFloat;
65  VDKReadOnlyValueProp<VDKSpinButton,int> ValueAsInt;
69  VDKReadWriteValueProp<VDKSpinButton, int> Digits;
73  VDKReadWriteValueProp<VDKSpinButton, float> LowerBound;
77  VDKReadWriteValueProp<VDKSpinButton, float> UpperBound;
87  VDKSpinButton(VDKForm* owner,
88  float defValue,
89  float lower,
90  float upper,
91  float step_increment,
92  float climb_rate);
96  virtual ~VDKSpinButton();
97 
98  void SetDigits(int digits);
99  int GetValueAsInt();
100  void SetValueAsFloat(float f);
101  float GetValueAsFloat();
102  void SetLowerBound(float f);
103  float GetLowerBound();
104  void SetUpperBound(float f);
105  float GetUpperBound();
111  virtual void SetForeground(VDKRgb color,
112  GtkStateType state = GTK_STATE_NORMAL);
118  virtual void SetBackground(VDKRgb color,
119  GtkStateType state = GTK_STATE_NORMAL);
120 
121 #ifdef USE_SIGCPLUSPLUS
122  public:
128  VDKSignal1<void, float> OnSpinValueChanged;
129 #endif /* USE_SIGCPLUSPLUS */
130 };
131 #endif
Definition: vdkobj.h:137
VDKReadOnlyValueProp< VDKSpinButton, int > ValueAsInt
Definition: spins.h:65
VDKReadWriteValueProp< VDKSpinButton, float > LowerBound
Definition: spins.h:73
virtual void SetBackground(VDKRgb color, GtkStateType state=GTK_STATE_NORMAL)
Definition: spins.cc:162
VDKReadWriteValueProp< VDKSpinButton, float > ValueAsFloat
Definition: spins.h:61
Provides a spin button widget.
Definition: spins.h:51
VDKForm widgets, generally the outermost widget container.
Definition: forms.h:68
Provides a simple RGB color structure.
Definition: vdkutils.h:37
VDKReadWriteValueProp< VDKSpinButton, float > UpperBound
Definition: spins.h:77
VDKReadWriteValueProp< VDKSpinButton, int > Digits
Definition: spins.h:69
virtual void SetForeground(VDKRgb color, GtkStateType state=GTK_STATE_NORMAL)
Definition: spins.cc:142
virtual ~VDKSpinButton()
Definition: spins.cc:85
VDKSpinButton(VDKForm *owner, float defValue, float lower, float upper, float step_increment, float climb_rate)
Definition: spins.cc:47