FLImaging 6.5.8.1
GUISplashWnd.h
1#pragma once
2#include <afxwin.h>
3
4namespace FLImaging
5{
6 namespace GUI
7 {
8 class CGUIStaticText;
9 class CGUISplashWnd;
10
11 class CLogList : public CEdit, Base::CFLBase
12 {
13 // 생성입니다.
14 public:
15 CLogList() noexcept;
16
17 // 구현입니다.
18 public:
19 virtual ~CLogList();
20 virtual void AddString(Base::CFLString<wchar_t> str);
21 CFont m_font;
22
23
24 DeclareGetClassType();
25
26 protected:
27 CGUISplashWnd* m_pParent;
28 COLORREF m_clrLogText;
29
30 public:
31 DECLARE_MESSAGE_MAP()
32 afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
33 };
34
35 class FL_EXPORT CGUISplashWnd :public CWnd
36 {
37 friend class CLogList;
38 protected:
39 CGUISplashWnd();
40 virtual ~CGUISplashWnd();
41
42 public:
43 enum EBehavior
44 {
45 ESplashScreenMenu_QuitProgram,
46 ESplashScreenMenu_QuitProgramYESNO,
47 ESplashScreenMenu_CloseSplashScreen,
48 };
49
50 enum EBtnStatus
51 {
52 ESplashScreenBtnStatus_Disable,
53 ESplashScreenBtnStatus_Enable,
54 ESplashScreenBtnStatus_Hide,
55 };
56
57 static BOOL ShowSplashScreen(bool bShow);
58 static bool SetBitmapResourceID(UINT uBmpID);
59 static void SetTextColor(COLORREF clrText);
60 static void SetBkColor(COLORREF clrBk);
61 static bool SetStatusText(Base::CFLString<wchar_t> strStatus);
62 static void SetProgressBar(bool bActivate);
63 static void SetProgressPos(int nStartPos, int nEndPos);
64 static void SetCloseButton(EBtnStatus eCloseBtn, EBehavior eCloseBehavior, COLORREF clrCloseBtn = RGB(200, 200, 200));
65 static void SetTimeElapse(int32_t i32TimeElapse);
66 static void SetCloseTimer(bool bSetTimer, UINT nTimeout);
67 static Base::CFLString<wchar_t> GetLogString();
68 static void Close();
69
70 BOOL PreTranslateMessage(MSG* pMsg);
71
72 DECLARE_MESSAGE_MAP()
73 afx_msg void OnPaint();
74 afx_msg void OnTimer(UINT_PTR nIDEvent);
75 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
76
77 protected:
78 static BOOL Activate();
79 virtual void PostNcDestroy();
80 virtual void Close(EBehavior eCloseBehavior);
81 virtual void OnClickShowLogView();
82
83 protected:
84 static BOOL m_bShowSplashWnd;
85 static CGUISplashWnd* m_pWnd;
86 static CProgressCtrl* m_pProgress;
87 static UINT m_uTimeOut;
88 static UINT m_uTimePast;
89 static UINT m_uBmpID;
90 static bool m_bActivateProgressBar;
91 static bool m_bCloseTimer;
92 static COLORREF m_clrText;
93 static COLORREF m_clrBackground;
94 static COLORREF m_clrCloseBtn;
95 static Base::CFLString<wchar_t> m_strStatus;
96 static Base::CFLString<wchar_t> m_strPercent;
97 static Base::CFLString<wchar_t> m_strLog;
98 static EBtnStatus m_eCloseBtn;
99 static EBehavior m_eTimeOutBehavior;
100 static EBehavior m_eCloseBtnBehavior;
101 static int32_t m_i32TimeElapse;
102
103 bool m_bProgressInverse;
104 bool m_bShowLogView;
105 CLogList* m_pLogView;
106
107 int32_t m_i32Index;
108 int32_t m_i32Width;
109 int32_t m_i32Height;
110 int32_t m_i32ImgWidth;
111 int32_t m_i32ImgHeight;
112 int32_t m_i32BtnSize;
113 int32_t m_i32BtnMargin;
114 int32_t m_i32ProgressPos;
115
116 CRect m_rtProgressBar;
117 CRect m_rtStatusText;
118 CRect m_rtShowLogText;
119 CRect m_rtLogView;
120 CRect m_rtPercentText;
121
122 bool m_bInit;
123 bool m_bHangMsg;
124
125 CFont m_font;
126 CFont m_fontBold;
127
128 //더블 버퍼링 구현에 사용할 변수
129 CRect m_rc;
130 CDC m_memDC;
131 CBitmap* m_pBmpOld;
132 CBitmap* m_pBmp;
133};
134 }
135}