30 #ifndef _CEGUIThumb_h_
31 #define _CEGUIThumb_h_
33 #include "./PushButton.h"
38 # pragma warning(push)
39 # pragma warning(disable : 4251)
40 # pragma warning(disable : 4996)
55 class CEGUIEXPORT Thumb :
public PushButton
58 static const String EventNamespace;
59 static const String WidgetTypeName;
70 static const String EventThumbPositionChanged;
76 static const String EventThumbTrackStarted;
81 static const String EventThumbTrackEnded;
94 bool isHotTracked(
void)
const {
return d_hotTrack;}
104 bool isVertFree(
void)
const {
return d_vertFree;}
114 bool isHorzFree(
void)
const {
return d_horzFree;}
125 std::pair<float, float> getVertRange(
void)
const;
136 std::pair<float, float> getHorzRange(
void)
const;
152 void setHotTracked(
bool setting) {d_hotTrack = setting;}
165 void setVertFree(
bool setting) {d_vertFree = setting;}
178 void setHorzFree(
bool setting) {d_horzFree = setting;}
197 void setVertRange(
float min,
float max);
212 void setVertRange(
const std::pair<float, float> &range);
231 void setHorzRange(
float min,
float max);
245 void setHorzRange(
const std::pair<float, float> &range);
255 Thumb(
const String& type,
const String& name);
262 virtual ~Thumb(
void);
267 void banPropertiesForAutoWindow();
276 virtual void onThumbPositionChanged(WindowEventArgs& e);
283 virtual void onThumbTrackStarted(WindowEventArgs& e);
290 virtual void onThumbTrackEnded(WindowEventArgs& e);
297 virtual void onMouseMove(MouseEventArgs& e);
298 virtual void onMouseButtonDown(MouseEventArgs& e);
299 virtual void onCaptureLost(WindowEventArgs& e);
311 float d_vertMin, d_vertMax;
312 float d_horzMin, d_horzMax;
316 Vector2f d_dragPoint;
323 void addThumbProperties(
void);
330 class PropertyHelper<std::pair<float,float> >
333 typedef std::pair<float,float> return_type;
334 typedef return_type safe_method_return_type;
335 typedef const std::pair<float,float>& pass_type;
336 typedef String string_return_type;
338 static const String& getDataTypeName()
340 static String type(
"std::pair<float,float>");
345 static return_type fromString(
const String& str)
347 float rangeMin = 0, rangeMax = 0;
348 sscanf(str.c_str(),
" min:%f max:%f", &rangeMin, &rangeMax);
349 return std::pair<float,float>(rangeMin,rangeMax);
352 static string_return_type toString(pass_type val)
355 sprintf(buff,
"min:%f max:%f", val.first, val.second);
362 #if defined(_MSC_VER)
363 # pragma warning(pop)
366 #endif // end of guard _CEGUIThumb_h_