| | |
| | | #include "MTerm1TestView.h"
|
| | | #include "MTerm1ProgTxt.h"
|
| | | #include <windows.h>
|
| | | #include "MyChildFrm.h"
|
| | | #include "MyChildFrmConfig.h"
|
| | |
|
| | | #ifdef _DEBUG
|
| | | #define new DEBUG_NEW
|
| | |
| | | ON_COMMAND(ID_MENU_SHOW_LOG, &CMainFrame::OnMenuShowLog)
|
| | | ON_COMMAND(ID_MENU_SHOW_DEV, &CMainFrame::OnMenuShowDev)
|
| | | ON_COMMAND(ID_MENU_SHOWNAV, &CMainFrame::OnMenuShownav)
|
| | | ON_COMMAND(ID_COMMTEST, &CMainFrame::OnCommtest)
|
| | | ON_COMMAND(ID_DEVICE_CONFIG, &CMainFrame::OnDeviceConfig)
|
| | |
|
| | | END_MESSAGE_MAP()
|
| | |
|
| | | static UINT indicators[] =
|
| | |
| | | // m_dlgMyLog.ShowWindow(SW_SHOW);
|
| | |
|
| | | // BOOL bNameValid;
|
| | |
|
| | | CMainFrame::EnableLoadDockState(FALSE);
|
| | | // 创建类视图
|
| | | CString strNavView;
|
| | | // bNameValid = strNavView.LoadString(IDS_CLASS_VIEW);
|
| | |
| | | // DockControlBar(&m_wndToolBar);
|
| | |
|
| | | // EnableDocking(CBRS_ALIGN_ANY);
|
| | | m_wndNavView.SetMinSize(CSize(300, 300));
|
| | | DockPane(&m_wndNavView);
|
| | |
|
| | | CDockablePane* pTabbedBar = nullptr;
|
| | | // m_wndMyPaneLog.AttachToTabWnd(&m_wndNavView, DM_SHOW, TRUE,&pTabbedBar);
|
| | |
|
| | |
|
| | | // m_wndNavView.AttachToTabWnd(&m_wndMyPaneLog, DM_SHOW, TRUE, &pTabbedBar);
|
| | | m_wndMyPaneLog.SetMinSize(CSize(300, 300));
|
| | | m_wndMyPaneLog.DockToWindow(&m_wndNavView, CBRS_BOTTOM);
|
| | | // DockPane(&m_wndMyPaneLog);
|
| | | // CDockablePane* pTabbedBar = nullptr;
|
| | | // m_wndNavView.AttachToTabWnd(&m_wndFileView, DM_SHOW, TRUE, &pTabbedBar);
|
| | |
|
| | |
| | | // DockPane(&m_wndDlgBar_Func_Key);
|
| | | // DockControlBar(&m_wndDlgBar_Func_Key);
|
| | | DockPane(&m_wndMyPaneInputShow);
|
| | | DockPane(&m_wndNavView);
|
| | | DockPane(&m_wndMyPaneLog);
|
| | |
|
| | | m_wndNavView.SetMinSize(CSize(0, 0));
|
| | | m_wndMyPaneLog.SetMinSize(CSize(0, 0));
|
| | | // DockPane(pTabbedBar);
|
| | | // m_wndMyPaneInputShow.m_pMyFormInputShow->SetBtnDisplayESC(1);
|
| | |
|
| | | //*/
|
| | |
| | | // TODO: 在此添加命令处理程序代码
|
| | | m_wndNavView.ShowWindow(SW_SHOW);
|
| | | }
|
| | |
|
| | |
|
| | | BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
|
| | | {
|
| | | // TODO: 在此添加专用代码和/或调用基类
|
| | | UINT nCode = pMsg->wParam;
|
| | | if (pMsg->message == WM_KEYDOWN)
|
| | | {
|
| | | if ((nCode == _T('A') || nCode == _T('C') || nCode == _T('X') || nCode == _T('V')|| nCode == _T('Z') || nCode == _T('Y'))
|
| | | && (::GetKeyState(VK_CONTROL) & 0x8000))
|
| | | {
|
| | | ::TranslateMessage(pMsg);
|
| | | ::DispatchMessage(pMsg);
|
| | | return TRUE;
|
| | | }
|
| | | }
|
| | |
|
| | | return CMDIFrameWndEx::PreTranslateMessage(pMsg);
|
| | | }
|
| | |
|
| | |
|
| | | void CMainFrame::OnCommtest()
|
| | | {
|
| | | // TODO: 在此添加命令处理程序代码
|
| | | // this->LockWindowUpdate();
|
| | | if (m_pCommDevView == nullptr) {
|
| | | /*
|
| | | CRect rectWndClient;
|
| | | GetClientRect(&rectWndClient);
|
| | | rectWndClient.left = 200;
|
| | | rectWndClient.right = 500;
|
| | | rectWndClient.top = 200;
|
| | | rectWndClient.bottom = 500;
|
| | | CFrameWnd* pFrameWnd = new CFrameWnd();
|
| | | pFrameWnd->Create(_T("333"), _T("444"), WS_VISIBLE, rectWndClient, this);
|
| | |
|
| | | CRuntimeClass* pViewRuntimeClass = RUNTIME_CLASS(CMTerm1CommDevView);
|
| | | m_pCommDevView = (CMTerm1CommDevView*)pViewRuntimeClass->CreateObject();
|
| | | m_pCommDevView->Create(_T("1111"), _T("2222"), WS_VISIBLE | WS_CHILD | WS_MAXIMIZE, rectWndClient, pFrameWnd, 123, NULL);
|
| | | m_pCommDevView->OnInitialUpdate();
|
| | | // */
|
| | |
|
| | |
|
| | | CMDIChildWnd * pChildWnd = this->CreateNewChild(RUNTIME_CLASS(CMyChildFrame), IDR_MTerm1TYPE);
|
| | |
|
| | | /*
|
| | | CCreateContext cx;
|
| | | cx.m_pCurrentFrame = this;
|
| | | cx.m_pNewViewClass = RUNTIME_CLASS(CMTerm1CommDevView);
|
| | | cx.m_pCurrentDoc = NULL;
|
| | | cx.m_pLastView = NULL;
|
| | | cx.m_pNewDocTemplate = NULL;
|
| | | |
| | |
|
| | | m_pCommDevView = DYNAMIC_DOWNCAST(CMTerm1CommDevView, pChildWnd->CreateView(&cx, 23456));
|
| | | if (!m_pCommDevView) {
|
| | |
|
| | | }
|
| | | else {
|
| | | RecalcLayout();
|
| | | m_pCommDevView->ShowWindow(SW_SHOW);
|
| | | m_pCommDevView->UpdateWindow();
|
| | | }
|
| | | */
|
| | | // pChildWnd->LoadFrame(IDD_MTerm1CommDevView2, WS_VISIBLE | WS_CHILD, this,&cx);
|
| | | // pChildWnd->CreateView(&cx, 23456);
|
| | |
|
| | | }
|
| | |
|
| | | // this->UnlockWindowUpdate();
|
| | | }
|
| | |
|
| | | void CMainFrame::OnDeviceConfig()
|
| | | {
|
| | | // TODO: 在此添加命令处理程序代码
|
| | | // this->LockWindowUpdate();
|
| | | if (m_pConfigToolView == nullptr) {
|
| | |
|
| | | CMDIChildWnd* pChildWnd = this->CreateNewChild(RUNTIME_CLASS(CMyChildFrameConfig), IDR_MTerm1TYPE);
|
| | | }
|
| | |
|
| | | // this->UnlockWindowUpdate();
|
| | | }
|