-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainFrm.h
154 lines (123 loc) · 5.3 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
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__FFCA2B88_F9C5_11D4_A6F1_0050CE184C9B__INCLUDED_)
#define AFX_MAINFRM_H__FFCA2B88_F9C5_11D4_A6F1_0050CE184C9B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CMainFrame : public CMDIFrameWnd
{
DECLARE_DYNAMIC(CMainFrame)
public:
CMainFrame();
protected:
void OnSizeMainWindow(int cx, int cy);
public: // status bar
void BeginProgress(LPCTSTR lpszMessage) { m_wndStatusBar.BeginProgress(lpszMessage); }
void EndProgress() { m_wndStatusBar.EndProgress(); }
void SetProgress(INT nPercent) { m_wndStatusBar.SetProgress(nPercent); }
void SetCaretPositionInfo(INT nLine, INT nCol, INT nMax);
void SetFileStatusInfo(INT nEncodingType, INT nFileFormat, BOOL bReadOnly);
void SetMacroRecordingFlag(BOOL bRecording);
void SetColumnModeFlag(BOOL bColumnMode);
void SetOverwriteFlag(BOOL bOverwrite);
public: // file selection tab
void InsertMDIFileTab(CMDIChildWnd * pChild);
void DeleteMDIFileTab(CMDIChildWnd * pChild);
void UpdateMDIFileTab(CMDIChildWnd * pChild);
void SetActiveFileTab(CMDIChildWnd * pChild);
public: // get windows
CWnd * GetFileWindow() { return & m_wndFileWindow; }
CWnd * GetOutputWindow() { return & m_wndOutputWindow; }
public: // file window
BOOL IsFileWindowVisible() { return m_wndFileWindow.IsWindowVisible(); }
void ShowFileWindow(BOOL bShow) { ShowControlBar( & m_wndFileWindow, bShow, FALSE ); }
void ShowFileWindowCategory(INT nCategory);
void ToggleFileWindowCategory(INT nCategory);
public: // output window
BOOL IsOutputWindowVisible() { return m_wndOutputWindow.IsWindowVisible(); }
void ShowOutputWindow(BOOL bShow) { ShowControlBar( & m_wndOutputWindow, bShow, FALSE ); }
void ApplyOutputWindowFont(BOOL bRedraw = TRUE) { m_wndOutputWindow.ApplyOutputFont(bRedraw); }
void EnableOutputWindowInput(BOOL bEnable) { m_wndOutputWindow.EnableInputConsole(bEnable); }
void SetOutputWindowOccupied(BOOL bOccupy) { m_wndOutputWindow.SetOccupied(bOccupy); }
BOOL CanUseOutputWindow() { return m_wndOutputWindow.CanUseNow(); }
void ClearOutputWindowContents() { m_wndOutputWindow.ClearAllTheContents(); }
BOOL AddStringToOutputWindow(LPCTSTR lpszString) { return m_wndOutputWindow.AddStringToTheLast(lpszString); }
BOOL ReplaceStringOfOutputWindow(LPCTSTR lpszString) { return m_wndOutputWindow.ReplaceTheLastString(lpszString); }
BOOL GetStringOfOutputWindow(CString & szString) { return m_wndOutputWindow.GetTheLastString(szString); }
public: // child window
INT GetChildFrameCount() { return m_lstChildFrame.GetCount(); }
CMDIChildWnd * GetNextChildFrame() { return m_wndFileTab.GetNextChildFrame(); }
CMDIChildWnd * GetPrevChildFrame() { return m_wndFileTab.GetPrevChildFrame(); }
CDocument * MDIGetActiveDocument();
CView * MDIGetActiveView();
void ActivateNextChildFrame();
void ActivatePrevChildFrame();
void ActivateChildFrameInZOrder(INT nIndex);
void BringChildFrameToTop(CMDIChildWnd * pChild);
public: // others
void OnUpdateFrameTitle(BOOL bAddToTitle);
BOOL RefreshSyntaxTypeMenu();
BOOL RefreshLoadUserToolsMenu();
BOOL RefreshLoadUserMacrosMenu();
protected: // find menu item
CMenu * FindParentMenuContaing(CMenu * pParentMenu, UINT nFindMenuID);
public: // window placement
BOOL SaveWindowPlacement(LPCTSTR lpszProfileName);
BOOL LoadWindowPlacement(LPCTSTR lpszProfileName);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
virtual void RecalcLayout(BOOL bNotify = TRUE);
virtual void OnSetPreviewMode(BOOL bPreview, CPrintPreviewState* pState);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // Attributes
CList<CMDIChildWnd *, CMDIChildWnd *> m_lstChildFrame;
BOOL m_bSwitchingChildFrame;
BOOL m_bPrintPreviewMode;
protected: // control bar embedded members
CStatusBarEx m_wndStatusBar;
CToolBar m_wndToolBar;
CMDIFileTab m_wndFileTab;
CFileWindow m_wndFileWindow;
COutputWindow m_wndOutputWindow;
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnViewFileTab();
afx_msg void OnUpdateViewFileTab(CCmdUI* pCmdUI);
afx_msg void OnActivateApp(BOOL bActive, HTASK hTask);
afx_msg void OnClose();
afx_msg void OnViewDirectory();
afx_msg void OnUpdateViewDirectory(CCmdUI* pCmdUI);
afx_msg void OnViewOutput();
afx_msg void OnUpdateViewOutput(CCmdUI* pCmdUI);
afx_msg void OnViewProject();
afx_msg void OnUpdateViewProject(CCmdUI* pCmdUI);
afx_msg void OnWindowLastVisited();
afx_msg void OnWindowNext();
afx_msg void OnWindowPrev();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnFileWindowHide();
afx_msg void OnFileWindowSync();
afx_msg void OnOutputWindowHide();
afx_msg void OnOutputWindowCopy();
afx_msg void OnOutputWindowClear();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__FFCA2B88_F9C5_11D4_A6F1_0050CE184C9B__INCLUDED_)