FLImaging 6.12.9.2
GUISliderOwnerDrawnBase.h
1#pragma once
2#include "DefinitionsGUI.h"
3
4namespace FLImaging
5{
6 namespace GUI
7 {
8 class FL_EXPORT CGUISliderOwnerDrawnBase
9 {
10 public:
11 CGUISliderOwnerDrawnBase(CWnd* pParentWnd, EOrientation eOrientation = EOrientation_Vertical);
12 virtual ~CGUISliderOwnerDrawnBase();
13
14 virtual void SetOrientation(EOrientation eOrientation);
15 virtual EOrientation GetOrientation() const;
16
17 virtual void SetColorThumb(COLORREF clrThumb, COLORREF clrThumbHilight);
18 virtual void GetColorThumb(COLORREF& clrThumb, COLORREF& clrThumbHilight) const;
19
20 virtual void SetColorBar(COLORREF clrBar, COLORREF clrBarHilight);
21 virtual void GetColorBar(COLORREF& clrBar, COLORREF& clrBarHilight) const;
22
23 virtual ESliderArea HitTest(const CPoint& ptPoint) const;
24 virtual void SetHitArea(ESliderArea eHitArea, bool bRedraw = true);
25 virtual ESliderArea GetHitArea()const;
26 virtual void SetSelectedArea(ESliderArea eSelArea, bool bRedraw = true);
27 virtual ESliderArea GetSelectedArea()const;
28
29 virtual const CRect GetBarRect() const;
30 virtual const CRect GetThumbRect() const;
31 virtual const CRect GetThumbMinRect() const;
32 virtual const CRect GetThumbMaxRect() const;
33
34 virtual bool IsLButtonDown() const;
35
36 virtual bool IsVisible() const;
37 virtual void Show(bool bShow);
38
39 virtual void Enable(bool bEnable);
40 virtual bool IsEnabled() const;
41
51 virtual void OnLButtonDown(const CPoint& ptPoint);
52
62 virtual void OnLButtonUp(const CPoint& ptPoint);
63
73 virtual void OnMouseMove(const CPoint& ptPoint);
74
75 virtual void SetOwner(void* pOwner);
76 virtual void* GetOwner() const;
77
78 virtual void UpdateSlider();
79 virtual const CResult CalcSliderRegion(CRect* pRect);
80
81 virtual void Draw(CDC* pDC) const;
82
83 virtual int32_t GetPos() const;
84 virtual int32_t GetPosOnLButtonDown() const;
85 virtual CPoint GetPointOnLButtonDown() const;
86 virtual void SetPos(int32_t i32Pos, bool bSetValue, bool bSendMsg, bool bRedraw);
87
106 virtual const CResult SetCallbackTriggerMode(ECallbackTriggerMode eMode = ECallbackTriggerMode_OnDrag);
107
122 virtual ECallbackTriggerMode GetCallbackTriggerMode() const;
123
139 virtual void SetScaleMode(ESliderScaleMode eMode = ESliderScaleMode_Linear);
140
152 virtual ESliderScaleMode GetScaleMode() const;
153
154 protected:
155 virtual void RecalculateLayoutMetrics();
156
157 protected:
158 CWnd* m_pParentWnd;
159 void* m_pOwner;
160
161 ESliderArea m_eHitArea;
162 ESliderArea m_eSelectedArea;
163 EOrientation m_eOrientation;
164 ECallbackTriggerMode m_eCallbackTriggerMode;
165 ESliderScaleMode m_eSliderScaleMode;
166
167 CPoint m_ptPointPrev;
168 CPoint m_ptLButtonDown;
169
170 CRect m_rtThumb;
171 CRect m_rtThumbMin;
172 CRect m_rtThumbMax;
173
174 CRect m_rtBar;
175 int32_t m_i32ThumbSize;
176
177 int32_t m_i32Pos; // current position. range [0, m_rtBar.Width()] (in case of horz bar)
178 int32_t m_i32PosOnLBtnDown;
179 int32_t m_i32ScrollRange;
180 int32_t m_i32PosOfZero;
181 double m_f64ExponentialPowerMin;
182 double m_f64ExponentialPowerMax;
183
184 bool m_bShow;
185 bool m_bEnable;
186 bool m_bLButtonDown;
187
188 double m_f64SectionWidth; // the width of a section. It is m_rtBar.Width() / section count (in case of horz bar)
189 double m_f64PixelsPerValue; // How many pixels correspond to value (1)
190 double m_f64ValuePerPixel; // How much value corresponds to one pixel
191
192 COLORREF m_clrThumb;
193 COLORREF m_clrThumbHilight;
194 COLORREF m_clrBar;
195 COLORREF m_clrBarHilight;
196 };
197
198 struct FL_EXPORT NM_SLIDER
199 {
200 NM_SLIDER() :pCaller(nullptr), pOwner(nullptr), i32Pos(-1), bMinPosChanged(false), bMaxPosChanged(false){}
201 CGUISliderOwnerDrawnBase* pCaller;
202 void* pOwner;
203 int32_t i32Pos;
204 bool bMinPosChanged;
205 bool bMaxPosChanged;
206 };
207 }
208}
Definition D2DObject.h:12
ECallbackTriggerMode
Definition DefinitionsGUI.h:11160
EOrientation
방향
Definition DefinitionsGUI.h:5849
ESliderScaleMode
슬라이더의 스케일 동작 방식을 정의합니다. 사용자의 입력에 따라 슬라이더 값이 선형적으로 증가할지, 또는 지수적으로 증가할지를 결정합니다.
Definition DefinitionsGUI.h:11760
ESliderArea
슬라이더 영역
Definition DefinitionsGUI.h:10273
@ Show
도형 보이기 메뉴
Definition DefinitionsGUIView3D.h:2962