-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSPLITFRM.CPP
65 lines (54 loc) · 1.76 KB
/
SPLITFRM.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
// splitfra.cpp : implementation file
//
// Copyright (C) 1992-1993 George Mills and Softronics, Inc. Corporation
// All rights reserved.
//
#include "stdafx.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSplitFrame
IMPLEMENT_DYNCREATE(CSplitFrame, CMDIChildWnd)
CSplitFrame::CSplitFrame()
{
}
CSplitFrame::~CSplitFrame()
{
}
BOOL CSplitFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
{
m_haccel = LoadAccelerators(AfxGetInstanceHandle() ,MAKEINTRESOURCE(IDR_LOGICLTYPE_CNTR_IP));
return m_wndSplitter.Create(this,
2, 2, // TODO: adjust the number of rows, columns
CSize(10, 10), // TODO: adjust the minimum pane size
pContext);
}
BEGIN_MESSAGE_MAP(CSplitFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CSplitFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
ON_WM_SYSCOMMAND()
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSplitFrame message handlers
void CSplitFrame::OnSysCommand(UINT nID, LPARAM lParam)
{
if ( ( nID & 0x0FFF0 ) != SC_CLOSE )
{
//Pass through any messages other than SC_CLOSE
CMDIChildWnd::OnSysCommand( nID, lParam );
} else
{
//
CMDIFrameWnd *pFrame =
(CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
// Get the active MDI child window.
CMDIChildWnd *pChild =
(CMDIChildWnd *) pFrame->GetActiveFrame();
// Send ID_FILE_CLOSE to the active MDI child window where CLogiDoc::OnFileClose
// will set m_bCloseNotExit=TRUE and let CDocument::OnFileClose take over.
pChild->SendMessage(WM_COMMAND,ID_FILE_CLOSE);
}
}