- Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathwindow.cpp
More file actions
Latest commit
94 lines (74 loc) · 2.47 KB
/
Copy pathwindow.cpp
File metadata and controls
94 lines (74 loc) · 2.47 KB
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
#include"winapi.h"
#include"passlparam.h"
usingnamespaceWinAPI;
boolWindow::Create( LPCTSTR lpszWindowName, const WindowClass& wndClass,
DWORD dwStyle, constRECT& rc, HWND hWndParent, HMENU hMenu,
DWORD dwExStyle, LPVOID lpParam, HINSTANCE hInstance )
{
PASSLPARAM pass = { lpParam, this, &hWnd };
GenericWindow::Create( lpszWindowName, wndClass, dwStyle, rc, hWndParent, hMenu, dwExStyle, reinterpret_cast<LPVOID>( &pass ), hInstance );
b_created = GenericWindow::IsCreated();
return b_created;
}
Window::~Window()
{
b_created = false;
if ( hWnd != NULL )
SetWindowLong( hWnd, GWL_USERDATA, 0 );
}
intWindow::HandleMessage( int uMsg, int wParam, int lParam )
{
returnstatic_cast<int>( DefWindowProc( hWnd, uMsg, wParam, lParam ) );
}
#ifndef PURE_WRAPPER
boolWindow::OnCreate( LPCREATESTRUCT lpCreateStruct )
{
returntrue;
}
voidWindow::OnClose()
{
DefWindowProc( hWnd, WM_CLOSE, 0, 0 );
}
voidWindow::OnDestroy()
{
}
voidWindow::OnCommand( int nIdentifier, int nNotifyCode, HWND hwndControl )
{
}
intWindow::OnNotify( int nIdentifier, LPNMHDR pnmh )
{
returnstatic_cast<int>( DefWindowProc( hWnd, WM_NOTIFY, nIdentifier, reinterpret_cast<LPARAM>( pnmh ) ) );
}
voidWindow::OnPaint()
{
DefWindowProc( hWnd, WM_PAINT, 0, 0 );
}
voidWindow::OnSize( int sizing, WSize new_size )
{
DefWindowProc( hWnd, WM_SIZE, sizing, MAKELPARAM( new_size.cx, new_size.cy ) );
}
voidWindow::OnMouseMove( WPoint point, int keys )
{
DefWindowProc( hWnd, WM_MOUSEMOVE, keys, MAKELPARAM( point.x, point.y ) );
}
voidWindow::OnMouseDown( WPoint point, int keys, int button )
{
DefWindowProc( hWnd, button==left_button ? WM_LBUTTONDOWN : (button==right_button ? WM_RBUTTONDOWN : WM_MBUTTONDOWN), keys, MAKELPARAM( point.x, point.y ) );
}
voidWindow::OnMouseUp( WPoint point, int keys, int button )
{
DefWindowProc( hWnd, button==left_button ? WM_LBUTTONUP : (button==right_button ? WM_RBUTTONUP : WM_MBUTTONUP), keys, MAKELPARAM( point.x, point.y ) );
}
voidWindow::OnMouseDblClk( WPoint point, int keys, int button )
{
DefWindowProc( hWnd, button==left_button ? WM_LBUTTONDOWN : (button==right_button ? WM_RBUTTONDOWN : WM_MBUTTONDOWN), keys, MAKELPARAM( point.x, point.y ) );
}
voidWindow::OnKeyDown( int key, int keyData )
{
DefWindowProc( hWnd, WM_KEYDOWN, key, keyData );
}
voidWindow::OnKeyUp( int key, int keyData )
{
DefWindowProc( hWnd, WM_KEYUP, key, keyData );
}
#endif