| | |
| | | IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWndEx)
|
| | |
|
| | | BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWndEx)
|
| | | ON_WM_CREATE()
|
| | | END_MESSAGE_MAP()
|
| | |
|
| | | static UINT indicators[] =
|
| | | {
|
| | | ID_INDICATOR_MACHINE_TYPE, // 状态行指示器
|
| | | ID_INDICATOR_PROGRAM_POS,
|
| | | ID_INDICATOR_CONNECTIVITY, |
| | | ID_INDICATOR_RUN_STATUS,
|
| | | ID_INDICATOR_MONITOR_STATUS,
|
| | | ID_INDICATOR_TARGET_ADDRESS,
|
| | | ID_INDICATOR_INFO_DISPLAY,
|
| | | };
|
| | |
|
| | | // CChildFrame 构造/析构
|
| | |
|
| | |
| | | // TODO: 在此处通过修改 CREATESTRUCT cs 来修改窗口类或样式
|
| | | if( !CMDIChildWndEx::PreCreateWindow(cs) )
|
| | | return FALSE;
|
| | |
|
| | | //修改窗口的类型为最大化样式
|
| | | // cs.style = cs.style | WS_MAXIMIZE | WS_VISIBLE;
|
| | | return TRUE;
|
| | | }
|
| | |
|
| | |
| | | #endif //_DEBUG
|
| | |
|
| | | // CChildFrame 消息处理程序
|
| | |
|
| | |
|
| | | int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
| | | {
|
| | | if (CMDIChildWndEx::OnCreate(lpCreateStruct) == -1)
|
| | | return -1;
|
| | |
|
| | | // TODO: 在此添加您专用的创建代码
|
| | | this->ModifyStyle(WS_SIZEBOX,0);
|
| | | ///*
|
| | | if (!m_wndStatusBar.Create(this , (WS_CHILD | WS_VISIBLE | CBRS_TOP), IDW_CHILD_STATUS_BAR))
|
| | | {
|
| | | TRACE0("未能创建状态栏\n");
|
| | | return -1; // 未能创建
|
| | | }
|
| | | m_wndStatusBar.SetIndicators(indicators, sizeof(indicators) / sizeof(UINT));
|
| | |
|
| | | //*/
|
| | | this->ModifyStyle(0,WS_SIZEBOX);
|
| | |
|
| | | /*
|
| | | if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators) / sizeof(UINT)))
|
| | | {
|
| | | TRACE0("未能创建状态栏\n");
|
| | | return -1; // 未能创建
|
| | | }
|
| | | */
|
| | | m_wndStatusBar.SetPaneInfo(0, 0, 0, 100);
|
| | | m_wndStatusBar.SetPaneInfo(1, 0, 0, 100);
|
| | | m_wndStatusBar.SetPaneInfo(2, 0, 0, 100);
|
| | | //
|
| | | // m_wndStatusBar.SetPaneText(0, _T("机型参数"), false);
|
| | | // m_wndStatusBar.SetPaneText(1, _T("程序位置/总数"), false);
|
| | | m_wndStatusBar.SetPaneInfo(6, 0, 0, 9999);
|
| | |
|
| | | // m_wndStatusBar.MoveWindow(0, 0, 1800, 28);
|
| | | // m_wndStatusBar.EnableDocking(CBRS_ALIGN_TOP);
|
| | | // EnableDocking(CBRS_ALIGN_ANY);
|
| | | // AdjustClientArea();
|
| | | // DockPane(&m_wndStatusBar);
|
| | |
|
| | | /*
|
| | | if (!m_wndToolBar_InfoShow.CreateEx(this, TBSTYLE_FLAT,
|
| | | WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
|
| | | CRect(1, 1, 1, 1), IDR_TOOLBAR_INFO_SHOW) ||
|
| | | !m_wndToolBar_InfoShow.LoadToolBar(IDR_TOOLBAR_INFO_SHOW))
|
| | | {
|
| | | TRACE0("未能创建数字工具栏\n");
|
| | | return -1; // 未能创建
|
| | | }
|
| | | CRect rect1;
|
| | | int index = m_wndToolBar_InfoShow.CommandToIndex(ID_BUTTON_INPUT_SHOW);
|
| | | index = 0;
|
| | | UINT nID, nStyle;
|
| | | int iImage;
|
| | | m_wndToolBar_InfoShow.GetButtonInfo(0, nID, nStyle, iImage);
|
| | | m_wndToolBar_InfoShow.SetButtonInfo(index, nID, TBBS_SEPARATOR, 100);
|
| | | m_wndToolBar_InfoShow.GetItemRect(0, &rect1);
|
| | | rect1.left = 1;
|
| | | rect1.top = 2;
|
| | | rect1.right = rect1.left + 100;
|
| | | rect1.bottom = rect1.top + 20;
|
| | | if (!m_StaticShowMachine.Create(_T("Test1"), WS_CHILD | WS_VISIBLE | WS_EX_CLIENTEDGE, rect1, \
|
| | | &m_wndToolBar_InfoShow, nID))
|
| | | {
|
| | | TRACE(_T("Failed to create CStaticEx\n"));
|
| | | return FALSE;
|
| | | }
|
| | | //*/
|
| | | // m_InputShowStatic.SetBkColor(RGB(255, 255, 255));
|
| | | // m_InputShowStatic.SetTextColor(RGB(255, 128, 128));
|
| | | // m_InputShowStatic.SetTextSize(20);
|
| | | //m_InputShowEdit.SetReadOnly(true);
|
| | |
|
| | | // m_wndToolBar_InfoShow.EnableDocking(CBRS_ALIGN_ANY);
|
| | | // this->RecalcLayout();
|
| | | // DockPane(&m_wndTBar_InputShow);
|
| | |
|
| | | return 0;
|
| | | }
|