// ---------------------------------------------------------------------------
// 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;
AppendSeparator() ;
}
-#if WXWIN_COMPATIBILITY
Callback(func);
-#endif
}
// The wxWindow destructor will take care of deleting the submenus.
{
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())
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)