PageRenderTime 22ms CodeModel.GetById 15ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/3rd_party/wtl/AppWiz/Files/Templates/1033/ChildFrm.h

https://code.google.com/p/softart/
C Header | 90 lines | 69 code | 12 blank | 9 comment | 5 complexity | 97ee5ebe40f7826b51d6bd7663550570 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-3-Clause, JSON, MPL-2.0-no-copyleft-exception, GPL-2.0, GPL-3.0, LGPL-3.0, BSD-2-Clause
 1// [!output WTL_CHILD_FRAME_FILE].h : interface of the [!output WTL_CHILD_FRAME_CLASS] class
 2//
 3/////////////////////////////////////////////////////////////////////////////
 4
 5#pragma once
 6
 7class [!output WTL_CHILD_FRAME_CLASS] : public [!output WTL_CHILD_FRAME_BASE_CLASS]<[!output WTL_CHILD_FRAME_CLASS]>
 8{
 9public:
10	DECLARE_FRAME_WND_CLASS(NULL, IDR_MDICHILD)
11
12[!if WTL_USE_VIEW]
13	[!output WTL_VIEW_CLASS] m_view;
14
15[!endif]
16[!if WTL_VIEWTYPE_LISTBOX || WTL_VIEWTYPE_EDIT || WTL_VIEWTYPE_RICHEDIT]
17	CFont m_font;
18
19[!endif]
20[!if WTL_USE_CPP_FILES]
21	virtual void OnFinalMessage(HWND /*hWnd*/);
22[!else]
23	virtual void OnFinalMessage(HWND /*hWnd*/)
24	{
25		delete this;
26	}
27[!endif]
28
29	BEGIN_MSG_MAP([!output WTL_CHILD_FRAME_CLASS])
30[!if WTL_USE_VIEW]
31		MESSAGE_HANDLER(WM_CREATE, OnCreate)
32[!endif]
33		MESSAGE_HANDLER(WM_FORWARDMSG, OnForwardMsg)
34		CHAIN_MSG_MAP([!output WTL_CHILD_FRAME_BASE_CLASS]<[!output WTL_CHILD_FRAME_CLASS]>)
35	END_MSG_MAP()
36
37// Handler prototypes (uncomment arguments if needed):
38//	LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
39//	LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
40//	LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
41
42[!if WTL_USE_VIEW]
43[!if WTL_USE_CPP_FILES]
44	LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
45[!else]
46	LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
47	{
48[!if WTL_VIEWTYPE_FORM]
49		m_hWndClient = m_view.Create(m_hWnd);
50[!else]
51[!if WTL_VIEWTYPE_HTML]
52		//TODO: Replace with a URL of your choice
53		m_hWndClient = m_view.Create(m_hWnd, rcDefault, _T("http://www.microsoft.com"), [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]);
54[!else]
55		m_hWndClient = m_view.Create(m_hWnd, rcDefault, NULL, [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]);
56[!if WTL_VIEWTYPE_LISTBOX || WTL_VIEWTYPE_EDIT || WTL_VIEWTYPE_RICHEDIT]
57		m_font = AtlCreateControlFont();
58		m_view.SetFont(m_font);
59[!endif]
60[!if WTL_VIEWTYPE_SCROLL]
61		// replace with appropriate values for the app
62		m_view.SetScrollSize(2000, 1000);
63[!endif]
64[!endif]
65[!endif]
66
67		bHandled = FALSE;
68		return 1;
69	}
70
71[!endif]
72[!endif]
73[!if WTL_USE_CPP_FILES]
74	LRESULT OnForwardMsg(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
75[!else]
76	LRESULT OnForwardMsg(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
77	{
78		LPMSG pMsg = (LPMSG)lParam;
79
80[!if WTL_USE_VIEW]
81		if([!output WTL_CHILD_FRAME_BASE_CLASS]<[!output WTL_CHILD_FRAME_CLASS]>::PreTranslateMessage(pMsg))
82			return TRUE;
83
84		return m_view.PreTranslateMessage(pMsg);
85[!else]
86		return [!output WTL_CHILD_FRAME_BASE_CLASS]<[!output WTL_CHILD_FRAME_CLASS]>::PreTranslateMessage(pMsg);
87[!endif]
88	}
89[!endif]
90};