core/vgui/impl/win32/vgui_win32_cmdtarget.cxx
Go to the documentation of this file.
00001 // This is core/vgui/impl/win32/vgui_win32_cmdtarget.cxx
00002 
00003 #include "vgui_win32_cmdtarget.h"
00004 
00005 BOOL vgui_win32_cmdtarget::OnCmdMsg(UINT message, WPARAM wParam, LPARAM lParam)
00006 {
00007 #ifdef DEBUG
00008   vcl_cout << "vgui_win32_cmdtarget::OnCmdMsg()" << vcl_endl;
00009 #endif
00010 
00011   // Look through message map to see if it applies to us
00012   const AFX_MSGMAP* pMessageMap;
00013   const AFX_MSGMAP_ENTRY* lpEntry;
00014   for ( pMessageMap = GetMessageMap(); pMessageMap != NULL;
00015         pMessageMap = pMessageMap->pBaseMessageMap ) {
00016     lpEntry = pMessageMap->lpEntries;
00017     while ( lpEntry->nSig != AfxSig_end ) {
00018       if ( lpEntry->nMessage == message ) {
00019         (this->*lpEntry->pfn)();
00020         return TRUE;
00021       }
00022       lpEntry++;
00023     }
00024   }
00025 
00026   return FALSE;   // not handled
00027 }
00028 
00029 const AFX_MSGMAP* vgui_win32_cmdtarget::GetMessageMap() const
00030 {
00031     return &vgui_win32_cmdtarget::messageMap;
00032 }
00033 
00034 const AFX_MSGMAP vgui_win32_cmdtarget::messageMap =
00035 {
00036     NULL,
00037     &vgui_win32_cmdtarget::messageEntries_[0]
00038 };
00039 
00040 const AFX_MSGMAP_ENTRY vgui_win32_cmdtarget::messageEntries_[] =
00041 {
00042     { 0, 0, 0, 0, AfxSig_end, 0 }  // no entries
00043 };