Correct form of mnemonics returned by wxGTK wxMenu::GetTitle().
wxMenu::GetTitle() returned a string in GTK+ format (i.e. using underscores instead of ampersands) instead of the expected wx one. This is, of course, the right thing to do and it also fixes wxMenuBar::FindMenuItem() as a side effect. Closes #12672. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -333,7 +333,7 @@ wxMenu *wxMenuBar::Remove(size_t pos)
|
||||
|
||||
static int FindMenuItemRecursive( const wxMenu *menu, const wxString &menuString, const wxString &itemString )
|
||||
{
|
||||
if (wxMenuItem::GetLabelText(wxConvertMnemonicsFromGTK(menu->GetTitle())) == wxMenuItem::GetLabelText(menuString))
|
||||
if (wxMenuItem::GetLabelText(menu->GetTitle()) == wxMenuItem::GetLabelText(menuString))
|
||||
{
|
||||
int res = menu->FindItem( itemString );
|
||||
if (res != wxNOT_FOUND)
|
||||
@@ -426,7 +426,7 @@ wxString wxMenuBar::GetMenuLabel( size_t pos ) const
|
||||
|
||||
wxMenu* menu = node->GetData();
|
||||
|
||||
return wxConvertMnemonicsFromGTK(menu->GetTitle());
|
||||
return menu->GetTitle();
|
||||
}
|
||||
|
||||
void wxMenuBar::SetMenuLabel( size_t pos, const wxString& label )
|
||||
@@ -747,6 +747,11 @@ wxLayoutDirection wxMenu::GetLayoutDirection() const
|
||||
return wxWindow::GTKGetLayout(m_owner);
|
||||
}
|
||||
|
||||
const wxString wxMenu::GetTitle() const
|
||||
{
|
||||
return wxConvertMnemonicsFromGTK(wxMenuBase::GetTitle());
|
||||
}
|
||||
|
||||
bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos)
|
||||
{
|
||||
GtkWidget *menuItem;
|
||||
|
||||
Reference in New Issue
Block a user