X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0ab6adfedf92aa4457821422e77c19b80f10bee..f23208caccf81b0b34c5c11b466c6bd64fdf0f9d:/src/msw/menu.cpp diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 845c67a0b4..783a2cd977 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -62,10 +62,8 @@ static const int idMenuTitle = -2; // macros // ---------------------------------------------------------------------------- -#if !USE_SHARED_LIBRARY - IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler) - IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler) -#endif +IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler) +IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxWindow) // ============================================================================ // implementation @@ -221,7 +219,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) // menu is just a normal string (passed in data parameter) flags |= MF_STRING; - pData = (char*)pItem->GetText().c_str(); + pData = (wxChar*)pItem->GetText().c_str(); } BOOL ok; @@ -432,12 +430,14 @@ bool wxMenu::ProcessCommand(wxCommandEvent & event) { bool processed = FALSE; +#if wxUSE_MENU_CALLBACK // Try a callback if (m_callback) { (void)(*(m_callback))(*this, event); processed = TRUE; } +#endif // wxUSE_MENU_CALLBACK // Try the menu's event handler if ( !processed && GetEventHandler()) @@ -530,7 +530,7 @@ wxMenuBar::~wxMenuBar() void wxMenuBar::Refresh() { - wxCHECK_RET( IsAttached(), wxT("can't refresh unatteched menubar") ); + wxCHECK_RET( IsAttached(), wxT("can't refresh unattached menubar") ); DrawMenuBar(GetHwndOf(m_menuBarFrame)); } @@ -632,22 +632,6 @@ wxString wxMenuBar::GetLabelTop(size_t pos) const return m_titles[pos]; } -int wxMenuBar::FindMenu(const wxString& title) -{ - wxString menuTitle = wxStripMenuCodes(title); - - size_t count = GetMenuCount(); - for ( size_t i = 0; i < count; i++ ) - { - wxString title = wxStripMenuCodes(m_titles[i]); - if ( menuTitle == title ) - return i; - } - - return wxNOT_FOUND; - -} - // --------------------------------------------------------------------------- // wxMenuBar construction // --------------------------------------------------------------------------- @@ -817,7 +801,7 @@ void wxMenuBar::RebuildAccelTable() void wxMenuBar::Attach(wxFrame *frame) { - wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") ); +// wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") ); m_menuBarFrame = frame;