-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathChildFrame.cpp
114 lines (89 loc) · 2.67 KB
/
ChildFrame.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// ChildFrame.cpp : implementation of the CChildFrame class
//
// $Id$
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "phreeqci2.h"
#include "ChildFrame.h"
#include "RichDocIn.h"
#include "MainFrame.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)
//{{AFX_MSG_MAP(CChildFrame)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChildFrame construction/destruction
CChildFrame::CChildFrame()
: m_workSpace(((CMainFrame*)AfxGetMainWnd())->m_wndWorkspaceBar)
{
// add member initialization code here
m_bFirstActivation = true;
}
CChildFrame::~CChildFrame()
{
}
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// 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;
// open maximized (requires Invalidate() in CView::OnInitialUpdate()
cs.style |= WS_MAXIMIZE;
return TRUE;
}
void CChildFrame::ActivateFrame(int nCmdShow)
{
// Modify this function to change how the frame is activated.
if (m_bFirstActivation)
{
nCmdShow = SW_SHOWMAXIMIZED;
m_bFirstActivation = false;
}
CMDIChildWnd::ActivateFrame(nCmdShow);
}
/////////////////////////////////////////////////////////////////////////////
// CChildFrame diagnostics
#ifdef _DEBUG
void CChildFrame::AssertValid() const
{
CMDIChildWnd::AssertValid();
}
void CChildFrame::Dump(CDumpContext& dc) const
{
CMDIChildWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CChildFrame message handlers
BOOL CChildFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
// If the workspace is active and (nCode == CN_COMMAND || nCode == CN_UPDATE_COMMAND_UI)
// let the workspace attempt to handle first
//
// Note: This is required in addition to CMainFrame::OnCmdMsg for WM_COMMAND
// see CMDIFrameWnd::OnCommand()
//
if (nCode == CN_COMMAND || nCode == CN_UPDATE_COMMAND_UI)
{
if (::IsChild(m_workSpace.m_hWnd, ::GetFocus()))
{
ASSERT(m_workSpace.IsVisible() || m_workSpace.IsFloating());
if (m_workSpace.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
{
return TRUE;
}
}
}
return CMDIChildWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}