FLImaging 7.3.19.2
GUIDialog.h
1#pragma once
2
3#include <vector>
4#include "GUIWndCtrlBase.h"
5#include "GUIEditCtrl.h"
6#include "GUILayoutBase.h"
7#include "GUIBoxLayout.h"
8#include "GUIGridLayout.h"
9
10#include "GUIButton.h"
11#include "GUIComboBox.h"
12#include "GUICheckBox.h"
13#include "GUIStaticText.h"
14#include "GUIListCtrl.h"
15#include "GUIListCtrlMassive.h"
16#include "GUISlider.h"
17#include "GUIDialogBase.h"
18
19
21namespace FLImaging
22{
24 namespace GUI
25 {
26 class CGUIButton;
27 class CGUIComboBox;
28 class CGUIEditCtrl;
29 class CGUIStaticText;
30 class CGUIPaneDialog;
31 class CGUIBoxLayout;
32 class CGUIGridLayout;
34 class CGUIScrollWnd;
35 class CInternalDialog;
36
45 {
53
62 };
63
71 class FL_EXPORT CGUIDialog : public CGUIDialogBase
72 {
73 DECLARE_DYNAMIC(CGUIDialog)
74 friend class CGUILayoutBase;
75 friend class CGUIBoxLayout;
76 friend class CGUIGridLayout;
77 friend class CGUIPaneDialog;
78 friend class CGUIManagerViewImageObjectImageFigure;
79
80 public:
87 CGUIDialog(CWnd* pParent = nullptr); // 표준 생성자입니다.
88 CGUIDialog(UINT nIDTemplate, CWnd* pParent = NULL);
89 CGUIDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL);
90 CGUIDialog(const CGUIDialog& rhs);
91 virtual ~CGUIDialog();
92
93 virtual BOOL Create(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL)override;
94 virtual BOOL Create(UINT nIDTemplate, CWnd* pParentWnd = NULL)override;
95 virtual BOOL CreateIndirect(LPCDLGTEMPLATE lpDialogTemplate, CWnd* pParentWnd = NULL, void* lpDialogInit = NULL)override;
96 virtual BOOL CreateIndirect(HGLOBAL hDialogTemplate, CWnd* pParentWnd = NULL)override;
97
98 static CGUIDialog* CreateModelessDialog();
99
100 virtual void ShowCaption(bool bShow);
101 virtual bool IsCaptionVisible()const;
102
103 virtual void EnableScroll(bool bEnable, bool bIncludeButtons = true);
104 virtual bool IsScrollEnabled()const;
105
106 virtual void ShowOkButton(bool bShow);
107 virtual void ShowCancelButton(bool bShow);
108 virtual void ShowYesButton(bool bShow);
109 virtual void ShowNoButton(bool bShow);
110
111 virtual void EnableOkButton(bool bEnable);
112 virtual bool IsOkButtonEnabled()const;
113 virtual void EnableCancelButton(bool bEnable);
114 virtual bool IsCancelButtonEnabled()const;
115 virtual void EnableYesButton(bool bEnable);
116 virtual bool IsYesButtonEnabled()const;
117 virtual void EnableNoButton(bool bEnable);
118 virtual bool IsNoButtonEnabled()const;
119
120 virtual void SetMarginLeft(int32_t i32Margin);
121 virtual int32_t GetMarginLeft()const;
122 virtual void SetMarginTop(int32_t i32Margin);
123 virtual int32_t GetMarginTop()const;
124 virtual void SetMarginRight(int32_t i32Margin);
125 virtual int32_t GetMarginRight()const;
126 virtual void SetMarginBottom(int32_t i32Margin);
127 virtual int32_t GetMarginBottom()const;
128
129 virtual void SetIntervalSpacing(int32_t i32IntervalSpacing);
130 virtual int32_t GetIntervalSpacing() const;
131
132 virtual void SetTitleHeight(int32_t i32Height);
133 virtual int32_t GetTitleHeight()const;
134
135 virtual void SetOkButtonName(Base::CFLString<wchar_t> strOkBtnName);
136 virtual void SetCancelButtonName(Base::CFLString<wchar_t> strCancelBtnName);
137 virtual void SetYesButtonName(Base::CFLString<wchar_t> strYesBtnName);
138 virtual void SetNoButtonName(Base::CFLString<wchar_t> strNoBtnName);
139 virtual void SetOkButtonCallback(CWndCtrlProcedure* pFunc, bool bAutoDestroy = true);
140 virtual void SetCancelButtonCallback(CWndCtrlProcedure* pFunc, bool bAutoDestroy = true);
141 virtual void SetYesButtonCallback(CWndCtrlProcedure* pFunc, bool bAutoDestroy = true);
142 virtual void SetNoButtonCallback(CWndCtrlProcedure* pFunc, bool bAutoDestroy = true);
143
144 virtual bool AdjustLayout();
145 virtual bool SetTitle(const Base::CFLString<wchar_t>& strTitle);
146 virtual Base::CFLString<wchar_t> GetTitle() const;
147
148 virtual void UpdateTheme();
149 virtual void SetWindowSize(int32_t i32Width, int32_t i32Height);
150
151 // 대화 상자 데이터입니다.
152 #ifdef AFX_DESIGN_TIME
153 enum
154 {
155 IDD = IDD_DIALOG_CUSTOM
156 };
157 #endif
158 DECLARE_MESSAGE_MAP()
159 public:
160 virtual void PostNcDestroy();
161 virtual int32_t Add(CGUILayoutBase* pLayout);
162 virtual CGUILayoutBase* GetAt(int32_t i32Index);
163 virtual BOOL OnInitDialog() override;
164 virtual bool SetFocusWnd(CGUIGridLayout* pLayout, int32_t i32Row, int32_t i32Col);
165 virtual bool SetFocusWnd(CGUIBoxLayout* pLayout, int32_t i32Idx);
166 virtual void OnReceiveBroadcast(const Base::CBroadcastMessage* pMessage) override;
167
168 virtual INT_PTR DoModal()override;
169
170 protected:
171 virtual void InitDefaults(); // Initialize member variables
172
173 protected:
174 virtual BOOL PreTranslateMessage(MSG* pMsg);
175 virtual void OnOK();
176 virtual void OnCancel();
177 virtual void OnYes();
178 virtual void OnNo();
179 virtual void DrawBorder(CDC* pDC);
180 virtual void DrawCloseButton(CDC* pDC);
181 virtual void DrawTitleRect(CDC* pDC);
182
183 virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
184 virtual bool CreateButton();
185 virtual bool AdjustLayoutButton(int32_t i32BtnW, int32_t i32BtnH, int32_t i32BtnMargin, int32_t i32BtnSpace, int32_t i32BtnTop);
186 virtual BOOL HitTestGrip(MSG* pMsg);
187
188 DeclareGetClassType();
189
190 public:
191 CPoint m_pointPrev;
192
193 int32_t m_i32MinWidth;
194 int32_t m_i32MinHeight;
195
196 int32_t m_i32WndW;
197 int32_t m_i32WndH;
198 int32_t m_i32WndowWidthUserDefined;
199 int32_t m_i32WndowHeightUserDefined;
200 int32_t m_i32ContentsW;
201 int32_t m_i32ContentsH;
202 int32_t m_i32MarginL;
203 int32_t m_i32MarginT;
204 int32_t m_i32MarginR;
205 int32_t m_i32MarginB;
206
207 int32_t m_i32RowCnt;
208 int32_t m_i32ColCnt;
209 int32_t m_i32WndCtrlCnt;
210 int32_t m_i32BtnCnt;
211
212 int32_t m_i32Space;
213 int32_t m_i32TitleHeight;
214 bool m_bShowWindowOnAdjustLayout;
215
216 protected:
217 CInternalDialog* m_pInternal;
218
219 CRect m_rc;
220 CRect m_rcTop;
221 CRect m_rcBottom;
222 CRect m_rcLeft;
223 CRect m_rcRight;
224
225 CDC m_memDC;
226 CBitmap* m_pBmpOld;
227 CBitmap* m_pBmp;
228 bool m_bLButtonDown;
229 bool m_bLockWindowUpdate;
230
231 CRect m_rcCloseBtn;
232 CRect m_rcCaption;
233 CRect m_rcTitleRect;
234
235 int32_t m_i32IntervalSpacing;
236 int32_t m_i32HoveringBtn;
237 int32_t m_i32HoveringBtnBf;
238 COLORREF m_clrBorder;
239 COLORREF m_clrBorderActive;
240 COLORREF m_clrClientFill;
241 std::vector<CGUILayoutBase*>& m_vctLayout;
242 std::vector<CGUIDialogLayoutElement*>& m_vctInputWnd;
243 std::vector<CGUIListCtrlMassive*>& m_vctListCtrlMassive;
244
245 CBrush m_brBrush;
246 Base::CFLString<wchar_t> m_strTitle;
247
248 Base::CFLString<wchar_t> m_strOkBtnName;
249 Base::CFLString<wchar_t> m_strCancelBtnName;
250 Base::CFLString<wchar_t> m_strYesBtnName;
251 Base::CFLString<wchar_t> m_strNoBtnName;
252
253 CGUIScrollWnd* m_pScrollWnd;
254 CGUIButton* m_pBtnOK;
255 CGUIButton* m_pBtnCancel;
256 CGUIButton* m_pBtnYes;
257 CGUIButton* m_pBtnNo;
258
259 CGUIDialogLayoutElement* m_pWndCtrlOK;
260 CGUIDialogLayoutElement* m_pWndCtrlCancel;
261 CGUIDialogLayoutElement* m_pWndCtrlYes;
262 CGUIDialogLayoutElement* m_pWndCtrlNo;
263 CGUIPaneDialog* m_pParentPaneDialog;
264
265 bool m_bModeless;
266 bool m_bEnableScroll;
267 bool m_bScrollWndIncludeButtons;
268 bool m_bCreated;
269 bool m_bCenterWindowDone;
270 bool m_bShowCaption;
271 bool m_bShowOkBtn;
272 bool m_bShowCancelBtn;
273 bool m_bShowYesBtn;
274 bool m_bShowNoBtn;
275 bool m_bEnableOkBtn;
276 bool m_bEnableCancelBtn;
277 bool m_bEnableYesBtn;
278 bool m_bEnableNoBtn;
279 bool m_bInitBlock;
280 bool m_bIsResizable;
281 bool m_bAlreadyInsideProcedure;
282 bool m_bNcActive;
283
284 EOrientation m_eOrientation;
285
286 CGUILayoutBase* m_pFocusLayout;
287 CWnd* m_pFocusWnd;
288 int32_t m_i32FocusIdx;
289 int32_t m_i32FocusIdxRow;
290 int32_t m_i32FocusIdxCol;
291
292 public:
293 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
294 afx_msg void OnPaint();
295 afx_msg void OnNcPaint();
296 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
297 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
298 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
299 afx_msg void OnSetFocus(CWnd* pOldWnd);
300 afx_msg void OnKillFocus(CWnd* pNewWnd);
301 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
302 afx_msg void OnDestroy();
303 afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
304 afx_msg void OnSize(UINT nType, int cx, int cy);
305 afx_msg BOOL OnNcActivate(BOOL bActive);
306 afx_msg void OnMouseLeave();
307 afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
308 afx_msg void OnNcMouseLeave();
309 virtual void PreSubclassWindow();
310};
311 }
312}
Template type 의 문자열 클래스
Definition FLString.h:34
버튼 클래스
Definition GUIButton.h:32
콤보박스 클래스
Definition GUIComboBox.h:29
virtual void OnReceiveBroadcast(const Base::CBroadcastMessage *pMessage) override
Callback 함수. BroadcastMessage를 수신받는 함수
CGUIDialog(CWnd *pParent=nullptr)
기본 생성자
문자열 편집 창 클래스
Definition GUIEditCtrl.h:30
저장할 데이터가 매우 많은 경우의 리스트 컨트롤 클래스
Definition GUIListCtrlMassive.h:39
Definition AESCryptography.h:18
Definition D2DObject.h:12
EOrientation
방향
Definition DefinitionsGUI.h:6038
ELayout
다이얼로그의 레이아웃
Definition GUIDialog.h:45
@ BoxLayout
박스 레이아웃
Definition GUIDialog.h:61
@ GridLayout
격자 레이아웃
Definition GUIDialog.h:52