FLImaging 6.12.24.4
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
174 void SetExponentialBase(T tExponentialBase = 10, bool bRedraw = false);
175
185 T GetExponentialBase() const;
186
200 void SetMinValue(T tValue, bool bRedraw, bool bSendMessage = true);
201 void SetMaxValue(T tValue, bool bRedraw, bool bSendMessage = true);
202
214 void IncreaseMinValue(T tValue, bool bRedraw);
215 void IncreaseMaxValue(T tValue, bool bRedraw);
216
228 void DecreaseMinValue(T tValue, bool bRedraw);
229 void DecreaseMaxValue(T tValue, bool bRedraw);
230
242 void IncreaseMinPos(int32_t i32PosDelta, bool bRedraw);
243 void IncreaseMaxPos(int32_t i32PosDelta, bool bRedraw);
244
256 void DecreaseMinPos(int32_t i32PosDelta, bool bRedraw);
257 void DecreaseMaxPos(int32_t i32PosDelta, bool bRedraw);
258
270 void IncreaseMinTick(int32_t i32Tick, bool bRedraw);
271 void IncreaseMaxTick(int32_t i32Tick, bool bRedraw);
272
284 void DecreaseMinTick(int32_t i32Tick, bool bRedraw);
285 void DecreaseMaxTick(int32_t i32Tick, bool bRedraw);
286
296 T GetMinValue() const;
297 T GetMaxValue() const;
298
310 int32_t GetPosByValue(T tValue)const;
311
323 T GetValueByPos(int32_t i32Pos)const;
324
332 virtual void UpdateSliderMin();
333 virtual void UpdateSliderMax();
334
346 T GetRemainder(T tValue) const;
347
359 virtual const CResult SetHandleSlideTogether(bool bSet = true);
360
371 virtual bool IsHandleSlidingTogether() const;
372
384 virtual void OnMouseWheel(const CPoint& ptPoint, bool bUpWheel);
385
395 virtual void OnLButtonDown(const CPoint& ptPoint) override;
396 virtual void OnLButtonUp(const CPoint& ptPoint) override;
397 virtual void OnMouseMove(const CPoint& ptPoint) override;
398
399 virtual ESliderArea HitTest(const CPoint& ptPoint) const override;
400
401 protected:
402 virtual void SetMinPos(int32_t i32Pos, bool bSetValue, bool bSendMsg, bool bRedraw);
403 virtual void SetMaxPos(int32_t i32Pos, bool bSetValue, bool bSendMsg, bool bRedraw);
404 virtual void RecalculateLayoutMetrics() override;
405
406 protected:
407 bool m_bHandleSlidingTogether;
408
409 int32_t m_i32PosMin; // current min position. range [0, m_i32PosMax] (in case of horz bar)
410 int32_t m_i32PosMax; // current max position. range [m_i32PosMin, m_rtBar.Width()] (in case of horz bar)
411
412 int32_t m_i32PosMinOnLBtnDown;
413 int32_t m_i32PosMaxOnLBtnDown;
414
415 T m_tRangeMin; // min range
416 T m_tRangeMax; // max range
417 mutable T m_tValueMin; // min value
418 mutable T m_tValueMax; // max value
419 T m_tUnit;
420 T m_tExponentialBase;
421 };
422 }
423}
Definition D2DObject.h:12
ESliderArea
Scroll Bar Area.
Definition DefinitionsGUI.h:10273
@ SetRange
Set range.
Definition DefinitionsGUIViewGraph.h:1244