FLImaging 6.5.8.1
GUISliderOwnerDrawnDualHandle.h
1#pragma once
2#include "GUISliderOwnerDrawn.h"
3
4namespace FLImaging
5{
6 namespace GUI
7 {
8 template <typename T>
9 class FL_EXPORT CGUISliderOwnerDrawnDualHandle : public CGUISliderOwnerDrawnBase
10 {
11 public:
25 CGUISliderOwnerDrawnDualHandle(CWnd* pParentWnd, EOrientation eOrientation = EOrientation_Horizontal);
26
34 virtual ~CGUISliderOwnerDrawnDualHandle();
35
47 virtual const CResult CalcSliderRegion(CRect* pRect) override;
48
58 virtual void Draw(CDC* pDC) const override;
59
71 void SetRangeMin(T tMin, bool bRedraw = false);
72
84 void SetRangeMax(T tMax, bool bRedraw = false);
85
99 void SetRange(T tMin, T tMax, bool bRedraw = false);
100
110 T GetRangeMax() const;
111
121 T GetRangeMin() const;
122
134 void GetRange(T& tMin, T& tMax) const;
135
147 void SetUnit(T tUnit, bool bRedraw = false);
148
157 T GetUnit() const;
158
172 void SetMinValue(T tValue, bool bRedraw, bool bSendMessage = true);
173 void SetMaxValue(T tValue, bool bRedraw, bool bSendMessage = true);
174
186 void IncreaseMinValue(T tValue, bool bRedraw);
187 void IncreaseMaxValue(T tValue, bool bRedraw);
188
200 void DecreaseMinValue(T tValue, bool bRedraw);
201 void DecreaseMaxValue(T tValue, bool bRedraw);
202
214 void IncreaseMinPos(int32_t i32PosDelta, bool bRedraw);
215 void IncreaseMaxPos(int32_t i32PosDelta, bool bRedraw);
216
228 void DecreaseMinPos(int32_t i32PosDelta, bool bRedraw);
229 void DecreaseMaxPos(int32_t i32PosDelta, bool bRedraw);
230
242 void IncreaseMinTick(int32_t i32Tick, bool bRedraw);
243 void IncreaseMaxTick(int32_t i32Tick, bool bRedraw);
244
256 void DecreaseMinTick(int32_t i32Tick, bool bRedraw);
257 void DecreaseMaxTick(int32_t i32Tick, bool bRedraw);
258
268 T GetMinValue() const;
269 T GetMaxValue() const;
270
282 int32_t GetPosByValue(T tValue)const;
283
295 T GetValueByPos(int32_t i32Pos)const;
296
304 virtual void UpdateSliderMin();
305 virtual void UpdateSliderMax();
306
318 T GetRemainder(T tValue) const;
319
331 virtual const CResult SetHandleSlideTogether(bool bSet = true);
332
343 virtual bool IsHandleSlidingTogether() const;
344
356 virtual void OnMouseWheel(const CPoint& ptPoint, bool bUpWheel);
357
367 virtual void OnLButtonDown(const CPoint& ptPoint) override;
368 virtual void OnLButtonUp(const CPoint& ptPoint) override;
369 virtual void OnMouseMove(const CPoint& ptPoint) override;
370
371 virtual ESliderArea HitTest(const CPoint& ptPoint) const override;
372
373 protected:
374 virtual void SetMinPos(int32_t i32Pos, bool bSetValue, bool bSendMsg, bool bRedraw);
375 virtual void SetMaxPos(int32_t i32Pos, bool bSetValue, bool bSendMsg, bool bRedraw);
376
377 protected:
378 bool m_bHandleSlidingTogether;
379
380 int32_t m_i32PosMin; // current min position. range [0, m_i32PosMax] (in case of horz bar)
381 int32_t m_i32PosMax; // current max position. range [m_i32PosMin, m_rtBar.Width()] (in case of horz bar)
382
383 int32_t m_i32PosMinOnLBtnDown;
384 int32_t m_i32PosMaxOnLBtnDown;
385
386 T m_tRangeMin; // min range
387 T m_tRangeMax; // max range
388 mutable T m_tValueMin; // min value
389 mutable T m_tValueMax; // max value
390 T m_tUnit;
391 };
392 }
393}
ESliderArea
Scroll Bar Area.
Definition GUIDefinitions.h:9851