提交 | 用户 | age
|
0ed438
|
1 |
|
Q |
2 |
// MainFrm.cpp: CMainFrame 类的实现
|
|
3 |
//
|
|
4 |
|
|
5 |
#include "pch.h"
|
|
6 |
#include "framework.h"
|
|
7 |
#include "MTerm2.h"
|
|
8 |
#include "MainFrm.h"
|
|
9 |
#include "ChildFrm.h"
|
|
10 |
|
|
11 |
#include "MTerm2Doc.h"
|
|
12 |
#include "MTerm2View.h"
|
|
13 |
#include "MTerm2CtrlView.h"
|
|
14 |
#include "MTerm2TestView.h"
|
|
15 |
#include "MTerm2ProgTxt.h"
|
|
16 |
|
|
17 |
#ifdef _DEBUG
|
|
18 |
#define new DEBUG_NEW
|
|
19 |
#endif
|
|
20 |
|
|
21 |
// CMainFrame
|
|
22 |
|
b978bf
|
23 |
IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
|
0ed438
|
24 |
|
b978bf
|
25 |
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
|
0ed438
|
26 |
ON_WM_CREATE()
|
Q |
27 |
|
|
28 |
ON_COMMAND(ID_UPLOAD_FROM_PLC, &CMainFrame::OnUploadFromPlc)
|
|
29 |
ON_COMMAND(ID_VIEW_FUNCKEY_BAR, &CMainFrame::OnViewFunckeyBar)
|
|
30 |
ON_UPDATE_COMMAND_UI(ID_VIEW_FUNCKEY_BAR, &CMainFrame::OnUpdateViewFunckeyBar)
|
|
31 |
ON_COMMAND(ID_VIEW_INPUT_BAR, &CMainFrame::OnViewInputBar)
|
|
32 |
ON_UPDATE_COMMAND_UI(ID_VIEW_INPUT_BAR, &CMainFrame::OnUpdateViewInputBar)
|
|
33 |
ON_COMMAND(ID_VIEW_NUMKEY_BAR, &CMainFrame::OnViewNumkeyBar)
|
|
34 |
ON_UPDATE_COMMAND_UI(ID_VIEW_NUMKEY_BAR, &CMainFrame::OnUpdateViewNumkeyBar)
|
|
35 |
ON_COMMAND(ID_VIEW_INPUTSEG_BAR, &CMainFrame::OnViewInputsegBar)
|
|
36 |
ON_UPDATE_COMMAND_UI(ID_VIEW_INPUTSEG_BAR, &CMainFrame::OnUpdateViewInputsegBar)
|
|
37 |
ON_COMMAND(ID_VIEW_COMMENTS_BAR, &CMainFrame::OnViewCommentsBar)
|
|
38 |
ON_UPDATE_COMMAND_UI(ID_VIEW_COMMENTS_BAR, &CMainFrame::OnUpdateViewCommentsBar)
|
|
39 |
|
|
40 |
// ON_COMMAND(ID_MENU_VIEW_LDS, &CMainFrame::OnMenuViewLds)
|
|
41 |
// ON_COMMAND(ID_MENU_VIEW_BLD, &CMainFrame::OnMenuViewBld)
|
|
42 |
// ON_COMMAND(ID_MENU_VIEW_BNL, &CMainFrame::OnMenuViewBnl)
|
|
43 |
|
|
44 |
ON_COMMAND(ID_MENU_SHOW_LOG, &CMainFrame::OnMenuShowLog)
|
|
45 |
END_MESSAGE_MAP()
|
|
46 |
|
|
47 |
static UINT indicators[] =
|
|
48 |
{
|
|
49 |
ID_SEPARATOR, // 状态行指示器
|
|
50 |
ID_INDICATOR_SEL_TYPE,
|
|
51 |
ID_INDICATOR_CAPS,
|
|
52 |
ID_INDICATOR_NUM,
|
|
53 |
ID_INDICATOR_SCRL,
|
|
54 |
};
|
|
55 |
|
|
56 |
// CMainFrame 构造/析构
|
|
57 |
|
|
58 |
CMainFrame::CMainFrame() noexcept
|
|
59 |
{
|
|
60 |
// TODO: 在此添加成员初始化代码
|
|
61 |
}
|
|
62 |
|
|
63 |
CMainFrame::~CMainFrame()
|
|
64 |
{
|
|
65 |
}
|
|
66 |
|
b978bf
|
67 |
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
|
Q |
68 |
{
|
|
69 |
// TODO: 在此添加专用代码和/或调用基类
|
|
70 |
if (m_wndDlgBar_Func_Key.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
|
|
71 |
|
|
72 |
return TRUE;
|
|
73 |
|
|
74 |
return CMDIFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
|
|
75 |
}
|
|
76 |
|
0ed438
|
77 |
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
Q |
78 |
{
|
b978bf
|
79 |
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
|
0ed438
|
80 |
return -1;
|
Q |
81 |
// m_dlgMyLog.Create(m_dlgMyLog.IDD, GetParent());
|
|
82 |
// m_dlgMyLog.ShowWindow(SW_SHOW);
|
|
83 |
|
65f713
|
84 |
// BOOL bNameValid;
|
Q |
85 |
|
|
86 |
// 创建类视图
|
|
87 |
CString strNavView;
|
|
88 |
// bNameValid = strNavView.LoadString(IDS_CLASS_VIEW);
|
|
89 |
// ASSERT(bNameValid);
|
b978bf
|
90 |
/*
|
65f713
|
91 |
strNavView = _T("导航视图");
|
Q |
92 |
if (!m_wndNavView.Create(strNavView, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_NAVVIEW, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI))
|
|
93 |
{
|
|
94 |
TRACE0("未能创建“导航视图”窗口\n");
|
|
95 |
return FALSE; // 未能创建
|
|
96 |
}
|
b978bf
|
97 |
m_wndNavView.EnableDocking(CBRS_ALIGN_ANY);
|
Q |
98 |
//DockPane(&m_wndNavView);
|
|
99 |
//DockControlBar(&m_wndNavView);
|
|
100 |
*/
|
0ed438
|
101 |
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
|
Q |
102 |
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
|
|
103 |
{
|
|
104 |
TRACE0("未能创建工具栏\n");
|
|
105 |
return -1; // 未能创建
|
|
106 |
}
|
|
107 |
|
b978bf
|
108 |
/* 输入栏
|
Q |
109 |
if (!m_wndTBar_InputShow.CreateEx(this, TBSTYLE_FLAT,
|
0ed438
|
110 |
WS_CHILD | WS_VISIBLE | CBRS_BOTTOM | CBRS_FLOAT_MULTI | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
|
Q |
111 |
CRect(1, 1, 1, 1), IDW_TOOL_BAR2) ||
|
b978bf
|
112 |
!m_wndTBar_InputShow.LoadToolBar(IDR_TOOLBAR_INPUT_SHOW))
|
0ed438
|
113 |
{
|
Q |
114 |
TRACE0("未能创建数字工具栏\n");
|
|
115 |
return -1; // 未能创建
|
|
116 |
}
|
|
117 |
CRect rect1;
|
b978bf
|
118 |
int index = m_wndTBar_InputShow.CommandToIndex(ID_BUTTON_INPUT_SHOW);
|
0ed438
|
119 |
UINT nID,nStyle;
|
Q |
120 |
int iImage;
|
b978bf
|
121 |
m_wndTBar_InputShow.GetButtonInfo(0, nID, nStyle, iImage);
|
Q |
122 |
m_wndTBar_InputShow.SetButtonInfo(index, ID_BUTTON_INPUT_SHOW, TBBS_SEPARATOR, 100);
|
|
123 |
m_wndTBar_InputShow.GetItemRect(index, &rect1);
|
0ed438
|
124 |
rect1.left = 1;
|
Q |
125 |
rect1.top = 2;
|
|
126 |
rect1.right = rect1.left + 100;
|
|
127 |
rect1.bottom = rect1.top + 20;
|
b978bf
|
128 |
//*/
|
0ed438
|
129 |
/*
|
Q |
130 |
if (!m_InputShowEdit.Create(WS_CHILD | WS_VISIBLE | WS_BORDER, rect1, \
|
b978bf
|
131 |
&m_wndTBar_InputShow, ID_BUTTON_INPUT_SHOW))
|
0ed438
|
132 |
{
|
Q |
133 |
TRACE(_T("Failed to create CEdit\n"));
|
|
134 |
return FALSE;
|
|
135 |
}
|
b978bf
|
136 |
|
0ed438
|
137 |
if (!m_InputShowStatic.Create(_T("Test1"),WS_CHILD | WS_VISIBLE |WS_EX_CLIENTEDGE, rect1, \
|
b978bf
|
138 |
&m_wndTBar_InputShow, ID_BUTTON_INPUT_SHOW))
|
0ed438
|
139 |
{
|
Q |
140 |
TRACE(_T("Failed to create CStaticEx\n"));
|
|
141 |
return FALSE;
|
|
142 |
}
|
|
143 |
m_InputShowStatic.SetBkColor(RGB(255, 255, 255));
|
|
144 |
m_InputShowStatic.SetTextColor(RGB(255, 128, 128));
|
|
145 |
m_InputShowStatic.SetTextSize(20);
|
b978bf
|
146 |
//*/
|
0ed438
|
147 |
//m_InputShowEdit.SetReadOnly(true);
|
Q |
148 |
///*
|
b978bf
|
149 |
if (!m_wndTBar_Num_Key.CreateEx(this, TBSTYLE_FLAT,
|
0ed438
|
150 |
WS_CHILD | WS_VISIBLE | CBRS_BOTTOM | CBRS_FLOAT_MULTI | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
|
Q |
151 |
CRect(1,1,1,1),IDW_TOOL_BAR2) ||
|
b978bf
|
152 |
!m_wndTBar_Num_Key.LoadToolBar(IDR_TOOLBAR_NUM_KEY))
|
0ed438
|
153 |
{
|
b978bf
|
154 |
TRACE0("未能创建数字键工具栏\n");
|
0ed438
|
155 |
return -1; // 未能创建
|
Q |
156 |
}
|
|
157 |
//*/
|
|
158 |
|
|
159 |
///*
|
b978bf
|
160 |
if (!m_wndTBar_Edit_Key.CreateEx(this, TBSTYLE_FLAT,
|
0ed438
|
161 |
WS_CHILD | WS_VISIBLE | CBRS_BOTTOM | CBRS_FLOAT_MULTI | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
|
b978bf
|
162 |
CRect(1, 1, 1, 1), IDR_TOOLBAR_EDIT_KEY) ||
|
Q |
163 |
!m_wndTBar_Edit_Key.LoadToolBar(IDR_TOOLBAR_EDIT_KEY))
|
0ed438
|
164 |
{
|
b978bf
|
165 |
TRACE0("未能创建编辑键工具栏\n");
|
0ed438
|
166 |
return -1; // 未能创建
|
Q |
167 |
}
|
|
168 |
//*/
|
b978bf
|
169 |
/*
|
Q |
170 |
if (!m_wndToolBar_Func_Key.CreateEx(this, TBSTYLE_FLAT,
|
|
171 |
WS_CHILD | WS_VISIBLE | CBRS_BOTTOM | CBRS_FLOAT_MULTI | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
|
|
172 |
CRect(1, 1, 1, 1), IDW_TOOL_BAR_FUNC_KEY) ||
|
|
173 |
!m_wndToolBar_Func_Key.LoadToolBar(IDR_TOOLBAR_FUNC_KEY2))
|
|
174 |
{
|
|
175 |
TRACE0("未能创建功能键工具栏\n");
|
|
176 |
return -1; // 未能创建
|
|
177 |
}
|
|
178 |
//m_wndToolBar_Func_Key.SetTwoRowsWithSibling();
|
|
179 |
//*/
|
|
180 |
if (!m_wndDlgBar_InputShow.Create(this, IDD_DIALOGBAR_INPUT_SHOW, WS_CHILD | WS_VISIBLE | CBRS_BOTTOM | CBRS_FLOAT_MULTI | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
|
|
181 |
IDD_DIALOGBAR_INPUT_SHOW))
|
|
182 |
{
|
|
183 |
TRACE0("未能创建功能键2工具栏\n");
|
|
184 |
return -1; // 未能创建
|
|
185 |
}
|
|
186 |
|
|
187 |
///*
|
|
188 |
if (!m_wndDlgBar_Func_Key.Create(this, IDD_DIALOGBAR_FUNC_KEYS,WS_CHILD | WS_VISIBLE | CBRS_BOTTOM | CBRS_FLOAT_MULTI | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
|
|
189 |
IDD_DIALOGBAR_FUNC_KEYS))
|
|
190 |
{
|
|
191 |
TRACE0("未能创建功能键2工具栏\n");
|
|
192 |
return -1; // 未能创建
|
|
193 |
}
|
|
194 |
// ShowControlBar(&m_wndDlgBar_Func_Key, TRUE, TRUE);
|
|
195 |
// m_wndDlgBar_Func_Key.MoveWindow(100, 100, 200, 200);
|
|
196 |
//*/
|
0ed438
|
197 |
|
Q |
198 |
if (!m_wndStatusBar.Create(this))
|
|
199 |
{
|
|
200 |
TRACE0("未能创建状态栏\n");
|
|
201 |
return -1; // 未能创建
|
|
202 |
}
|
|
203 |
m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
|
|
204 |
m_wndStatusBar.SetPaneStyle(0, SBPS_STRETCH);
|
b978bf
|
205 |
/*
|
Q |
206 |
if (!m_wndMyPaneLog.Create(_T("日志窗口"), this->GetParent(), CRect(0, 0, 200, 200), TRUE, 1235, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
|
0ed438
|
207 |
| WS_CLIPCHILDREN | CBRS_RIGHT | CBRS_FLOAT_MULTI))
|
Q |
208 |
{
|
|
209 |
TRACE0("未能创建“MyPaneLog窗口\n");
|
|
210 |
return FALSE;
|
|
211 |
}
|
b978bf
|
212 |
// m_wndMyPaneLog.EnableDocking(CBRS_ALIGN_ANY);
|
0ed438
|
213 |
|
Q |
214 |
//*/
|
b978bf
|
215 |
m_dlgMyLog.Create(m_dlgMyLog.IDD, this);
|
Q |
216 |
// m_dlgMyLog.ModifyStyle(0, WS_POPUPWINDOW);
|
|
217 |
m_dlgMyLog.ShowWindow(SW_SHOW);
|
|
218 |
|
0ed438
|
219 |
// TODO: 如果不需要可停靠工具栏,则删除这三行
|
Q |
220 |
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
|
|
221 |
EnableDocking(CBRS_ALIGN_ANY);
|
b978bf
|
222 |
//DockPane(&m_wndToolBar);
|
Q |
223 |
DockControlBar(&m_wndToolBar);
|
0ed438
|
224 |
|
Q |
225 |
// EnableDocking(CBRS_ALIGN_ANY);
|
|
226 |
|
b978bf
|
227 |
|
Q |
228 |
|
65f713
|
229 |
// CDockablePane* pTabbedBar = nullptr;
|
Q |
230 |
// m_wndNavView.AttachToTabWnd(&m_wndFileView, DM_SHOW, TRUE, &pTabbedBar);
|
|
231 |
|
0ed438
|
232 |
|
Q |
233 |
///*
|
b978bf
|
234 |
m_wndDlgBar_InputShow.EnableDocking(CBRS_ALIGN_TOP | CBRS_ALIGN_BOTTOM);
|
Q |
235 |
m_wndTBar_Num_Key.EnableDocking(CBRS_ALIGN_ANY);
|
|
236 |
m_wndTBar_Edit_Key.EnableDocking(CBRS_ALIGN_ANY);
|
|
237 |
// m_wndToolBar_Func_Key.EnableDocking(CBRS_ALIGN_ANY);
|
|
238 |
m_wndDlgBar_Func_Key.EnableDocking(CBRS_ALIGN_TOP| CBRS_ALIGN_BOTTOM);
|
0ed438
|
239 |
|
Q |
240 |
EnableDocking(CBRS_ALIGN_ANY);
|
|
241 |
|
|
242 |
// DockPane(&m_wndToolBar);
|
|
243 |
|
b978bf
|
244 |
DockControlBar(&m_wndDlgBar_InputShow);
|
Q |
245 |
DockControlBar(&m_wndTBar_Num_Key);
|
|
246 |
DockControlBar(&m_wndTBar_Edit_Key);
|
|
247 |
// DockPane(&m_wndToolBar_Func_Key);
|
|
248 |
// DockPane(&m_wndDlgBar_Func_Key);
|
|
249 |
DockControlBar(&m_wndDlgBar_Func_Key);
|
|
250 |
// DockPane(&m_wndMyPaneLog);
|
|
251 |
|
|
252 |
|
0ed438
|
253 |
//*/
|
Q |
254 |
return 0;
|
|
255 |
}
|
|
256 |
|
|
257 |
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
|
|
258 |
{
|
b978bf
|
259 |
if( !CMDIFrameWnd::PreCreateWindow(cs) )
|
0ed438
|
260 |
return FALSE;
|
Q |
261 |
// TODO: 在此处通过修改
|
|
262 |
// CREATESTRUCT cs 来修改窗口类或样式
|
|
263 |
|
|
264 |
return TRUE;
|
|
265 |
}
|
|
266 |
|
|
267 |
// CMainFrame 诊断
|
|
268 |
|
|
269 |
#ifdef _DEBUG
|
|
270 |
void CMainFrame::AssertValid() const
|
|
271 |
{
|
b978bf
|
272 |
CMDIFrameWnd::AssertValid();
|
0ed438
|
273 |
}
|
Q |
274 |
|
|
275 |
void CMainFrame::Dump(CDumpContext& dc) const
|
|
276 |
{
|
b978bf
|
277 |
CMDIFrameWnd::Dump(dc);
|
0ed438
|
278 |
}
|
Q |
279 |
#endif //_DEBUG
|
|
280 |
|
|
281 |
|
|
282 |
// CMainFrame 消息处理程序
|
|
283 |
|
|
284 |
|
|
285 |
|
|
286 |
void CMainFrame::OnUploadFromPlc()
|
|
287 |
{
|
|
288 |
// TODO: 在此添加命令处理程序代码
|
b978bf
|
289 |
SysLog(_T("Upload from PLC, (From mainframe)"));
|
0ed438
|
290 |
CWinAppEx* pApp = &theApp;
|
b978bf
|
291 |
|
Q |
292 |
POSITION curTemplatePos = theApp.m_pDocManager->GetFirstDocTemplatePosition();
|
0ed438
|
293 |
if (curTemplatePos != NULL)
|
Q |
294 |
{
|
b978bf
|
295 |
CDocTemplate* curTemplate = theApp.m_pDocManager->GetNextDocTemplate(curTemplatePos);
|
Q |
296 |
CMTerm2Doc* pDoc = (CMTerm2Doc* ) curTemplate->OpenDocumentFile(NULL);
|
|
297 |
if (pDoc) pDoc->OnUploadFromPlc();
|
0ed438
|
298 |
}
|
Q |
299 |
|
|
300 |
}
|
|
301 |
|
|
302 |
void CMainFrame::OnMenuShowLog()
|
|
303 |
{
|
|
304 |
// TODO: 在此添加命令处理程序代码
|
|
305 |
m_wndMyPaneLog.ShowWindow(SW_SHOW);
|
b978bf
|
306 |
m_wndNavView.ShowWindow(SW_SHOW);
|
0ed438
|
307 |
}
|
Q |
308 |
|
|
309 |
|
|
310 |
void CMainFrame::OnViewFunckeyBar()
|
|
311 |
{
|
|
312 |
// TODO: 在此添加命令处理程序代码
|
b978bf
|
313 |
CString s1;
|
Q |
314 |
s1.Format(_T("显示功能键栏"));
|
|
315 |
SysLog(s1);
|
|
316 |
m_wndDlgBar_Func_Key.ShowWindow(SW_HIDE);
|
|
317 |
m_wndDlgBar_Func_Key.ShowWindow(SW_SHOW);
|
|
318 |
ShowControlBar(&m_wndDlgBar_Func_Key, TRUE, FALSE);
|
|
319 |
|
0ed438
|
320 |
}
|
Q |
321 |
|
|
322 |
|
|
323 |
void CMainFrame::OnUpdateViewFunckeyBar(CCmdUI *pCmdUI)
|
|
324 |
{
|
|
325 |
// TODO: 在此添加命令更新用户界面处理程序代码
|
b978bf
|
326 |
|
0ed438
|
327 |
}
|
Q |
328 |
|
|
329 |
|
|
330 |
void CMainFrame::OnViewInputBar()
|
|
331 |
{
|
|
332 |
// TODO: 在此添加命令处理程序代码
|
|
333 |
}
|
|
334 |
|
|
335 |
|
|
336 |
void CMainFrame::OnUpdateViewInputBar(CCmdUI *pCmdUI)
|
|
337 |
{
|
|
338 |
// TODO: 在此添加命令更新用户界面处理程序代码
|
|
339 |
}
|
|
340 |
|
|
341 |
|
|
342 |
void CMainFrame::OnViewNumkeyBar()
|
|
343 |
{
|
|
344 |
// TODO: 在此添加命令处理程序代码
|
b978bf
|
345 |
CString s1;
|
Q |
346 |
s1.Format(_T("显示数字键栏"));
|
|
347 |
SysLog(s1);
|
|
348 |
m_wndTBar_Num_Key.ShowWindow(SW_HIDE);
|
|
349 |
m_wndTBar_Num_Key.ShowWindow(SW_SHOW);
|
|
350 |
|
0ed438
|
351 |
}
|
Q |
352 |
|
|
353 |
|
|
354 |
void CMainFrame::OnUpdateViewNumkeyBar(CCmdUI *pCmdUI)
|
|
355 |
{
|
|
356 |
// TODO: 在此添加命令更新用户界面处理程序代码
|
|
357 |
}
|
|
358 |
|
|
359 |
|
|
360 |
void CMainFrame::OnViewInputsegBar()
|
|
361 |
{
|
|
362 |
// TODO: 在此添加命令处理程序代码
|
|
363 |
}
|
|
364 |
|
|
365 |
|
|
366 |
void CMainFrame::OnUpdateViewInputsegBar(CCmdUI *pCmdUI)
|
|
367 |
{
|
|
368 |
// TODO: 在此添加命令更新用户界面处理程序代码
|
|
369 |
}
|
|
370 |
|
|
371 |
|
|
372 |
void CMainFrame::OnViewCommentsBar()
|
|
373 |
{
|
|
374 |
// TODO: 在此添加命令处理程序代码
|
|
375 |
}
|
|
376 |
|
|
377 |
|
|
378 |
void CMainFrame::OnUpdateViewCommentsBar(CCmdUI *pCmdUI)
|
|
379 |
{
|
|
380 |
// TODO: 在此添加命令更新用户界面处理程序代码
|
|
381 |
}
|
|
382 |
/*
|
|
383 |
CView * FindView(CDocument * pDoc, CRuntimeClass * pClass)
|
|
384 |
{
|
|
385 |
CView* pView = NULL;
|
|
386 |
POSITION pos = pDoc->GetFirstViewPosition();
|
|
387 |
while (pos != NULL)
|
|
388 |
{
|
|
389 |
pView = pDoc->GetNextView(pos);
|
|
390 |
if (pView->IsKindOf(pClass))
|
|
391 |
break;
|
|
392 |
}
|
|
393 |
if (!pView->IsKindOf(pClass))
|
|
394 |
{
|
|
395 |
//AfxMessageBox("Connt Locate the View.");
|
|
396 |
return NULL;
|
|
397 |
}
|
|
398 |
return pView;
|
|
399 |
}
|
|
400 |
*/
|
|
401 |
|