X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b908d2244a4975ceda4e050744280bf07e9ff350..e8ac7bf221aec78b2a420660db711eed2e771670:/src/msw/menu.cpp?ds=sidebyside diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index fee40a5cee..87c892530b 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -78,11 +78,7 @@ static const int idMenuTitle = -2; // --------------------------------------------------------------------------- // Construct a menu with optional title (then use append) -void wxMenu::Init(const wxString& title -#ifdef WXWIN_COMPATIBILITY - , const wxFunction func -#endif - ) +void wxMenu::Init(const wxString& title, const wxFunction func ) { m_title = title; m_parent = NULL; @@ -102,9 +98,7 @@ void wxMenu::Init(const wxString& title AppendSeparator() ; } -#if WXWIN_COMPATIBILITY Callback(func); -#endif } // The wxWindow destructor will take care of deleting the submenus. @@ -537,14 +531,12 @@ bool wxMenu::ProcessCommand(wxCommandEvent & event) { bool processed = FALSE; -#if WXWIN_COMPATIBILITY // Try a callback if (m_callback) { (void)(*(m_callback))(*this, event); processed = TRUE; } -#endif // WXWIN_COMPATIBILITY // Try the menu's event handler if ( !processed && GetEventHandler()) @@ -786,7 +778,8 @@ bool wxMenuBar::IsEnabled(int id) const int flag = ::GetMenuState(GetHmenuOf(itemMenu), id, MF_BYCOMMAND) ; - return (flag & MF_ENABLED) != 0; + // don't "and" with MF_ENABLED because its value is 0 + return (flag & MF_DISABLED) == 0; } void wxMenuBar::SetLabel(int id, const wxString& label)