-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathChildView.cpp
86 lines (62 loc) · 1.54 KB
/
ChildView.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
// ChildView.cpp : implementation of the CChildView class
//
#include "stdafx.h"
#include "Daggerfall Cartographer.h"
#include "ChildView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CChildView
CChildView::CChildView()
{
}
CChildView::~CChildView()
{
}
BEGIN_MESSAGE_MAP(CChildView, CWnd)
ON_WM_PAINT()
ON_WM_SIZE()
ON_WM_LBUTTONDOWN()
ON_WM_KEYDOWN()
END_MESSAGE_MAP()
// CChildView message handlers
BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs)
{
if (!CWnd::PreCreateWindow(cs))
return FALSE;
cs.dwExStyle |= WS_EX_CLIENTEDGE;
cs.style &= ~WS_BORDER;
cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS,
::LoadCursor(NULL, IDC_ARROW), NULL/*reinterpret_cast<HBRUSH>(COLOR_WINDOW+1)*/, NULL);
return TRUE;
}
void CChildView::OnPaint()
{
CPaintDC dc(this); // device context for painting
CDFCartographerApp *pApp = (CDFCartographerApp*)::AfxGetApp();
if ( pApp ) {
pApp->PresentMediaView();
}
// Do not call CWnd::OnPaint() for painting messages
}
void CChildView::OnSize(UINT nType, int cx, int cy)
{
CWnd::OnSize(nType, cx, cy);
CDFCartographerApp *pApp = (CDFCartographerApp*)::AfxGetApp();
if ( pApp ) {
pApp->SizeMediaView( cx, cy );
}
}
void CChildView::OnLButtonDown(UINT nFlags, CPoint point)
{
SetFocus();
CWnd::OnLButtonDown(nFlags, point);
}
void CChildView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CDFCartographerApp *pApp = (CDFCartographerApp*)::AfxGetApp();
if ( pApp ) {
pApp->OnKeyDown( nChar, nRepCnt, nFlags );
}
CWnd::OnKeyDown(nChar, nRepCnt, nFlags);
}