FLImaging 6.5.8.1
GUISliderOwnerDrawn.h
1#pragma once
2#include "GUISliderOwnerDrawnBase.h"
3
4namespace FLImaging
5{
6 namespace GUI
7 {
8 template <typename T>
9 class FL_EXPORT CGUISliderOwnerDrawn : public CGUISliderOwnerDrawnBase
10 {
11 public:
25 CGUISliderOwnerDrawn(CWnd* pParentWnd, EOrientation eOrientation = EOrientation_Horizontal);
26
34 virtual ~CGUISliderOwnerDrawn();
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 SetValue(T tValue, bool bRedraw, bool bSendMessage = true);
173
185 void IncreaseValue(T tValue, bool bRedraw);
186
198 void DecreaseValue(T tValue, bool bRedraw);
199
211 void IncreaseTick(int32_t i32Tick, bool bRedraw);
212
224 void DecreaseTick(int32_t i32Tick, bool bRedraw);
225
237 void IncreasePos(int32_t i32PosDelta, bool bRedraw);
238
250 void DecreasePos(int32_t i32PosDelta, bool bRedraw);
251
261 T GetValue() const;
262
274 int32_t GetPosByValue(T tValue)const;
275
287 T GetValueByPos(int32_t i32Pos)const;
288
296 virtual void UpdateSlider() override;
297
309 T GetRemainder(T tValue) const;
310
322 virtual void OnMouseWheel(const CPoint& ptPoint, bool bUpWheel);
323 virtual void OnLButtonUp(const CPoint& ptPoint) override;
324 virtual void OnMouseMove(const CPoint& ptPoint) override;
325
326 protected:
327 virtual void SetPos(int32_t i32Pos, bool bSetValue, bool bSendMsg, bool bRedraw) override;
328
329 protected:
330 T m_tRangeMin; // Ranage min
331 T m_tRangeMax; // Ranage max
332 mutable T m_tValue; // current value
333 T m_tUnit;
334 };
335 }
336}