From 68bc148cac0232c0f0aed3ab2f27dfe074869e45 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 11 Aug 2007 18:39:49 +0000 Subject: [PATCH 1/1] Compile fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48025 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/menu.h | 13 ------------- samples/menu/menu.cpp | 3 ++- src/common/menucmn.cpp | 16 +++++++++++++++- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/include/wx/menu.h b/include/wx/menu.h index 0de4fb3eef..c222caa135 100644 --- a/include/wx/menu.h +++ b/include/wx/menu.h @@ -512,19 +512,6 @@ protected: DECLARE_NO_COPY_CLASS(wxMenuBarBase) }; -#if WXWIN_COMPATIBILITY_2_8 -// get or change the label of the menu at given position -void wxMenuBarBase::SetLabelTop(size_t pos, const wxString& label) -{ - SetMenuLabel(pos, label); -} - -wxString wxMenuBarBase::GetLabelTop(size_t pos) const -{ - return GetMenuLabel(pos); -} -#endif - // ---------------------------------------------------------------------------- // include the real class declaration // ---------------------------------------------------------------------------- diff --git a/samples/menu/menu.cpp b/samples/menu/menu.cpp index a9f4b67837..b3d2bf27be 100644 --- a/samples/menu/menu.cpp +++ b/samples/menu/menu.cpp @@ -858,8 +858,9 @@ void MyFrame::OnGetLabelMenuItem(wxCommandEvent& WXUNUSED(event)) if ( item ) { + wxString label = item->GetItemLabel(); wxLogMessage(_T("The label of the last menu item is '%s'"), - item->GetLabel().c_str()); + label.c_str()); } } diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 0c85d548ba..fa0bfec3d7 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -307,7 +307,7 @@ int wxMenuBase::FindItem(const wxString& text) const // name just like the ordinary items if ( !item->IsSeparator() ) { - if ( item->GetLabel() == label ) + if ( item->GetItemLabelText() == label ) return item->GetId(); } } @@ -839,4 +839,18 @@ void wxMenuBarBase::UpdateMenus( void ) } } +#if WXWIN_COMPATIBILITY_2_8 +// get or change the label of the menu at given position +void wxMenuBarBase::SetLabelTop(size_t pos, const wxString& label) +{ + SetMenuLabel(pos, label); +} + +wxString wxMenuBarBase::GetLabelTop(size_t pos) const +{ + return GetMenuLabel(pos); +} +#endif + + #endif // wxUSE_MENUS -- 2.47.2