FLImaging 6.8.12.1
GUIPaneCode.h
1#pragma once
2
3#include "GUIPaneBase.h"
4#include "GUIEditBase.h"
5#include "DefinitionsGUI.h"
6
7
8namespace FLImaging
9{
10 namespace GUI
11 {
12 class CGUIPaneCode;
13 class CInternalGUIPaneCode;
14
15 class CCodeRichEditCtrl : public CRichEditCtrl, Base::CFLBase
16 {
17 // 생성입니다.
18 public:
19 CCodeRichEditCtrl() noexcept;
20 virtual ~CCodeRichEditCtrl();
21
22 void OnCopy();
23
24 DeclareGetClassType();
25
26 protected:
27 void Append(int32_t& i32Index, Base::CFLString<wchar_t>& flsText, COLORREF clrText);
28
29 void EnableAutoScroll(bool bEnable);
30
31 public:
32 DECLARE_MESSAGE_MAP()
33 afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
34 afx_msg void OnDestroy();
35 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
36
37 int32_t m_i32End;
38
39 protected:
40 ECodeType m_eCodeType;
41 CGUIPaneCode* m_pParentPane;
42 CHARFORMAT m_cf;
43
44 friend class CGUIPaneCode;
45 };
46
47 class FL_EXPORT CGUIPaneCode : public CGUIPaneBase
48 {
49 friend class CCodeRichEditCtrl;
50 public:
51 CGUIPaneCode() noexcept;
52 CGUIPaneCode(const CGUIPaneCode& rh);
53 virtual ~CGUIPaneCode()noexcept;
54
55 void UpdateTheme();
56 void UpdateFont();
57
58 const CResult BeginBlock(const Base::CFLBase* pObj, Base::CFLString<wchar_t> flsInstanceName, Base::CFLString<wchar_t> flsDesc = L"");
59 const CResult BeginBlock(Base::CFLString<wchar_t> flsBlockName, Base::CFLString<wchar_t> flsDesc = L"");
60 const CResult EndBlock();
61
62 const CResult AddImage(const Base::CFLImage* pImage, Base::CFLString<wchar_t> flsVariableName);
63 const CResult AddFigure(const Foundation::CFLFigure* pFigure, Base::CFLString<wchar_t> flsVariableName);
64 const CResult AddFunction(Base::CFLString<wchar_t> flsFunctionName, Base::CFLString<wchar_t> flsCppArgs = L"", Base::CFLString<wchar_t> flsCSharpArgs = L"", Base::CFLString<wchar_t> flsPythonArgs = L"", Base::CFLArray<Base::CFLString<wchar_t>> flaScopeName = Base::CFLArray<Base::CFLString<wchar_t>>());
65
66 const CResult AddFunctionWithObjectName(Base::CFLString<wchar_t> flsObjectName, Base::CFLString<wchar_t> flsFunctionName, Base::CFLString<wchar_t> flsCppArgs = L"", Base::CFLString<wchar_t> flsCSharpArgs = L"", Base::CFLString<wchar_t> flsPythonArgs = L"", Base::CFLArray<Base::CFLString<wchar_t>> flaScopeName = Base::CFLArray<Base::CFLString<wchar_t>>());
67
68 const CResult Clear(ECodeType eCodeType);
69 const CResult Write(ECodeType eCodeType, Base::CFLString<wchar_t> flsCode);
70 const CResult Append(ECodeType eCodeType, Base::CFLString<wchar_t> flsCode);
71 const CResult AppendCodeBlock(ECodeType eCodeType, Base::CFLString<wchar_t> flsBlockName, Base::CFLString<wchar_t> flsDesc, Base::CFLString<wchar_t> flsCode);
72
73 void SetIndentCount(int32_t i32IndentCount);
74 int32_t GetIndentCount();
75
76 void InternalUpdateWindow();
77
78 DeclareGetClassType();
79
80 protected:
81 virtual void OnReceiveBroadcast(const Base::CBroadcastMessage* pMessage) override;
82
83 void DefaultSet(ECodeType eCodeType);
84
85 const CResult InternalWrite(ECodeType eCodeType, Base::CFLString<wchar_t> flsCode, bool bAppend);
86 const CResult InternalAppendCodeBlock(ECodeType eCodeType, Base::CFLString<wchar_t> flsBlockName, Base::CFLString<wchar_t> flsDesc, Base::CFLString<wchar_t> flsCode);
87
88 virtual bool SwitchTabs(bool bForwardDirection)override;
89
90 protected:
91 virtual BOOL PreTranslateMessage(MSG* pMsg);
92 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
93
94 DECLARE_MESSAGE_MAP()
95 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
96 afx_msg void OnSize(UINT nType, int cx, int cy);
97
98 public:
99 afx_msg void OnDestroy();
100 afx_msg void OnClose();
101 afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
102
103 protected:
104 Base::CFLString<wchar_t> AsciiToUnicode(const char* pszString) const;
105
106 protected:
107 CInternalGUIPaneCode* m_pInternal;
108
109 CMFCTabCtrl m_wndTabs;
110 CCodeRichEditCtrl m_wndCode[ECodeType_Count];
111 friend class CInternalManagerPane;
112 public:
113 afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
114 };
115 }
116}
117
virtual void OnReceiveBroadcast(const CBroadcastMessage *pMessage)
Callback function. A function that receives a BroadcastMessage.
CFLBase()
Default constructor.
Definition D2DObject.h:12
ECodeType
Code type.
Definition DefinitionsGUI.h:8963
@ ECodeType_Count
Number of code types.
Definition DefinitionsGUI.h:9002