1 // MainFrm.cpp : implementation of the CMainFrame class
8 #include "OCCDemoDoc.h"
13 static char THIS_FILE[] = __FILE__;
16 /////////////////////////////////////////////////////////////////////////////
19 IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
21 BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
22 //{{AFX_MSG_MAP(CMainFrame)
23 // NOTE - the ClassWizard will add and remove mapping macros here.
24 // DO NOT EDIT what you see in these blocks of generated code !
29 static UINT indicators[] =
31 ID_SEPARATOR // status line indicator
34 /////////////////////////////////////////////////////////////////////////////
35 // CMainFrame construction/destruction
37 CMainFrame::CMainFrame()
39 // TODO: add member initialization code here
43 CMainFrame::~CMainFrame()
47 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
49 if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
52 if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
53 /* | CBRS_GRIPPER */| CBRS_TOOLTIPS | CBRS_FLYBY) ||
54 !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
56 TRACE0("Failed to create toolbar\n");
57 return -1; // fail to create
60 if (!m_wndToolBar1.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
61 | CBRS_TOOLTIPS | CBRS_FLYBY) ||
62 !m_wndToolBar1.LoadToolBar(IDR_TOOLBAR1))
64 TRACE0("Failed to create toolbar\n");
65 return -1; // fail to create
68 if (!m_wndStatusBar.Create(this) ||
69 !m_wndStatusBar.SetIndicators(indicators,
70 sizeof(indicators)/sizeof(UINT)))
72 TRACE0("Failed to create status bar\n");
73 return -1; // fail to create
76 // TODO: Delete these three lines if you don't want the toolbar to
78 //m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
79 //EnableDocking(CBRS_ALIGN_ANY);
80 //DockControlBar(&m_wndToolBar);
84 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
86 if( !CFrameWnd::PreCreateWindow(cs) )
88 // TODO: Modify the Window class or styles here by modifying
89 // the CREATESTRUCT cs
94 /////////////////////////////////////////////////////////////////////////////
95 // CMainFrame diagnostics
98 void CMainFrame::AssertValid() const
100 CFrameWnd::AssertValid();
103 void CMainFrame::Dump(CDumpContext& dc) const
110 /////////////////////////////////////////////////////////////////////////////
111 // CMainFrame message handlers