ALBA
albaGUIFloatSlider.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUIFloatSlider
5 Authors: Silvano Imboden
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16#ifndef __albaGUIFloatSlider_H__
17#define __albaGUIFloatSlider_H__
18
19//#ifdef __WIN32__
20// #define FLOAT_SLIDER_PARENT wxSlider95
21//#else
22 #define FLOAT_SLIDER_PARENT wxSlider
23//#endif
24//----------------------------------------------------------------------------
25// Include:
26//----------------------------------------------------------------------------
27
28
29//----------------------------------------------------------------------------
30// albaGUIFloatSlider
37//----------------------------------------------------------------------------
38class ALBA_EXPORT albaGUIFloatSlider: public FLOAT_SLIDER_PARENT
39{
40 DECLARE_DYNAMIC_CLASS(albaGUIFloatSlider)
41public:
42
43 albaGUIFloatSlider( wxWindow *parent=NULL,
44 wxWindowID id=-1,
45 const double &value=0,
46 const double &minvalue=0,
47 const double &maxvalue=1,
48 const wxPoint &position=wxDefaultPosition,
49 const wxSize& size=wxDefaultSize,
50 long style=wxSL_HORIZONTAL );
52
54 void SetValue(double value);
55
57 double GetValue();
58
61
63 void SetRange(double min,double max,double value);
64
66 void SetRange(double min,double max);
67
69 void SetNumberOfSteps(int num);
70
72 int GetNumberOfSteps() {return this->m_Ticks;};
73
75 double GetStep() {return this->m_Step;};
76
78 void SetMax(double max);
79
81 double GetMax() {return this->m_Max;};
82
84 void SetMin(double min);
85
87 double GetMin() {return this->m_Min;};
88
89protected:
90 double Round(double val);
91 double Pow10(double exponent);
92 void DiscretizeRangeRange(double min,double max,double n, double *ra,double *rb,double *rs);
93
96
97 double m_Value;
98 double m_Step;
99 double m_Max;
100 double m_Min;
101};
102#endif
#define FLOAT_SLIDER_PARENT
a Slider that can be used to set double values, albaGUIFloatSlider send usual wxWindows Events; Use a...
double GetMax()
Get the slider's max value.
void SetRange(double min, double max)
Set the slider range.
double GetSliderValue()
Get the slider Value.
double GetValue()
Get the current value.
void SetMin(double min)
Set the slider's min value.
void SetRange(double min, double max, double value)
Set the slider range and value.
double GetMin()
Get the slider's min value.
double Round(double val)
void SetMax(double max)
Set the slider's max value.
void DiscretizeRangeRange(double min, double max, double n, double *ra, double *rb, double *rs)
void SetNumberOfSteps(int num)
Set the number of slider's steps.
double GetStep()
Get the slider's step value.
double Pow10(double exponent)
albaGUIFloatSlider(wxWindow *parent=NULL, wxWindowID id=-1, const double &value=0, const double &minvalue=0, const double &maxvalue=1, const wxPoint &position=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxSL_HORIZONTAL)
int GetNumberOfSteps()
Get the number of slider's steps.
void SetValue(double value)
Set the slider value.