FLImaging 7.10.21.1
GUIPaneCode.h
1#pragma once
2
3#include "GUIPaneBase.h"
4#include "GUIEditBase.h"
5#include "DefinitionsGUI.h"
6#include "GUISearchBar.h"
7#include "ISearchTarget.h"
8
9namespace FLImaging
10{
11 namespace GUI
12 {
13 class CGUIPaneCode;
14 class CInternalGUIPaneCode;
15
16 class CCodeRichEditCtrl : public CRichEditCtrl, public Base::CFLBase
17 {
18 // 생성입니다.
19 public:
20 CCodeRichEditCtrl() noexcept;
21 virtual ~CCodeRichEditCtrl();
22
23 void OnCopy();
24 bool IsVScrollVisible() const;
25
26 DeclareGetClassType();
27
28 protected:
29 void Append(int32_t& i32Index, Base::CFLString<wchar_t>& flsText, COLORREF clrText);
30 void EnableAutoScroll(bool bEnable);
31
32 public:
33 DECLARE_MESSAGE_MAP()
34 afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
35 afx_msg void OnDestroy();
36 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
37
38 int32_t m_i32End;
39
40 protected:
41 ECodeType m_eCodeType;
42 CGUIPaneCode* m_pParentPane;
43 CHARFORMAT m_cf;
44
45 friend class CGUIPaneCode;
46 };
47
48 class FL_EXPORT CGUIPaneCode : public CGUIPaneBase, public ISearchTarget
49 {
50 friend class CCodeRichEditCtrl;
51 public:
52 CGUIPaneCode() noexcept;
53 CGUIPaneCode(const CGUIPaneCode& rh);
54 virtual ~CGUIPaneCode()noexcept;
55
56 void UpdateTheme();
57 void UpdateFont();
58
59 const CResult BeginBlock(const Base::CFLBase* pObj, Base::CFLString<wchar_t> flsInstanceName, Base::CFLString<wchar_t> flsDesc = L"");
60 const CResult BeginBlock(Base::CFLString<wchar_t> flsBlockName, Base::CFLString<wchar_t> flsDesc = L"");
61 const CResult EndBlock();
62
63 template<typename T>
64 const CResult AddMultiVar(const Base::CMultiVar<T>* pFlmv, Base::CFLString<wchar_t> flsVariableName);
65 const CResult AddImage(const Base::CFLImage* pImage, Base::CFLString<wchar_t> flsVariableName);
66 const CResult AddFigure(const Foundation::CFLFigure* pFigure, Base::CFLString<wchar_t> flsVariableName);
67 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>>());
68
69 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>>());
70
71 const CResult Clear(ECodeType eCodeType);
72 const CResult Write(ECodeType eCodeType, Base::CFLString<wchar_t> flsCode);
73 const CResult Append(ECodeType eCodeType, Base::CFLString<wchar_t> flsCode);
74 const CResult AppendCodeBlock(ECodeType eCodeType, Base::CFLString<wchar_t> flsBlockName, Base::CFLString<wchar_t> flsDesc, Base::CFLString<wchar_t> flsCode);
75
76 void SetIndentCount(int32_t i32IndentCount);
77 int32_t GetIndentCount();
78 CCodeRichEditCtrl* GetActivateCategoryCode() const;
79
80 void InternalUpdateWindow();
81
82 DeclareGetClassType();
83
84 protected:
85 virtual void OnReceiveBroadcast(const Base::CBroadcastMessage* pMessage) override;
86
87 void DefaultSet(ECodeType eCodeType);
88
89 const CResult InternalWrite(ECodeType eCodeType, Base::CFLString<wchar_t> flsCode, bool bAppend);
90 const CResult InternalAppendCodeBlock(ECodeType eCodeType, Base::CFLString<wchar_t> flsBlockName, Base::CFLString<wchar_t> flsDesc, Base::CFLString<wchar_t> flsCode);
91
92 virtual bool SwitchTabs(bool bForwardDirection)override;
93
94 protected:
95 virtual BOOL PreTranslateMessage(MSG* pMsg);
96 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
97
98 DECLARE_MESSAGE_MAP()
99 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
100 afx_msg void OnSize(UINT nType, int cx, int cy);
101
102 public:
103 afx_msg void OnDestroy();
104 afx_msg void OnClose();
105 afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
106
107 protected:
108 Base::CFLString<wchar_t> AsciiToUnicode(const char* pszString) const;
109
110 void ShowSearchBar();
111 // from ISearchTarget
112 virtual CWnd* GetWnd() override;
113 virtual CString GetAllText() override;
114 virtual long FindNext(const CString& strText, long nStartPos, DWORD dwFlags, CHARRANGE& outRange) override;
115 virtual void SetSelectionRange(long nMin, long nMax) override;
116 virtual void GetSelectionRange(long& nMin, long& nMax) override;
117 virtual void HighlightRange(long nMin, long nMax, COLORREF crBack) override;
118 virtual void ClearAllHighlight() override;
119 virtual void GetSel(CHARRANGE& cr) const override;
120 virtual void SetSel(CHARRANGE& cr) override;
121 virtual void SetSel(long nStartChar, long nEndChar) override;
122 virtual BOOL SetSelectionCharFormat(CHARFORMAT& cf) override;
123 virtual BOOL SetSelectionCharFormat(CHARFORMAT2& cf) override;
124 virtual void HideSelection(BOOL bHide, BOOL bPerm) override;
125 virtual long FindText(DWORD dwFlags, FINDTEXTEX* pFindText) const override;
126 // end of from ISearchTarget
127
128 protected:
129 CInternalGUIPaneCode* m_pInternal;
130
131 CMFCTabCtrl m_wndTabs;
132 CCodeRichEditCtrl m_wndCode[ECodeType_Count];
133 CGUISearchBar m_searchBar;
134 friend class CInternalManagerPane;
135 public:
136 afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
137 LRESULT OnChangeActiveTab(WPARAM wp, LPARAM lp);
138 };
139 }
140}
141
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 FLImagingGUI/DefinitionsGUI.h:13190
@ ECodeType_Count
Number of code types.
Definition FLImagingGUI/DefinitionsGUI.h:13229