FLImaging 6.5.8.1
GUIPaneLog.h
1#pragma once
2
3#include "GUIManager.h"
4#include "GUIPaneBase.h"
5#include "GUIEditBase.h"
6
7#include <deque>
8
9namespace FLImaging
10{
11 namespace GUI
12 {
13 class CGUILogRichEditCtrl;
14
15 class FL_EXPORT CGUIPaneLog : public CGUIPaneBase
16 {
17 public:
18 CGUIPaneLog() noexcept;
19 CGUIPaneLog(const CGUIPaneLog& rh);
20 virtual ~CGUIPaneLog()noexcept;
21
22 void UpdateTheme();
23 void UpdateFont();
24
25 void ClearLog();
26
27 enum ECursorPosition
28 {
29 ECursorPosition_Any = 0,
30 ECursorPosition_First,
31 ECursorPosition_Last,
32 };
33
34 const CResult SetCursorPosition(ECursorPosition ePosition);
35 ECursorPosition GetCursorPosition() const;
36
37
38 DeclareGetClassType();
39
40 protected:
41 virtual void OnReceiveBroadcast(const Base::CBroadcastMessage* pMessage) override;
42
43 static void __stdcall OnLogReceiving(const wchar_t* pWcsLog, CFLBase* pReceiver);
44 static unsigned __stdcall ThreadUpdate(void* pParam);
45
46 protected:
47 CGUILogRichEditCtrl& m_wndLog;
48 CFont* m_pFont;
49 uint32_t m_u32LimitLength;
50
51 CCriticalSection m_csLog;
52 std::deque<Base::CFLString<wchar_t>>& m_deqLogs;
53
54 bool m_bUpdateThreadRunning;
55 bool m_bUpdateThreadTerminated;
56 uintptr_t m_uptrUpdateThread;
57
58 protected:
59 virtual BOOL PreTranslateMessage(MSG* pMsg);
60 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
61 virtual bool DisplayLog();
62
63 friend class CGUILogRichEditCtrl;
64 friend class CGUIMainFrame;
65 friend class CGUIManagerPane;
66 friend class CInternalManagerPane;
67
68 public:
69 DECLARE_MESSAGE_MAP()
70 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
71 afx_msg void OnSize(UINT nType, int cx, int cy);
72 afx_msg void OnDestroy();
73 afx_msg void OnClose();
74 afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
75 afx_msg void OnTimer(UINT_PTR nIDEvent);
76 afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
77 };
78 }
79}
80