X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..3abb199dee0afdeae31bac69186751a02a37611e:/src/common/menucmn.cpp diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index debd752214..eebcea9bf9 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: common/menucmn.cpp +// Name: src/common/menucmn.cpp // Purpose: wxMenu and wxMenuBar methods common to all ports // Author: Vadim Zeitlin // Modified by: @@ -40,8 +40,8 @@ #include "wx/listimpl.cpp" -WX_DEFINE_LIST(wxMenuList); -WX_DEFINE_LIST(wxMenuItemList); +WX_DEFINE_LIST(wxMenuList) +WX_DEFINE_LIST(wxMenuItemList) // ============================================================================ // implementation @@ -174,9 +174,9 @@ wxAcceleratorEntry *wxGetAccelFromString(const wxString& label) else if ( current == wxT("ENTER") || current == wxT("RETURN") ) keyCode = WXK_RETURN; else if ( current == wxT("PGUP") ) - keyCode = WXK_PRIOR; + keyCode = WXK_PAGEUP; else if ( current == wxT("PGDN") ) - keyCode = WXK_NEXT; + keyCode = WXK_PAGEDOWN; else if ( current == wxT("LEFT") ) keyCode = WXK_LEFT; else if ( current == wxT("RIGHT") ) @@ -189,7 +189,7 @@ wxAcceleratorEntry *wxGetAccelFromString(const wxString& label) keyCode = WXK_HOME; else if ( current == wxT("END") ) keyCode = WXK_END; - else if ( current == wxT("SPACE") ) + else if ( current == wxT("SPACE") || current == _("SPACE") ) keyCode = WXK_SPACE; else if ( current == wxT("TAB") ) keyCode = WXK_TAB; @@ -250,11 +250,11 @@ wxAcceleratorEntry *wxGetAccelFromString(const wxString& label) else if ( current == wxT("KP_DOWN") ) keyCode = WXK_NUMPAD_DOWN; else if ( current == wxT("KP_PRIOR") ) - keyCode = WXK_NUMPAD_PRIOR; + keyCode = WXK_NUMPAD_PAGEUP; else if ( current == wxT("KP_PAGEUP") ) keyCode = WXK_NUMPAD_PAGEUP; else if ( current == wxT("KP_NEXT;") ) - keyCode = WXK_NUMPAD_NEXT; + keyCode = WXK_NUMPAD_PAGEDOWN; else if ( current == wxT("KP_PAGEDOWN") ) keyCode = WXK_NUMPAD_PAGEDOWN; else if ( current == wxT("KP_END") ) @@ -1058,4 +1058,21 @@ wxString wxMenuBarBase::GetHelpString(int id) const return item->GetHelp(); } +void wxMenuBarBase::UpdateMenus( void ) +{ + wxEvtHandler* source; + wxMenu* menu; + int nCount = GetMenuCount(); + for (int n = 0; n < nCount; n++) + { + menu = GetMenu( n ); + if (menu != NULL) + { + source = menu->GetEventHandler(); + if (source != NULL) + menu->UpdateUI( source ); + } + } +} + #endif // wxUSE_MENUS