00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00047 #ifdef _USE_WXWIDGETS_
00048
00049
00050
00051
00052 #ifndef __bbwxSlider_h_INCLUDED__
00053 #define __bbwxSlider_h_INCLUDED__
00054
00055
00056 #include "bbtkWxBlackBox.h"
00057
00058
00059
00060
00061
00062
00063 namespace bbwx
00064 {
00065
00066
00067
00068 class Slider;
00069
00070
00071
00072 class SliderWidget : public wxPanel
00073 {
00074 public:
00078 SliderWidget(Slider* box, wxWindow *parent,
00079 int orientation,
00080 bool changeresolution,
00081 bool label,
00082 wxString title,
00083 int vmin,
00084 int vmax,
00085 int value,
00086 int track);
00088 ~SliderWidget();
00091 void OnSliderTrack(wxScrollEvent& event);
00093 void OnSliderRelease(wxScrollEvent& event);
00096 void OnResolutionOfSlider(wxScrollEvent& event);
00097
00098
00099 int GetValue() { return mwxSlider->GetValue(); }
00100 void SetRange(int min, int max);
00101
00102 void RefreshLabels();
00103
00104 private:
00105 Slider* mBox;
00106 wxSlider *mwxSlider;
00107 wxSlider *mResolutionOfSlider;
00108 int min;
00109 int max;
00110 int reactiveOnTrack;
00111 wxStaticText *label_vertical;
00112 wxStaticText *label_min;
00113 wxStaticText *label_max;
00114 };
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124 class Slider : public bbtk::WxBlackBox
00125 {
00126
00127 BBTK_BLACK_BOX_INTERFACE(Slider,bbtk::WxBlackBox);
00128 BBTK_DECLARE_INPUT(In,int);
00129 BBTK_DECLARE_INPUT(Min,int);
00130 BBTK_DECLARE_INPUT(Max,int);
00131 BBTK_DECLARE_INPUT(Label,bool);
00132 BBTK_DECLARE_INPUT(Title,std::string);
00133 BBTK_DECLARE_INPUT(Orientation,std::string);
00134 BBTK_DECLARE_INPUT(ChangeResolution,bool);
00135 BBTK_DECLARE_INPUT(ReactiveOnTrack,int);
00136 BBTK_DECLARE_OUTPUT(Out,int);
00137 BBTK_PROCESS(Process);
00138 BBTK_CREATE_WIDGET(CreateWidget);
00139 void Process();
00140 void CreateWidget();
00141
00142 protected:
00143 virtual void bbUserConstructor();
00144 };
00145
00146
00147
00148
00149 BBTK_BEGIN_DESCRIBE_BLACK_BOX(Slider,bbtk::WxBlackBox);
00150 BBTK_NAME("Slider");
00151 BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
00152
00153 BBTK_DESCRIPTION("Slider widget (wxSlider)");
00154 BBTK_INPUT(Slider,In,"Initial position of the slider (default 0)",int,"");
00155 BBTK_INPUT(Slider,Min,"Minimum value of the slider (default 0)",int,"");
00156 BBTK_INPUT(Slider,Max,"Maximum value of the slider (default 500)",int,"");
00157 BBTK_INPUT(Slider,Label,"Show slider labels ? (default FALSE) ",bool,"");
00158 BBTK_INPUT(Slider,Title,"Title shown above the slider (default '') ", std::string,"");
00159 BBTK_INPUT(Slider,Orientation, "Orientation : (default H) 0=H=HORIZONTAL, 1=V=VERTICAL ",std::string,"");
00160 BBTK_INPUT(Slider,ChangeResolution, "Can the user change the resolution of the slider ? (default FALSE) ",bool,"");
00161 BBTK_INPUT(Slider,ReactiveOnTrack, "Slider sends info when track moves (default 0 = no)",int,"");
00162 BBTK_OUTPUT(Slider,Out,"Current position of the slider",int,"");
00163 BBTK_END_DESCRIBE_BLACK_BOX(Slider);
00164
00165
00166
00167
00168 }
00169
00170 #endif //__bbtkwxSlider_h_INCLUDED__
00171
00172 #endif //_USE_WXWIDGETS_