vdk 2.4.0
|
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 #ifndef SPINS_H 00028 #define SPINS_H 00029 #include <vdk/vdkobj.h> 00030 #include <vdk/vdkprops.h> 00051 class VDKSpinButton: public VDKObject 00052 { 00053 static void ValueChanged(GtkWidget *wid, gpointer gp); 00054 static void OnValueChanged(GtkWidget *wid, gpointer gp); 00055 GtkObject* adj; 00056 public: 00057 //properties 00061 VDKReadWriteValueProp<VDKSpinButton,float> ValueAsFloat; 00065 VDKReadOnlyValueProp<VDKSpinButton,int> ValueAsInt; 00069 VDKReadWriteValueProp<VDKSpinButton, int> Digits; 00073 VDKReadWriteValueProp<VDKSpinButton, float> LowerBound; 00077 VDKReadWriteValueProp<VDKSpinButton, float> UpperBound; 00087 VDKSpinButton(VDKForm* owner, 00088 float defValue, 00089 float lower, 00090 float upper, 00091 float step_increment, 00092 float climb_rate); 00096 virtual ~VDKSpinButton(); 00097 00098 void SetDigits(int digits); 00099 int GetValueAsInt(); 00100 void SetValueAsFloat(float f); 00101 float GetValueAsFloat(); 00102 void SetLowerBound(float f); 00103 float GetLowerBound(); 00104 void SetUpperBound(float f); 00105 float GetUpperBound(); 00111 virtual void SetForeground(VDKRgb color, 00112 GtkStateType state = GTK_STATE_NORMAL); 00118 virtual void SetBackground(VDKRgb color, 00119 GtkStateType state = GTK_STATE_NORMAL); 00120 00121 #ifdef USE_SIGCPLUSPLUS 00122 public: 00128 VDKSignal1<void, float> OnSpinValueChanged; 00129 #endif /* USE_SIGCPLUSPLUS */ 00130 }; 00131 #endif