- // ChildFrm.cpp : implementation of the CChildFrame class
- //
- #include "stdafx.h"
- #include "MiniCAD.h"
- #include "MainFrm.h"
- #include "ChildFrm.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////
- // CChildFrame
- IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
- BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
- ON_WM_CREATE()
- ON_COMMAND_EX(ID_VIEW_MYCOMMANDBAR, OnBarCheck)
- ON_UPDATE_COMMAND_UI(ID_VIEW_MYCOMMANDBAR, OnUpdateControlBarMenu)
- //{{AFX_MSG_MAP(CChildFrame)
- ON_WM_GETMINMAXINFO()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CChildFrame construction/destruction
- CChildFrame::CChildFrame()
- {
- // TODO: add member initialization code here
- }
- CChildFrame::~CChildFrame()
- {
- }
- BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- if( !CMDIChildWnd::PreCreateWindow(cs) )
- return FALSE;
- cs.style = WS_CHILD | WS_VISIBLE | WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU
- | FWS_ADDTOTITLE | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_MAXIMIZE;
- cs.style &= ~FWS_ADDTOTITLE;//禁止自动显示标题功能
- return TRUE;
- }
- /////////////////////////////////////////////////////////////////////////////
- // CChildFrame diagnostics
- #ifdef _DEBUG
- void CChildFrame::AssertValid() const
- {
- CMDIChildWnd::AssertValid();
- }
- void CChildFrame::Dump(CDumpContext& dc) const
- {
- CMDIChildWnd::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CChildFrame message handlers
- int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Change the value of CG_ID_VIEW_MYCOMMANDBAR to an appropriate value: { // Initialize dialog bar m_MyCommandBar if (!m_MyCommandBar.Create(this, IDD_MYCOMMANDBAR, CBRS_BOTTOM | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_HIDE_INPLACE, ID_VIEW_MYCOMMANDBAR)) { TRACE0("Failed to create dialog bar m_MyCommandBarn"); return -1; // fail to create }
- }
- return 0;
- }
- void CChildFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
- {
- // TODO: Add your message handler code here and/or call default
- CMainFrame* pFrame = (CMainFrame*) AfxGetApp()->m_pMainWnd;
- POINT pt;
- //全屏显示时重新设置子框架最大化时的尺寸
- if (pFrame->GetFullScreenSize(this, pt))
- {
- lpMMI->ptMaxSize = pt;
- lpMMI->ptMaxTrackSize = pt;
- }
- else
- CMDIChildWnd::OnGetMinMaxInfo(lpMMI);
- }