// macros
// ----------------------------------------------------------------------------
-#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler)
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler)
-#endif
// ============================================================================
// implementation
// 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;
{
bool processed = FALSE;
-#if WXWIN_COMPATIBILITY
+#if wxUSE_MENU_CALLBACK
// Try a callback
if (m_callback)
{
(void)(*(m_callback))(*this, event);
processed = TRUE;
}
-#endif WXWIN_COMPATIBILITY
+#endif // wxUSE_MENU_CALLBACK
// Try the menu's event handler
if ( !processed && GetEventHandler())
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));
}
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
// ---------------------------------------------------------------------------
void wxMenuBar::Attach(wxFrame *frame)
{
- wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") );
+// wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") );
m_menuBarFrame = frame;
size_t count = GetMenuCount();
for ( size_t i = 0; !item && (i < count); i++ )
{
- item = m_menus[i]->FindItemForId(id, itemMenu);
+ item = m_menus[i]->FindItem(id, itemMenu);
}
return item;