-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChildFrm.h
88 lines (77 loc) · 2.48 KB
/
ChildFrm.h
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
// ChildFrm.h : interface of the CChildFrame class
//
/////////////////////////////////////////////////////////////////////////////
#pragma once
#include "usermsgs.h"
#define CHAIN_MDICLIENT_COMMANDS() \
if((uMsg == WM_COMMAND) && (this->m_hWndMDIClient != NULL)) \
::SendMessage(this->m_hWndMDIClient, uMsg, wParam, lParam);
enum ViewType
{
VIEW_SERVER,
VIEW_CHANNEL,
VIEW_PVT,
VIEW_NONE,
};
struct ViewData
{
CView* pView;
CString name;
ViewType type;
ViewData(CView* view, CString _name, ViewType _type)
{
pView = view;
name = _name;
type = _type;
}
ViewData()
{
pView = NULL;
type = VIEW_NONE;
}
};
class CMainFrame;
class CChildFrame : public CTabbedMDIChildWindowImpl<CChildFrame>
{
public:
DECLARE_FRAME_WND_CLASS(NULL, IDR_MDICHILD)
CChildFrame(CString name, ViewType type, CMainFrame& frame) :m_data(NULL, name, type), m_frame(frame)
{
//
}
CView m_view;
CFont m_font;
//
ViewData m_data;
CMainFrame& m_frame;
virtual void OnFinalMessage(HWND /*hWnd*/);
BEGIN_MSG_MAP(CChildFrame)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_FORWARDMSG, OnForwardMsg)
MESSAGE_HANDLER(WM_CLOSE, OnClose)
MESSAGE_HANDLER(WM_CHILDGETDATA, OnGetData)
NOTIFY_CODE_HANDLER(EN_LINK, OnEditLink)
MESSAGE_HANDLER(WM_MDIACTIVATE, OnMdiActivate)
NOTIFY_CODE_HANDLER(CTCN_SELCHANGE, OnTabSelChange)
CHAIN_CLIENT_COMMANDS()
CHAIN_MSG_MAP(CTabbedMDIChildWindowImpl<CChildFrame>)
END_MSG_MAP()
// Handler prototypes (uncomment arguments if needed):
// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
LRESULT OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
LRESULT OnForwardMsg(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
LRESULT OnGetData(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
{
return (LRESULT)&m_data;
}
LRESULT OnEditLink(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled);
LRESULT OnTabSelChange(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/);
LRESULT OnMdiActivate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
bHandled = FALSE;
return 0;
}
};