1 // OCC_BaseChildFrame.cpp: implementation of the OCC_BaseChildFrame class.
3 //////////////////////////////////////////////////////////////////////
7 #include "OCC_BaseChildFrame.h"
9 #include <res\OCC_Resource.h>
11 /////////////////////////////////////////////////////////////////////////////
14 IMPLEMENT_DYNCREATE (OCC_BaseChildFrame, CMDIChildWnd)
16 BEGIN_MESSAGE_MAP(OCC_BaseChildFrame, CMDIChildWnd)
17 //{{AFX_MSG_MAP(OCC_BaseChildFrame)
22 /////////////////////////////////////////////////////////////////////////////
23 // OCC_BaseChildFrame construction/destruction
25 OCC_BaseChildFrame::OCC_BaseChildFrame()
29 OCC_BaseChildFrame::~OCC_BaseChildFrame()
33 BOOL OCC_BaseChildFrame::PreCreateWindow(CREATESTRUCT& cs)
35 // TODO: Modify the Window class or styles here by modifying
36 // the CREATESTRUCT cs
38 return CMDIChildWnd::PreCreateWindow(cs);
41 /////////////////////////////////////////////////////////////////////////////
42 // OCC_BaseChildFrame diagnostics
45 void OCC_BaseChildFrame::AssertValid() const
47 CMDIChildWnd::AssertValid();
50 void OCC_BaseChildFrame::Dump(CDumpContext& dc) const
52 CMDIChildWnd::Dump(dc);
57 /////////////////////////////////////////////////////////////////////////////
58 // OCC_BaseChildFrame message handlers
60 int OCC_BaseChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
62 if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
65 if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_CHILDFRAME))
67 TRACE0("Failed to create toolbar\n");
68 return -1; // fail to create
71 m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
72 m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
73 EnableDocking(CBRS_ALIGN_ANY);
74 DockControlBar(&m_wndToolBar);
80 void OCC_BaseChildFrame::ActivateFrame(int nCmdShow)
82 POSITION pos=AfxGetApp()->GetFirstDocTemplatePosition();
83 CDocTemplate* DocT=AfxGetApp()->GetNextDocTemplate(pos);
84 POSITION p=DocT->GetFirstDocPosition();
87 nCmdShow = SW_SHOWMAXIMIZED;
88 CMDIChildWnd::ActivateFrame(nCmdShow);