vdk 2.4.0
slider.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 
28 #ifndef SLIDER_H
29 #define SLIDER_H
30 #include <vdk/vdkobj.h>
31 #include <vdk/vdkprops.h>
36 class VDKSlider: public VDKObject
37 {
38  GtkObject* adj;
39  static void ValueChanged(GtkWidget *wid, gpointer gp);
40  public:
41  //properties
45  VDKReadWriteValueProp<VDKSlider,float> Value;
49  VDKReadWriteValueProp<VDKSlider, int> Digits;
57  VDKReadWriteValueProp<VDKSlider, VDKUpdateType> UpdatePolicy;
61  VDKReadWriteValueProp<VDKSlider, float> LowerBound;
65  VDKReadWriteValueProp<VDKSlider, float> UpperBound;
69  VDKReadWriteValueProp<VDKSlider, float> Step;
81  VDKSlider(VDKForm* owner,
82  float defValue,
83  float lower,
84  float upper,
85  float step_increment,
86  int mode = h_box,
87  int w = 100,
88  int h = 30);
92  virtual ~VDKSlider();
93 
94  float GetValue() { return Value; }
95 
96  VDKUpdateType GetUpdatePolicy() { return UpdatePolicy; }
97 
98  void SetDigits(int digits)
99  {
100  gtk_scale_set_digits(GTK_SCALE(widget), digits);
101  Digits(digits);
102  }
103 
104  void SetUpdatePolicy(VDKUpdateType policy)
105  { gtk_range_set_update_policy(GTK_RANGE(widget), (GtkUpdateType) policy); }
106 
107  void SetValue(float f);
108 
109  float GetStep(void);
110  void SetStep(float f);
111 
112 
113 
114  float GetLowerBound(void);
115  void SetLowerBound(float f);
116 
117  float GetUpperBound(void);
118  void SetUpperBound(float f);
119 
120 #ifdef USE_SIGCPLUSPLUS
121 
126  VDKSignal1<void, float> OnSliderValueChanged;
127 #endif
128 };
129 #endif
VDKSlider::~VDKSlider
virtual ~VDKSlider()
Definition: slider.cc:83
VDKSlider::Digits
VDKReadWriteValueProp< VDKSlider, int > Digits
Definition: slider.h:49
VDKObject
Definition: vdkobj.h:137
VDKSlider::Step
VDKReadWriteValueProp< VDKSlider, float > Step
Definition: slider.h:69
VDKSlider::UpperBound
VDKReadWriteValueProp< VDKSlider, float > UpperBound
Definition: slider.h:65
VDKForm
VDKForm widgets, generally the outermost widget container.
Definition: forms.h:68
VDKSlider::VDKSlider
VDKSlider(VDKForm *owner, float defValue, float lower, float upper, float step_increment, int mode=h_box, int w=100, int h=30)
Definition: slider.cc:48
VDKSlider::LowerBound
VDKReadWriteValueProp< VDKSlider, float > LowerBound
Definition: slider.h:61
VDKObject::widget
GtkWidget * widget
Definition: vdkobj.h:241
VDKSlider
Provides a slider or "scale" widget.
Definition: slider.h:36
VDKSlider::UpdatePolicy
VDKReadWriteValueProp< VDKSlider, VDKUpdateType > UpdatePolicy
Definition: slider.h:57
VDKSlider::Value
VDKReadWriteValueProp< VDKSlider, float > Value
Definition: slider.h:45