0028225: MFC sample on OCAF uses old-style definition of a Handle-class
[occt.git] / samples / mfc / standard / 01_Geometry / src / ChildFrm.cpp
CommitLineData
7fd59977 1// ChildFrm.cpp : implementation of the CChildFrame class
2//
3
4#include "stdafx.h"
5#include "GeometryApp.h"
6
7#include "ChildFrm.h"
8
9/////////////////////////////////////////////////////////////////////////////
10// CChildFrame
11
12IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
13
14BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
5c1f974e 15 //{{AFX_MSG_MAP(CChildFrame)
16 ON_WM_CREATE()
17 //}}AFX_MSG_MAP
7fd59977 18END_MESSAGE_MAP()
19
20/////////////////////////////////////////////////////////////////////////////
21// CChildFrame construction/destruction
22
23CChildFrame::CChildFrame()
24{
5c1f974e 25 // TODO: add member initialization code here
26
7fd59977 27}
28
29CChildFrame::~CChildFrame()
30{
31}
32
33/////////////////////////////////////////////////////////////////////////////
34// CChildFrame diagnostics
35
36#ifdef _DEBUG
37void CChildFrame::AssertValid() const
38{
5c1f974e 39 CMDIChildWnd::AssertValid();
7fd59977 40}
41
42void CChildFrame::Dump(CDumpContext& dc) const
43{
5c1f974e 44 CMDIChildWnd::Dump(dc);
7fd59977 45}
46
47#endif //_DEBUG
48
49void CChildFrame::ActivateFrame(int nCmdShow)
50{
5c1f974e 51 // TODO: Add your specialized code here and/or call the base class
52
53 static BOOL first=true;
54 if(first){
55 first=false;
56 CMDIChildWnd::ActivateFrame(SW_SHOWMAXIMIZED);
57 return;
58 }
59 /*
60 POSITION pos=AfxGetApp()->GetFirstDocTemplatePosition();
61 CDocTemplate* DocT=AfxGetApp()->GetNextDocTemplate(pos);
62 POSITION p=DocT->GetFirstDocPosition();
63 DocT->GetNextDoc(p);
64 if(p==NULL)
65 nCmdShow = SW_SHOWMAXIMIZED;
66 */
67 CMDIChildWnd::ActivateFrame(nCmdShow);
7fd59977 68}
69
70int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
71{
5c1f974e 72 if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
73 return -1;
7fd59977 74
5c1f974e 75 if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_3dCHILDFRAME))
76 {
77 TRACE0("Failed to create toolbar\n");
78 return -1; // fail to create
79 }
7fd59977 80
5c1f974e 81 m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
82 m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
83 EnableDocking(CBRS_ALIGN_ANY);
84 DockControlBar(&m_wndToolBar);
85
86 return 0;
87}
7fd59977 88
89BOOL CChildFrame::DestroyWindow()
90{
5c1f974e 91 // TODO: Add your specialized code here and/or call the base class
92
93 return CMDIChildWnd::DestroyWindow();
7fd59977 94}