10#include "GUIPaneCode.h"
11#include "GUIPaneProperties.h"
12#include "GUIPaneExampleSNAP.h"
13#include "GUIPaneColorTable.h"
14#include "GUIPaneViewGraph.h"
15#include "GUIPaneSheet.h"
16#include "GUIMenuBar.h"
23 class CGUIViewImageBase;
24 class CGUIMenuItemProperty;
27 class FL_EXPORT CGUIMainFrame :
public CMDIFrameWndEx,
public Base::CFLBase
29 DECLARE_DYNAMIC(CGUIMainFrame)
32 CGUIMainFrame() noexcept;
33 CGUIMainFrame(const CGUIMainFrame& rh);
36 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
37 virtual BOOL LoadFrame(UINT nIDResource, DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, CWnd* pParentWnd =
nullptr, CCreateContext* pContext =
nullptr);
40 virtual ~CGUIMainFrame();
42 virtual void AssertValid()
const;
43 virtual void Dump(CDumpContext& dc)
const;
47 CGUIMenuBar* GetMenuBar();
48 CGUIPaneMenu* GetPaneMenu();
49 CGUIPaneExampleSNAP* GetPaneExampleSNAP();
50 CGUIPaneLog* GetPaneLog();
51 CGUIPaneCode* GetPaneCode();
52 CGUIPaneColorTable* GetPaneColorTable();
53 CGUIPaneViewGraph* GetPaneViewGraph();
54 CGUIPaneSheet* GetPaneSheet();
55 CGUIViewGraph* GetGraphViewInPane();
56 CDockingManager* GetDockingManagerPointer();
58 CGUIPaneProperties* GetLastPaneProperties();
59 bool SetLastPaneProperties(CGUIPaneProperties* pPane);
61 bool SwitchTabs(
bool bForwardDirection);
63 virtual Base::CFLString<wchar_t> GetTextInformationAbout()
const;
64 virtual void SetTextInformationAbout(
const Base::CFLString<wchar_t>& str);
65 virtual void InitializeTextInformationAbout();
67 const CResult AddPane(CGUIPaneBase* pPane);
68 const CResult DeletePane(CGUIPaneBase* pPane);
70 void SetAppTheme(UINT nAppTheme);
73 void SetViewBaseLastFocused(CGUIViewImageBase* pView);
74 CGUIViewImageBase* GetViewBaseLastFocused();
76 void SetMenuItemPropertyForActivateView(CGUIMenuItemProperty* pMIPActivateView);
78 void OnAppLook(UINT
id);
80 bool IsSetRecalcLayout();
81 void SetRecalcLayout(
bool bSet);
82 void RecalcPaneSize();
83 std::vector<CGUIPaneProperties*>* GetVectorPaneProperties();
84 std::vector<CGUIPaneBase*>* GetVectorPanes();
86 const CResult ClearScreenSegmentationMode();
88 virtual bool IsTerminateAppRequested()
const;
89 virtual void RequestTerminateApp(
bool bTerminate =
true);
92 virtual bool IsCloseEnabled()
const;
94 virtual void SetCloseEnabled(
bool bEnable);
97 virtual bool IsResizable()
const;
99 virtual void SetResizable(
bool bResizable =
true);
101 DeclareGetClassType();
106 CGUIMenuBar m_wndMenuBar;
107 CGUIPaneMenu m_wndPaneMenu;
108 CGUIPaneExampleSNAP m_wndPaneExampleSNAP;
109 CGUIPaneLog m_wndPaneLog;
110 CGUIPaneCode m_wndPaneCode;
111 CGUIPaneViewGraph m_wndPaneViewGraph;
112 CGUIPaneSheet m_wndPaneSheet;
113 CGUIPaneColorTable m_wndPaneColorTable;
115 CGUIViewImageBase* m_pViewBaseLastFocused;
116 CGUIPaneProperties* m_pLastPaneProperties;
117 CGUIMenuItemProperty* m_pMIPActivateView;
118 CBitmap* m_pBmpBackground;
119 CSize m_szBackground;
121 EScreenSegmentationMode m_eScreenSegmentationMode;
122 CRect m_rtSegmentationPrevWindow;
123 int32_t m_i32SegmentationPrevShowCmd;
125 std::vector<CGUIPaneBase*>& m_vctPPaneBase;
126 std::vector<CGUIPaneProperties*>& m_vctPPaneProperties;
129 virtual void OnReceiveBroadcast(
const Base::CBroadcastMessage* pMessage)
override;
130 afx_msg
int OnCreate(LPCREATESTRUCT lpCreateStruct);
131 afx_msg LRESULT OnAfxWmPressCloseButton(WPARAM wParam, LPARAM lParam);
132 void OnUpdateAppLook(CCmdUI* pCmdUI);
134 const CPoint GetMinWindowSize()
const;
136 HMENU GetWindowMenuPopup(HMENU hMenuBar);
137 virtual void GetMessageString(UINT nID, Base::CFLString<wchar_t>& rMessage)
const;
139 bool MoveInsideMonitor();
141 static int32_t GetResizingPosition(
const CPoint& point, CWnd* pWnd,
const float f32AddTolerance = 0.f);
142 static wchar_t* GetResizingMouseCursor(int32_t i32ResizingPosition);
144 const CResult RunPropertyShortKeyDown(UINT uiKey);
146 DECLARE_MESSAGE_MAP()
148 afx_msg
void OnFileNew();
149 afx_msg
void OnUpdateFileNew(CCmdUI* pCmdUI);
151 afx_msg
void OnFileOpen();
152 afx_msg
void OnUpdateFileOpen(CCmdUI* pCmdUI);
154 afx_msg
void OnCheckForUpdates();
155 afx_msg
void OnUpdateCheckForUpdates(CCmdUI* pCmdUI);
157 afx_msg
void OnInformationAbout();
158 afx_msg
void OnUpdateInformationAbout(CCmdUI* pCmdUI);
160 afx_msg
void OnInformationHelp();
161 afx_msg
void OnInformationLicenseFeatures();
163 afx_msg
void OnFindMenu();
164 afx_msg
void OnUpdateSetFindMenu(CCmdUI* pCmdUI);
166 afx_msg
void OnSetMenuFont();
167 afx_msg
void OnUpdateSetMenuFont(CCmdUI* pCmdUI);
169 afx_msg
void OnSetPropertyFont();
170 afx_msg
void OnUpdateSetPropertyFont(CCmdUI* pCmdUI);
172 afx_msg
void OnSetLogFont();
173 afx_msg
void OnUpdateSetLogFont(CCmdUI* pCmdUI);
175 afx_msg
void OnSetCodeFont();
176 afx_msg
void OnUpdateSetCodeFont(CCmdUI* pCmdUI);
178 afx_msg
void OnSetDefaultFont();
179 afx_msg
void OnUpdateSetDefaultFont(CCmdUI* pCmdUI);
181 afx_msg
void OnSetExampleSNAPFont();
182 afx_msg
void OnUpdateSetExampleSNAPFont(CCmdUI* pCmdUI);
184 afx_msg
void OnPaneMenu();
185 afx_msg
void OnUpdatePaneMenu(CCmdUI* pCmdUI);
187 afx_msg
void OnPaneExampleSNAP();
188 afx_msg
void OnUpdatePaneExampleSNAP(CCmdUI* pCmdUI);
190 afx_msg
void OnPaneLog();
191 afx_msg
void OnUpdatePaneLog(CCmdUI* pCmdUI);
193 afx_msg
void OnPaneCode();
194 afx_msg
void OnUpdatePaneCode(CCmdUI* pCmdUI);
196 afx_msg
void OnPaneColorTable();
197 afx_msg
void OnUpdatePaneColorTable(CCmdUI* pCmdUI);
199 afx_msg
void OnPaneViewGraph();
200 afx_msg
void OnUpdatePaneViewGraph(CCmdUI* pCmdUI);
202 afx_msg
void OnPaneSheet();
203 afx_msg
void OnUpdatePaneSheet(CCmdUI* pCmdUI);
205 afx_msg
void OnUpdateGenerateExampleCode(CCmdUI* pCmdUI);
206 afx_msg
void OnGenerateExampleCode();
208 afx_msg
void OnUpdateMenuUser(CCmdUI* pCmdUI);
209 afx_msg
void OnMenuUser(UINT uID);
211 afx_msg
void OnSysCommand(UINT nID, LPARAM lParam);
212 void GetClientArea(CRect& rtArea);
213 BOOL OnEraseMDIClientBackground(CDC* pDC);
214 virtual BOOL OnCloseDockingPane(CDockablePane* pWnd);
215 virtual BOOL OnCloseMiniFrame(CPaneFrameWnd* pWnd);
216 virtual
void AdjustDockingLayout(HDWP hdwp = NULL);
217 virtual
void RecalcLayout(BOOL bNotify = TRUE);
218 afx_msg
void OnClose();
219 afx_msg UINT OnPowerBroadcast(UINT nPowerEvent, LPARAM nEventData);
220 afx_msg
void OnFileSave();
221 afx_msg
void OnUpdateFileSave(CCmdUI* pCmdUI);
222 afx_msg
void OnFileSaveAs();
223 afx_msg
void OnUpdateFileClose(CCmdUI* pCmdUI);
224 afx_msg
void OnAppExit();
225 afx_msg
void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
226 afx_msg LRESULT OnMessageRunOnMainThread(WPARAM wParam, LPARAM lParam);
227 afx_msg LRESULT OnMessageRunOnMainThreadPost(WPARAM wParam, LPARAM lParam);
228 afx_msg LRESULT OnMessageAppTitleChanged(WPARAM wParam, LPARAM lParam);
229 virtual BOOL PreTranslateMessage(MSG* pMsg);
230 afx_msg
void OnTimer(UINT_PTR nIDEvent);
231 afx_msg
void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp);
232 afx_msg BOOL OnNcActivate(BOOL bActive);
235 volatile
bool m_bTerminateApp;
238 bool m_bAppTitleDirty;
240 bool m_bCloseMsgActivated;
241 mutable
bool m_bResizable;
243 Foundation::CFLPoint<int32_t> m_pointPrev;
244 int32_t m_i32PaneWidth;
245 int32_t m_i32PaneHeight;
246 int32_t m_i32WidthLimit;
247 int32_t m_i32HeightLimit;
249 CRect m_rtResizingOrgWindow;
250 CRect m_rtMaximizedWindow;
252 Base::CFLString<
wchar_t> m_strInformationAbout;
253 Base::EOperatingSystemType m_eOperatingSystemType;
255 friend class CGUIManagerView;
256 friend class CGUIManagerPane;
257 friend class CGUIManager;
258 friend class CGUIMenuBar;
259 friend class CGUIMainFrameTabCtrl;
260 friend class CGUIMenuItemProperty;
262 afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
263 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
264 afx_msg
void OnNcPaint();