Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef vgui_win32_cmdtarget_h_
00016 #define vgui_win32_cmdtarget_h_
00017
00018 #include <windows.h>
00019
00020 struct AFX_MSGMAP_ENTRY;
00021
00022 struct AFX_MSGMAP
00023 {
00024 const AFX_MSGMAP* pBaseMessageMap;
00025 const AFX_MSGMAP_ENTRY* lpEntries;
00026 };
00027
00028 #define DECLARE_MESSAGE_MAP() \
00029 private: \
00030 static const AFX_MSGMAP_ENTRY messageEntries_[]; \
00031 protected: \
00032 static const AFX_MSGMAP messageMap; \
00033 virtual const AFX_MSGMAP* GetMessageMap() const;
00034
00035 #define BEGIN_MESSAGE_MAP(theClass, baseClass) \
00036 const AFX_MSGMAP* theClass::GetMessageMap() const \
00037 { return &theClass::messageMap; } \
00038 const AFX_MSGMAP theClass::messageMap = \
00039 { &(baseClass::messageMap), \
00040 (AFX_MSGMAP_ENTRY*) &(theClass::messageEntries_) }; \
00041 const AFX_MSGMAP_ENTRY theClass::messageEntries_[] = \
00042 {
00043
00044 #define END_MESSAGE_MAP() \
00045 { 0, 0, 0, 0, AfxSig_end, (AFX_PMSG)0 } \
00046 };
00047
00048 enum AfxSig
00049 {
00050 AfxSig_end = 0,
00051 AfxSig_vv,
00052 };
00053
00054 #define ON_COMMAND(id, memberFxn) \
00055 { WM_COMMAND, 0, (WORD)id, (WORD)id, AfxSig_vv, (AFX_PMSG)memberFxn },
00056 #define ON_WM_CREATE() \
00057 { WM_CREATE, 0, 0, 0, AfxSig_is, \
00058 (AFX_PMSG)(AFX_PMSGW)(int AFX_MSG_CALL CWnd::*)(LPCREATESTRUCT)OnCreate},
00059
00060 class vgui_win32_cmdtarget
00061 {
00062 public:
00063 vgui_win32_cmdtarget() {}
00064 ~vgui_win32_cmdtarget() {}
00065
00066
00067 virtual BOOL OnCmdMsg(UINT message, WPARAM wParam, LPARAM lParam);
00068
00069 DECLARE_MESSAGE_MAP()
00070 };
00071
00072 typedef void (vgui_win32_cmdtarget::*AFX_PMSG)(void);
00073
00074 struct AFX_MSGMAP_ENTRY
00075 {
00076 UINT nMessage;
00077 UINT nCode;
00078 UINT nID;
00079 UINT nLastID;
00080 UINT nSig;
00081 AFX_PMSG pfn;
00082 };
00083
00084 #endif // vgui_win32_cmdtarget_h_