FLImaging 7.10.18.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:
81
90 {
98
106
114
122 };
123
124 public:
131 CGUIDialog(CWnd* pParent = nullptr); // 표준 생성자입니다.
132 CGUIDialog(UINT nIDTemplate, CWnd* pParent = NULL);
133 CGUIDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL);
134 CGUIDialog(const CGUIDialog& rhs);
135 virtual ~CGUIDialog();
136
137 virtual BOOL Create(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL)override;
138 virtual BOOL Create(UINT nIDTemplate, CWnd* pParentWnd = NULL)override;
139 virtual BOOL CreateIndirect(LPCDLGTEMPLATE lpDialogTemplate, CWnd* pParentWnd = NULL, void* lpDialogInit = NULL)override;
140 virtual BOOL CreateIndirect(HGLOBAL hDialogTemplate, CWnd* pParentWnd = NULL)override;
141
142 static CGUIDialog* CreateModelessDialog();
143
144 virtual void ShowCaption(bool bShow = true);
145 virtual bool IsCaptionVisible()const;
146
147 virtual void ShowCloseButtonOnCaption(bool bShow = true);
148 virtual bool IsCloseButtonOnCaptionVisible()const;
149 virtual bool SetCloseButtonOnCaptionCallback(CWndCtrlProcedure* pFunc, bool bAutoDestroy = true);
150 virtual CWndCtrlProcedure* GetCloseButtonOnCaptionCallback() const;
151 virtual int32_t GetCloseButtonOnCaptionClickCount() const;
152 virtual void SetCloseButtonOnCaptionClickCount(int32_t i32ClickCount);
153 virtual void ClearCloseButtonOnCaptionClickCount();
154
155 virtual void ShowMinimizeButtonOnCaption(bool bShow = false);
156 virtual bool IsMinimizeButtonOnCaptionVisible()const;
157
158 virtual void SetMinimizeWidth(int32_t i32Width = 120);
159 virtual int32_t GetMinimizeWidth()const;
160
161 virtual void EnableScroll(bool bEnable, bool bIncludeButtons = true);
162 virtual bool IsScrollEnabled()const;
163
164 virtual void ShowOkButton(bool bShow);
165 virtual void ShowCancelButton(bool bShow);
166 virtual void ShowYesButton(bool bShow);
167 virtual void ShowNoButton(bool bShow);
168
169 virtual void EnableOkButton(bool bEnable);
170 virtual bool IsOkButtonEnabled()const;
171 virtual void EnableCancelButton(bool bEnable);
172 virtual bool IsCancelButtonEnabled()const;
173 virtual void EnableYesButton(bool bEnable);
174 virtual bool IsYesButtonEnabled()const;
175 virtual void EnableNoButton(bool bEnable);
176 virtual bool IsNoButtonEnabled()const;
177
178 virtual void SetMarginLeft(int32_t i32Margin);
179 virtual int32_t GetMarginLeft()const;
180 virtual void SetMarginTop(int32_t i32Margin);
181 virtual int32_t GetMarginTop()const;
182 virtual void SetMarginRight(int32_t i32Margin);
183 virtual int32_t GetMarginRight()const;
184 virtual void SetMarginBottom(int32_t i32Margin);
185 virtual int32_t GetMarginBottom()const;
186
187 virtual void SetIntervalSpacing(int32_t i32IntervalSpacing);
188 virtual int32_t GetIntervalSpacing() const;
189
190 virtual void SetTitleHeight(int32_t i32Height);
191 virtual int32_t GetTitleHeight()const;
192
193 virtual void SetOkButtonName(Base::CFLString<wchar_t> strOkBtnName);
194 virtual void SetCancelButtonName(Base::CFLString<wchar_t> strCancelBtnName);
195 virtual void SetYesButtonName(Base::CFLString<wchar_t> strYesBtnName);
196 virtual void SetNoButtonName(Base::CFLString<wchar_t> strNoBtnName);
197 virtual void SetOkButtonCallback(CWndCtrlProcedure* pFunc, bool bAutoDestroy = true);
198 virtual void SetCancelButtonCallback(CWndCtrlProcedure* pFunc, bool bAutoDestroy = true);
199 virtual void SetYesButtonCallback(CWndCtrlProcedure* pFunc, bool bAutoDestroy = true);
200 virtual void SetNoButtonCallback(CWndCtrlProcedure* pFunc, bool bAutoDestroy = true);
201
202 virtual bool AdjustLayout();
203 virtual bool SetTitle(const Base::CFLString<wchar_t>& strTitle);
204 virtual Base::CFLString<wchar_t> GetTitle() const;
205
206 virtual void UpdateTheme();
207 virtual void SetWindowSize(int32_t i32Width, int32_t i32Height);
208
209 // 대화 상자 데이터입니다.
210 #ifdef AFX_DESIGN_TIME
211 enum
212 {
213 IDD = IDD_DIALOG_CUSTOM
214 };
215 #endif
216 DECLARE_MESSAGE_MAP()
217 public:
218 virtual void PostNcDestroy();
219 virtual int32_t Add(CGUILayoutBase* pLayout);
220 virtual CGUILayoutBase* GetAt(int32_t i32Index);
221 virtual BOOL OnInitDialog() override;
222 virtual bool SetFocusWnd(CGUIGridLayout* pLayout, int32_t i32Row, int32_t i32Col);
223 virtual bool SetFocusWnd(CGUIBoxLayout* pLayout, int32_t i32Idx);
224 virtual bool SetFocusWnd(CGUIDialog::EButton eButtonId);
225 virtual void OnReceiveBroadcast(const Base::CBroadcastMessage* pMessage) override;
226
227 virtual INT_PTR DoModal()override;
228
229 protected:
230 virtual void InitDefaults(); // Initialize member variables
231 virtual void InternalSetWindowPosMinimized();
232
233 protected:
234 virtual BOOL PreTranslateMessage(MSG* pMsg);
235 virtual void OnOK();
236 virtual void OnCancel();
237 virtual void OnYes();
238 virtual void OnNo();
239 virtual void DrawBorder(CDC* pDC);
240 virtual void DrawCloseButton(CDC* pDC);
241 virtual void DrawMinButton(CDC* pDC);
242 virtual void DrawTitleRect(CDC* pDC);
243
244 virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
245 virtual bool CreateButton();
246 virtual bool AdjustLayoutButton(int32_t i32BtnW, int32_t i32BtnH, int32_t i32BtnMargin, int32_t i32BtnSpace, int32_t i32BtnTop);
247 virtual BOOL HitTestGrip(MSG* pMsg);
248
249 virtual bool IsExternalParent();
250
251 DeclareGetClassType();
252
253 public:
254 CPoint m_pointPrev;
255
256 int32_t m_i32MinWidth;
257 int32_t m_i32MinHeight;
258
259 int32_t m_i32WndW;
260 int32_t m_i32WndH;
261 int32_t m_i32WndowWidthUserDefined;
262 int32_t m_i32WndowHeightUserDefined;
263 int32_t m_i32ContentsW;
264 int32_t m_i32ContentsH;
265 int32_t m_i32MarginL;
266 int32_t m_i32MarginT;
267 int32_t m_i32MarginR;
268 int32_t m_i32MarginB;
269
270 int32_t m_i32RowCnt;
271 int32_t m_i32ColCnt;
272 int32_t m_i32WndCtrlCnt;
273 int32_t m_i32BtnCnt;
274
275 int32_t m_i32Space;
276 int32_t m_i32TitleHeight;
277 bool m_bShowWindowOnAdjustLayout;
278
279 protected:
280 CInternalDialog* m_pInternal;
281
282 CRect m_rc;
283 CRect m_rcTop;
284 CRect m_rcBottom;
285 CRect m_rcLeft;
286 CRect m_rcRight;
287
288 CDC m_memDC;
289 CBitmap* m_pBmpOld;
290 CBitmap* m_pBmp;
291 bool m_bLButtonDown;
292 bool m_bLockWindowUpdate;
293 bool m_bMinimized;
294
295 CRect m_rcCloseBtn;
296 CRect m_rcMinimizeBtn;
297 CRect m_rcCaption;
298 CRect m_rcTitleRect;
299
300 int32_t m_i32IntervalSpacing;
301 int32_t m_i32HoveringBtn;
302 int32_t m_i32HoveringBtnBf;
303 COLORREF m_clrBorder;
304 COLORREF m_clrBorderActive;
305 COLORREF m_clrClientFill;
306 std::vector<CGUILayoutBase*>& m_vctLayout;
307 std::vector<CGUIDialogLayoutElement*>& m_vctInputWnd;
308 std::vector<CGUIListCtrlMassive*>& m_vctListCtrlMassive;
309
310 CBrush m_brBrush;
311 Base::CFLString<wchar_t> m_strTitle;
312
313 Base::CFLString<wchar_t> m_strOkBtnName;
314 Base::CFLString<wchar_t> m_strCancelBtnName;
315 Base::CFLString<wchar_t> m_strYesBtnName;
316 Base::CFLString<wchar_t> m_strNoBtnName;
317
318 CGUIScrollWnd* m_pScrollWnd;
319 CGUIButton* m_pBtnOK;
320 CGUIButton* m_pBtnCancel;
321 CGUIButton* m_pBtnYes;
322 CGUIButton* m_pBtnNo;
323
324 CGUIDialogLayoutElement* m_pWndCtrlOK;
325 CGUIDialogLayoutElement* m_pWndCtrlCancel;
326 CGUIDialogLayoutElement* m_pWndCtrlYes;
327 CGUIDialogLayoutElement* m_pWndCtrlNo;
328 CGUIPaneDialog* m_pParentPaneDialog;
329
330 bool m_bModeless;
331 bool m_bEnableScroll;
332 bool m_bScrollWndIncludeButtons;
333 bool m_bCreated;
334 bool m_bCenterWindowDone;
335 bool m_bShowCaption;
336 bool m_bShowCaptionMinBtn;
337 bool m_bShowCaptionCloseBtn;
338 bool m_bShowOkBtn;
339 bool m_bShowCancelBtn;
340 bool m_bShowYesBtn;
341 bool m_bShowNoBtn;
342 bool m_bEnableOkBtn;
343 bool m_bEnableCancelBtn;
344 bool m_bEnableYesBtn;
345 bool m_bEnableNoBtn;
346 bool m_bInitBlock;
347 bool m_bIsResizable;
348 bool m_bAlreadyInsideProcedure;
349 bool m_bNcActive;
350
351 int32_t m_i32MinimizeWidth;
352 EOrientation m_eOrientation;
353
354 CGUILayoutBase* m_pFocusLayout;
355 CWnd* m_pFocusWnd;
356 int32_t m_i32FocusIdx;
357 int32_t m_i32FocusIdxRow;
358 int32_t m_i32FocusIdxCol;
359
360 CWndCtrlProcedure* m_pProcedureOfCloseButtonOnCaption;
361 bool m_bProcedureOfCloseButtonOnCaptionAutoDestroy;
362 int32_t m_i32CloseButtonOnCaptionClickCount;
363
364 public:
365 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
366 afx_msg void OnPaint();
367 afx_msg void OnNcPaint();
368 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
369 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
370 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
371 afx_msg void OnSetFocus(CWnd* pOldWnd);
372 afx_msg void OnKillFocus(CWnd* pNewWnd);
373 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
374 afx_msg void OnDestroy();
375 afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
376 afx_msg void OnSize(UINT nType, int cx, int cy);
377 afx_msg BOOL OnNcActivate(BOOL bActive);
378 afx_msg void OnMouseLeave();
379 afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
380 afx_msg void OnNcMouseLeave();
381 virtual void PreSubclassWindow();
382 afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
383 afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
384 afx_msg void OnDisplayChange(UINT nBitsPerPixel, int cx, int cy);
385 afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
386 afx_msg void OnClose();
387};
388 }
389}
Template type 의 문자열 클래스
Definition FLString.h:34
버튼 클래스
Definition GUIButton.h:32
콤보박스 클래스
Definition GUIComboBox.h:29
다이얼로그 클래스
Definition GUIDialog.h:72
virtual void OnReceiveBroadcast(const Base::CBroadcastMessage *pMessage) override
Callback 함수. BroadcastMessage를 수신받는 함수
EButton
다이얼로그의 버튼
Definition GUIDialog.h:90
@ EButton_Yes
Yes 버튼
Definition GUIDialog.h:113
@ EButton_Cancel
Cancel 버튼
Definition GUIDialog.h:105
@ EButton_Ok
Ok 버튼
Definition GUIDialog.h:97
@ EButton_No
No 버튼
Definition GUIDialog.h:121
CGUIDialog(CWnd *pParent=nullptr)
기본 생성자
문자열 편집 창 클래스
Definition GUIEditCtrl.h:30
저장할 데이터가 매우 많은 경우의 리스트 컨트롤 클래스
Definition GUIListCtrlMassive.h:39
Definition FLImagingBase/AESCryptography.h:18
Definition D2DObject.h:12
EOrientation
방향
Definition FLImagingGUI/DefinitionsGUI.h:9905
ELayout
다이얼로그의 레이아웃
Definition GUIDialog.h:45
@ BoxLayout
박스 레이아웃
Definition GUIDialog.h:61
@ GridLayout
격자 레이아웃
Definition GUIDialog.h:52