0023776: Redesign of MFC samples after V2d viewer removing
[occt.git] / samples / mfc / standard / 01_Geometry / src / ChildFrm2d.cpp
CommitLineData
7fd59977 1// ChildFrm2D.cpp : implementation of the CChildFrame2D class/
2
3#include "stdafx.h"
7fd59977 4#include "ChildFrm2d.h"
7fd59977 5#include "GeometryApp.h"
6
7IMPLEMENT_DYNCREATE(CChildFrame2D, CMDIChildWnd)
8
9BEGIN_MESSAGE_MAP(CChildFrame2D, CMDIChildWnd)
5c1f974e 10 //{{AFX_MSG_MAP(CChildFrame2D)
11 ON_WM_CREATE()
12 //}}AFX_MSG_MAP
7fd59977 13END_MESSAGE_MAP()
14
15static UINT indicators[] =
16{
5c1f974e 17 ID_SEPARATOR, // status line indicator
18 ID_INDICATOR_CAPS,
19 ID_INDICATOR_NUM,
20 ID_INDICATOR_SCRL,
7fd59977 21};
22
23
24/////////////////////////////////////////////////////////////////////////////
25// CChildFrame2D construction/destruction
26
27CChildFrame2D::CChildFrame2D()
28{
5c1f974e 29 // TODO: add member initialization code here
30
7fd59977 31}
32
33CChildFrame2D::~CChildFrame2D()
34{
35}
36
37/////////////////////////////////////////////////////////////////////////////
38// CChildFrame2D diagnostics
39
40#ifdef _DEBUG
41void CChildFrame2D::AssertValid() const
42{
5c1f974e 43 CMDIChildWnd::AssertValid();
7fd59977 44}
45
46void CChildFrame2D::Dump(CDumpContext& dc) const
47{
5c1f974e 48 CMDIChildWnd::Dump(dc);
7fd59977 49}
50
51#endif //_DEBUG
52
53/////////////////////////////////////////////////////////////////////////////
54// CChildFrame2D message handlers
55
56int CChildFrame2D::OnCreate(LPCREATESTRUCT lpCreateStruct)
57{
5c1f974e 58
59 if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
60 return -1;
61
62 if (!m_wndToolBar.Create(this) ||
63 !m_wndToolBar.LoadToolBar(IDR_2dCHILDFRAME))
64 {
65 TRACE0("Failed to create toolbar\n");
66 return -1; // fail to create
67 }
68
69 // TODO: Remove this if you don't want tool tips or a resizeable toolbar
70 m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
71 CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
72
73 // TODO: Delete these three lines if you don't want the toolbar to
74 // be dockable
75 m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
76 EnableDocking(CBRS_ALIGN_ANY);
77 DockControlBar(&m_wndToolBar);
78
79 return 0;
7fd59977 80
81}
82
83
84void CChildFrame2D::ActivateFrame(int nCmdShow)
85{
5c1f974e 86 // TODO: Add your specialized code here and/or call the base class
87
88 CMDIChildWnd::ActivateFrame(nCmdShow);
7fd59977 89}