FLImaging 6.5.8.1
GUIPropertyButton.h
1#pragma once
2
3#include <functional>
4#include "GUIButton.h"
5#include "GUIDefinitions.h"
6
7namespace FLImaging
8{
9 namespace GUI
10 {
11 class CGUIPropertyButton;
12 class CGUIMenuItemProperty;
13 class CInternalPermissionManager;
14
15 typedef std::function<void(CGUIPropertyButton*)> CPropertyButtonClickProcedure;
16 #define MakePropertyButtonClickProcedure [=](CGUIPropertyButton* pPropertyButton) -> void
17
18 class FL_EXPORT CGUIPropertyButton : public Base::CFLBase
19 {
20 public:
21 CGUIPropertyButton();
22 virtual ~CGUIPropertyButton();
23
24 /* Setting*/
25 virtual bool SetName(const Base::CFLString<wchar_t>& strName);
26 virtual Base::CFLString<wchar_t> GetName() const;
27
28 virtual void Enable(bool bEnable);
29 virtual bool IsEnabled() const;
30
31 virtual void SetVisible(bool bShow, bool bAdjustLayout = FALSE);
32 virtual bool IsVisible()const;
33
34 virtual void SetGUIMenuItemProperty(CGUIMenuItemProperty* pMIP);
35
36 virtual CGUIMenuItemProperty* GetGUIMenuItemProperty();
37
38
39 /* Button Width*/
40 virtual int32_t GetCurrentButtonWidth() const;
41
42 virtual void SetButtonWidth(size_t stWidth = 100);
43 virtual int32_t GetButtonWidth() const;
44
45 // f64WidthRatio == 0. 일 경우 버튼 내의 글자보다 창 크기가 작아서 잘릴 경우 아랫줄로 내림
46 // f64WidthRation != 0. 일 경우 버튼 내 문자열이 잘려도 아랫줄로 내리지 않고 설정한 비율 유지
47 virtual void SetButtonWidthRatio(double f64WidthRatio = 0.5);
48 virtual double GetButtonWidthRatio() const;
49
50 virtual void CalcButtonWidth(int32_t i32ClientRectWidth, LONG btnNameTextExtent);
51
52 virtual CGUIButton* GetButton();
53
54
55 /* Event Handler*/
56 virtual bool SetPropertyButtonClickProcedure(CPropertyButtonClickProcedure* pFunc, bool bAutoDestroy = true);
57 virtual CPropertyButtonClickProcedure* GetPropertyButtonClickProcedure();
58
59 virtual void SetMinimalAuthorityLevel(Base::EAuthorityLevel eAuthorityLevel, GUI::EPermission ePermission);
60 virtual Base::EAuthorityLevel GetMinimalAuthorityLevel(GUI::EPermission ePermission) const;
61
62
63 DeclareGetClassType();
64
65
66 protected:
67 virtual void OnClick();
68
69
70 protected:
71 /* Setting*/
72 CGUIButton m_btnButton;
73 Base::CFLString<wchar_t> m_strName;
74 Base::CFLString<wchar_t> m_strShortcut;
75 bool m_bEnable;
76 CGUIMenuItemProperty* m_pGUIMenuItemProperty;
77
78 CInternalPermissionManager* m_pInternalPM;
79
80 /* Event Handler*/
81 CPropertyButtonClickProcedure* m_pPropertyButtonClickProcedure;
82 bool m_bPropertyButtonClickProcedureAutoDestroy;
83 bool m_bButtonClickProcedureRunning;
84 bool m_bShow;
85
86 /* Button Width*/
87 size_t m_stCurrentButtonWidth;
88 size_t m_stButtonWidth;
89 double m_f64ButtonWidthRatio;
90 bool m_bSetWidthByRatio;
91
92 friend class CGUIPaneProperties;
93 friend class CGUIMenuItemProperty;
94 friend class CGUIPanePropertiesShell;
95 friend class CGUIManagerPane;
96 friend class CGUITabbedPane;
97 };
98 }
99
100}
101
@ SetName
도형 이름 설정 메뉴