-
Notifications
You must be signed in to change notification settings - Fork 2
/
MainFrm.h
192 lines (159 loc) · 5.96 KB
/
MainFrm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
// MainFrm.h : interface of the CMainFrame class
//
#pragma once
#include "MDITabsDialogBar.h"
#include "RasterDialogBar.h"
#include "MDITabChildWnd.h"
#include "ResourceTypeList.h"
#include "PicCommandDialogBar.h"
#include "QuickScripts.h"
#include "ExtControlBarNoX.h"
#include "BarContainerDialog.h"
#include "OutputPane.h"
#include "ScriptComboBox.h"
#include "SamplesDialogBar.h"
#include "SoundToolboxDialogBar.h"
class CNewScriptDialog;
class CExtMenuControlBarHideShow : public CExtMenuControlBar
{
protected:
BOOL _UpdateMenuBar(BOOL bDoRecalcLayout = 1);
bool _ExcludeMenu(PCSTR pszName);
};
class CBrowseInfoStatusPane : public CExtLabel, public IClassBrowserEvents
{
public:
CBrowseInfoStatusPane();
~CBrowseInfoStatusPane();
// IClassBrowserEvents
// Note: this method may be called on a different thread.
void NotifyClassBrowserStatus(BrowseInfoStatus status, int iPercent);
private:
DECLARE_MESSAGE_MAP()
void OnLButtonDblClk(UINT nFlags, CPoint point);
void OnDrawLabelText(CDC &dc, const RECT &rcText, __EXT_MFC_SAFE_LPCTSTR strText, DWORD dwDrawTextFlags, bool bEnabled);
LRESULT _OnStatusReady(WPARAM wParam, LPARAM lParam);
BrowseInfoStatus _status;
// Text to post back to the UI thread.
std::string _textToPost;
mutable CRITICAL_SECTION _csTextPosting;
};
class CMainFrame : public CExtNCW<CMDIFrameWnd>
{
DECLARE_DYNAMIC(CMainFrame)
public:
CMainFrame();
// Attributes
public:
// Operations
public:
// Overrides
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
void AddTab(CFrameWnd *pNewFrame, MDITabType iType);
void RemoveTab(CFrameWnd *pNewFrame);
void OnActivateTab(CFrameWnd *pWnd);
CMDITabsDialogBar &Tabs() { return m_wndTab; }
CBrowseInfoStatusPane &BrowseInfoStatus() { return m_BrowseInfoStatus; }
OutputPane& GetOutputPane() { return m_wndOutput; }
void ShowOutputPane();
BOOL DestroyWindow();
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
private: // control bar embedded members
CExtStatusControlBar m_wndStatusBar;
CBrowseInfoStatusPane m_BrowseInfoStatus;
CExtToolControlBar m_wndToolBar;
CExtMenuControlBarHideShow m_wndMenuBar;
// The tabs across the top
CMDITabsDialogBar m_wndTab;
// The toolbar under the tab
CExtToolControlBar m_wndPicTools;
CExtToolControlBar m_wndScriptTools;
CClassComboBox m_wndScriptToolComboBoxClass;
//CMethodComboBox m_wndScriptToolComboBoxFunction;
CExtToolControlBar m_wndTextTools;
CExtToolControlBar m_wndSoundTools;
CExtToolControlBar m_wndVocabTools;
CExtToolControlBar m_wndViewTools;
CExtToolControlBar m_wndExplorerTools;
// These combine to form a control bar that contains an empty dialog
CExtControlBarNoX m_wndResizableBarGeneral;
CBarContainerDialog m_dlgEmpty;
// We don't actually show this, but we use its m_nMenuMarkerID member variable.
CExtThemeSwitcherToolControlBar m_ThemeSwitcher;
// The empty dialog can contain these subdialogs:
CRasterDialogBar m_dlgForPanelDialogFont;
CRasterDialogBar m_dlgForPanelDialogView;
CRasterDialogBar m_dlgForPanelDialogCursor;
PicCommandDialogBar m_dlgForPanelDialogPic;
SoundToolboxDialogBar m_dlgForPanelDialogSound;
CQuickScripts m_dlgForPanelDialogScript;
CSamplesDialogBar m_dlgForPanelDialogGame;
// The output window at the bottom (find and compile results)
CExtControlBar m_wndResizableBarOutput;
OutputPane m_wndOutput;
// Our cache of the currently active document.
CMDITabChildWnd *_pActiveFrame;
bool _fDidntGetDocYet;
// Generated message map functions
private:
void ActivateFrame(int nCmdShow);
void _RefreshToolboxPanel(CFrameWnd *pWnd);
void _OnNewScriptDialog(CNewScriptDialog &dialog);
void _HideTabIfNot(MDITabType iTabTypeCurrent, MDITabType iTabTypeCompare, CExtControlBar &bar);
void _FindInFilesOfType(ICompileLog &log, PCTSTR pszWildcard, PCTSTR pszWhat, BOOL fMatchCase, BOOL fWholeWord);
void _AddFindResults(ICompileLog &log, PCTSTR pszFullPath, PCTSTR pszFileName, PCTSTR pszWhat, BOOL fMatchCase, BOOL fWholeWord);
void _PrepareExplorerCommands();
void _PrepareRasterCommands();
void _PrepareScriptCommands();
void _PrepareMainCommands();
void _PreparePicCommands();
void _PrepareTextCommands();
void _PrepareVocabCommands();
void _PrepareSoundCommands();
BOOL PreTranslateMessage(MSG* pMsg);
LRESULT OnConstructPopupMenuCB(WPARAM wParam, LPARAM lParam);
LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnDestroy();
afx_msg void OnFileNewPic();
afx_msg void OnFileNewGame();
afx_msg void OnFileNewView();
afx_msg void OnFileNewFont();
afx_msg void OnFileNewCursor();
afx_msg void OnFileNewText();
afx_msg void OnFileNewSound();
afx_msg void OnFileOpenResource();
afx_msg void OnFileAddResource();
afx_msg void OnUpdateNewPic(CCmdUI *pCmdUI);
afx_msg void OnUpdateShowIfGameLoaded(CCmdUI *pCmdUI);
afx_msg void OnShowPreferences();
afx_msg void OnRebuildResources();
afx_msg BOOL OnShowResource(UINT nId);
afx_msg void OnIdleUpdateCmdUI();
afx_msg void OnNewRoom();
afx_msg void OnNewScript();
afx_msg void OnCompileAll();
afx_msg void OnUpdateAlwaysEnabled(CCmdUI *pCmdUI) { pCmdUI->Enable(); }
afx_msg void OnFindInFiles();
afx_msg void OnUpdateBackForward(CCmdUI *pCmdUI);
afx_msg void OnUpdateScriptCombo(CCmdUI *pCmdUI);
afx_msg void OnGoForward();
afx_msg void OnGoBack();
afx_msg void OnClassBrowser();
afx_msg void OnUpdateClassBrowser(CCmdUI *pCmdUI);
afx_msg void OnTimer(UINT_PTR nIDEvent);
afx_msg void OnSelfTest();
DECLARE_MESSAGE_MAP()
int _fMatchWholeWord;
int _fMatchCase;
int _fFindInAll;
bool _fSelfTest;
WINDOWPLACEMENT m_dataFrameWP;
};