FLImaging 7.8.14.1
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 = true);
101 virtual bool IsCaptionVisible()const;
102
103 virtual void ShowCloseButtonOnCaption(bool bShow = true);
104 virtual bool IsCloseButtonOnCaptionVisible()const;
105 virtual bool SetCloseButtonOnCaptionCallback(CWndCtrlProcedure* pFunc, bool bAutoDestroy = true);
106 virtual CWndCtrlProcedure* GetCloseButtonOnCaptionCallback() const;
107 virtual int32_t GetCloseButtonOnCaptionClickCount() const;
108 virtual void SetCloseButtonOnCaptionClickCount(int32_t i32ClickCount);
109 virtual void ClearCloseButtonOnCaptionClickCount();
110
111 virtual void ShowMinimizeButtonOnCaption(bool bShow = false);
112 virtual bool IsMinimizeButtonOnCaptionVisible()const;
113
114 virtual void SetMinimizeWidth(int32_t i32Width = 120);
115 virtual int32_t GetMinimizeWidth()const;
116
117 virtual void EnableScroll(bool bEnable, bool bIncludeButtons = true);
118 virtual bool IsScrollEnabled()const;
119
120 virtual void ShowOkButton(bool bShow);
121 virtual void ShowCancelButton(bool bShow);
122 virtual void ShowYesButton(bool bShow);
123 virtual void ShowNoButton(bool bShow);
124
125 virtual void EnableOkButton(bool bEnable);
126 virtual bool IsOkButtonEnabled()const;
127 virtual void EnableCancelButton(bool bEnable);
128 virtual bool IsCancelButtonEnabled()const;
129 virtual void EnableYesButton(bool bEnable);
130 virtual bool IsYesButtonEnabled()const;
131 virtual void EnableNoButton(bool bEnable);
132 virtual bool IsNoButtonEnabled()const;
133
134 virtual void SetMarginLeft(int32_t i32Margin);
135 virtual int32_t GetMarginLeft()const;
136 virtual void SetMarginTop(int32_t i32Margin);
137 virtual int32_t GetMarginTop()const;
138 virtual void SetMarginRight(int32_t i32Margin);
139 virtual int32_t GetMarginRight()const;
140 virtual void SetMarginBottom(int32_t i32Margin);
141 virtual int32_t GetMarginBottom()const;
142
143 virtual void SetIntervalSpacing(int32_t i32IntervalSpacing);
144 virtual int32_t GetIntervalSpacing() const;
145
146 virtual void SetTitleHeight(int32_t i32Height);
147 virtual int32_t GetTitleHeight()const;
148
149 virtual void SetOkButtonName(Base::CFLString<wchar_t> strOkBtnName);
150 virtual void SetCancelButtonName(Base::CFLString<wchar_t> strCancelBtnName);
151 virtual void SetYesButtonName(Base::CFLString<wchar_t> strYesBtnName);
152 virtual void SetNoButtonName(Base::CFLString<wchar_t> strNoBtnName);
153 virtual void SetOkButtonCallback(CWndCtrlProcedure* pFunc, bool bAutoDestroy = true);
154 virtual void SetCancelButtonCallback(CWndCtrlProcedure* pFunc, bool bAutoDestroy = true);
155 virtual void SetYesButtonCallback(CWndCtrlProcedure* pFunc, bool bAutoDestroy = true);
156 virtual void SetNoButtonCallback(CWndCtrlProcedure* pFunc, bool bAutoDestroy = true);
157
158 virtual bool AdjustLayout();
159 virtual bool SetTitle(const Base::CFLString<wchar_t>& strTitle);
160 virtual Base::CFLString<wchar_t> GetTitle() const;
161
162 virtual void UpdateTheme();
163 virtual void SetWindowSize(int32_t i32Width, int32_t i32Height);
164
165 // 대화 상자 데이터입니다.
166 #ifdef AFX_DESIGN_TIME
167 enum
168 {
169 IDD = IDD_DIALOG_CUSTOM
170 };
171 #endif
172 DECLARE_MESSAGE_MAP()
173 public:
174 virtual void PostNcDestroy();
175 virtual int32_t Add(CGUILayoutBase* pLayout);
176 virtual CGUILayoutBase* GetAt(int32_t i32Index);
177 virtual BOOL OnInitDialog() override;
178 virtual bool SetFocusWnd(CGUIGridLayout* pLayout, int32_t i32Row, int32_t i32Col);
179 virtual bool SetFocusWnd(CGUIBoxLayout* pLayout, int32_t i32Idx);
180 virtual void OnReceiveBroadcast(const Base::CBroadcastMessage* pMessage) override;
181
182 virtual INT_PTR DoModal()override;
183
184 protected:
185 virtual void InitDefaults(); // Initialize member variables
186 virtual void InternalSetWindowPosMinimized();
187
188 protected:
189 virtual BOOL PreTranslateMessage(MSG* pMsg);
190 virtual void OnOK();
191 virtual void OnCancel();
192 virtual void OnYes();
193 virtual void OnNo();
194 virtual void DrawBorder(CDC* pDC);
195 virtual void DrawCloseButton(CDC* pDC);
196 virtual void DrawMinButton(CDC* pDC);
197 virtual void DrawTitleRect(CDC* pDC);
198
199 virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
200 virtual bool CreateButton();
201 virtual bool AdjustLayoutButton(int32_t i32BtnW, int32_t i32BtnH, int32_t i32BtnMargin, int32_t i32BtnSpace, int32_t i32BtnTop);
202 virtual BOOL HitTestGrip(MSG* pMsg);
203
204 DeclareGetClassType();
205
206 public:
207 CPoint m_pointPrev;
208
209 int32_t m_i32MinWidth;
210 int32_t m_i32MinHeight;
211
212 int32_t m_i32WndW;
213 int32_t m_i32WndH;
214 int32_t m_i32WndowWidthUserDefined;
215 int32_t m_i32WndowHeightUserDefined;
216 int32_t m_i32ContentsW;
217 int32_t m_i32ContentsH;
218 int32_t m_i32MarginL;
219 int32_t m_i32MarginT;
220 int32_t m_i32MarginR;
221 int32_t m_i32MarginB;
222
223 int32_t m_i32RowCnt;
224 int32_t m_i32ColCnt;
225 int32_t m_i32WndCtrlCnt;
226 int32_t m_i32BtnCnt;
227
228 int32_t m_i32Space;
229 int32_t m_i32TitleHeight;
230 bool m_bShowWindowOnAdjustLayout;
231
232 protected:
233 CInternalDialog* m_pInternal;
234
235 CRect m_rc;
236 CRect m_rcTop;
237 CRect m_rcBottom;
238 CRect m_rcLeft;
239 CRect m_rcRight;
240
241 CDC m_memDC;
242 CBitmap* m_pBmpOld;
243 CBitmap* m_pBmp;
244 bool m_bLButtonDown;
245 bool m_bLockWindowUpdate;
246 bool m_bMinimized;
247
248 CRect m_rcCloseBtn;
249 CRect m_rcMinimizeBtn;
250 CRect m_rcCaption;
251 CRect m_rcTitleRect;
252
253 int32_t m_i32IntervalSpacing;
254 int32_t m_i32HoveringBtn;
255 int32_t m_i32HoveringBtnBf;
256 COLORREF m_clrBorder;
257 COLORREF m_clrBorderActive;
258 COLORREF m_clrClientFill;
259 std::vector<CGUILayoutBase*>& m_vctLayout;
260 std::vector<CGUIDialogLayoutElement*>& m_vctInputWnd;
261 std::vector<CGUIListCtrlMassive*>& m_vctListCtrlMassive;
262
263 CBrush m_brBrush;
264 Base::CFLString<wchar_t> m_strTitle;
265
266 Base::CFLString<wchar_t> m_strOkBtnName;
267 Base::CFLString<wchar_t> m_strCancelBtnName;
268 Base::CFLString<wchar_t> m_strYesBtnName;
269 Base::CFLString<wchar_t> m_strNoBtnName;
270
271 CGUIScrollWnd* m_pScrollWnd;
272 CGUIButton* m_pBtnOK;
273 CGUIButton* m_pBtnCancel;
274 CGUIButton* m_pBtnYes;
275 CGUIButton* m_pBtnNo;
276
277 CGUIDialogLayoutElement* m_pWndCtrlOK;
278 CGUIDialogLayoutElement* m_pWndCtrlCancel;
279 CGUIDialogLayoutElement* m_pWndCtrlYes;
280 CGUIDialogLayoutElement* m_pWndCtrlNo;
281 CGUIPaneDialog* m_pParentPaneDialog;
282
283 bool m_bModeless;
284 bool m_bEnableScroll;
285 bool m_bScrollWndIncludeButtons;
286 bool m_bCreated;
287 bool m_bCenterWindowDone;
288 bool m_bShowCaption;
289 bool m_bShowCaptionMinBtn;
290 bool m_bShowCaptionCloseBtn;
291 bool m_bShowOkBtn;
292 bool m_bShowCancelBtn;
293 bool m_bShowYesBtn;
294 bool m_bShowNoBtn;
295 bool m_bEnableOkBtn;
296 bool m_bEnableCancelBtn;
297 bool m_bEnableYesBtn;
298 bool m_bEnableNoBtn;
299 bool m_bInitBlock;
300 bool m_bIsResizable;
301 bool m_bAlreadyInsideProcedure;
302 bool m_bNcActive;
303
304 int32_t m_i32MinimizeWidth;
305 EOrientation m_eOrientation;
306
307 CGUILayoutBase* m_pFocusLayout;
308 CWnd* m_pFocusWnd;
309 int32_t m_i32FocusIdx;
310 int32_t m_i32FocusIdxRow;
311 int32_t m_i32FocusIdxCol;
312
313 CWndCtrlProcedure* m_pProcedureOfCloseButtonOnCaption;
314 bool m_bProcedureOfCloseButtonOnCaptionAutoDestroy;
315 int32_t m_i32CloseButtonOnCaptionClickCount;
316
317 public:
318 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
319 afx_msg void OnPaint();
320 afx_msg void OnNcPaint();
321 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
322 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
323 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
324 afx_msg void OnSetFocus(CWnd* pOldWnd);
325 afx_msg void OnKillFocus(CWnd* pNewWnd);
326 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
327 afx_msg void OnDestroy();
328 afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
329 afx_msg void OnSize(UINT nType, int cx, int cy);
330 afx_msg BOOL OnNcActivate(BOOL bActive);
331 afx_msg void OnMouseLeave();
332 afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
333 afx_msg void OnNcMouseLeave();
334 virtual void PreSubclassWindow();
335 afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
336};
337 }
338}
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:9247
ELayout
다이얼로그의 레이아웃
Definition GUIDialog.h:45
@ BoxLayout
박스 레이아웃
Definition GUIDialog.h:61
@ GridLayout
격자 레이아웃
Definition GUIDialog.h:52