Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | Related Pages

slider.h

00001 /*
00002  * ===========================
00003  * VDK Visual Development Kit
00004  * Version 0.4
00005  * October 1998
00006  * ===========================
00007  *
00008  * Copyright (C) 1998, Mario Motta
00009  * Developed by Mario Motta <mmotta@guest.net>
00010  *
00011  * This library is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU Library General Public
00013  * License as published by the Free Software Foundation; either
00014  * version 2 of the License, or (at your option) any later version.
00015  *
00016  * This library is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  * Library General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Library General Public
00022  * License along with this library; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00024  * 02111-1307, USA.
00025  */
00026 
00027 
00028 #ifndef SLIDER_H
00029 #define SLIDER_H
00030 #include <vdk/vdkobj.h>
00031 #include <vdk/vdkprops.h>
00036 class VDKSlider: public VDKObject
00037 {
00038   GtkObject* adj; 
00039   static void ValueChanged(GtkWidget *wid, gpointer gp);
00040  public:
00041   //properties
00045   VDKReadWriteValueProp<VDKSlider,float> Value;
00049   VDKReadWriteValueProp<VDKSlider, int> Digits;
00057   VDKReadWriteValueProp<VDKSlider, VDKUpdateType> UpdatePolicy;
00061   VDKReadWriteValueProp<VDKSlider, float> LowerBound;
00065   VDKReadWriteValueProp<VDKSlider, float> UpperBound;
00069   VDKReadWriteValueProp<VDKSlider, float> Step;
00081   VDKSlider(VDKForm* owner,
00082             float defValue,
00083             float lower,
00084             float upper,
00085             float step_increment,
00086             int mode = h_box,
00087             int w = 100,
00088             int h = 30);
00092   virtual ~VDKSlider();
00093 
00094   float GetValue() { return Value; }
00095 
00096   VDKUpdateType  GetUpdatePolicy() { return UpdatePolicy; }
00097 
00098   void SetDigits(int digits) 
00099     { 
00100       gtk_scale_set_digits(GTK_SCALE(widget), digits); 
00101       Digits(digits);
00102     }
00103 
00104   void SetUpdatePolicy(VDKUpdateType policy)
00105     { gtk_range_set_update_policy(GTK_RANGE(widget), (GtkUpdateType) policy); }
00106 
00107   void SetValue(float f);
00108 
00109   float GetStep(void);
00110   void SetStep(float f);
00111 
00112   
00113 
00114   float GetLowerBound(void);
00115   void SetLowerBound(float f);
00116 
00117   float GetUpperBound(void);
00118   void SetUpperBound(float f);
00119 
00120 #ifdef USE_SIGCPLUSPLUS
00121 
00126      VDKSignal1<void, float> OnSliderValueChanged;
00127 #endif
00128 };
00129 #endif

Generated on Wed Aug 6 11:01:51 2003 for vdk 2.0.3 by doxygen 1.3.2