X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/61f09f569358d7b2752733c4a24d1bd10daefae2..cc4d5638c66a409e421420ed7110917755a66788:/src/gtk1/menu.cpp?ds=sidebyside diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index b70a196e3e..16e1d9d203 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -2,7 +2,6 @@ // Name: src/gtk1/menu.cpp // Purpose: // Author: Robert Roebling -// Id: $Id$ // Copyright: (c) 1998 Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -25,6 +24,7 @@ #endif // wxUSE_ACCEL #include "wx/gtk1/private.h" +#include "wx/gtk1/private/mnemonics.h" #include @@ -174,8 +174,6 @@ static void gtk_menu_close_callback( GtkWidget *WXUNUSED(widget), wxMenuBar *men // wxMenuBar //----------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxMenuBar,wxWindow) - void wxMenuBar::Init(size_t n, wxMenu *menus[], const wxString titles[], long style) { // the parent window is known after wxFrame::SetMenu() @@ -432,7 +430,7 @@ wxMenu *wxMenuBar::Remove(size_t pos) static int FindMenuItemRecursive( const wxMenu *menu, const wxString &menuString, const wxString &itemString ) { - if (wxMenuItem::GetLabelText(wxConvertFromGTKToWXLabel(menu->GetTitle())) == wxMenuItem::GetLabelText(menuString)) + if (wxMenuItem::GetLabelText(menu->GetTitle()) == wxMenuItem::GetLabelText(menuString)) { int res = menu->FindItem( itemString ); if (res != wxNOT_FOUND) @@ -525,7 +523,7 @@ wxString wxMenuBar::GetMenuLabel( size_t pos ) const wxMenu* menu = node->GetData(); - return wxConvertFromGTKToWXLabel(menu->GetTitle()); + return menu->GetTitle(); } void wxMenuBar::SetMenuLabel( size_t pos, const wxString& label ) @@ -615,7 +613,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu ) // If it is attached then let the frame send the event. // Don't call frame->ProcessCommand(id) because it toggles // checkable items and we've already done that above. - wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id); + wxCommandEvent commandEvent(wxEVT_MENU, id); commandEvent.SetEventObject(frame); if (item->IsCheckable()) commandEvent.SetInt(item->IsChecked()); @@ -692,8 +690,6 @@ static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu ) // wxMenuItem //----------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject) - wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu, int id, const wxString& name, @@ -917,8 +913,6 @@ bool wxMenuItem::IsChecked() const // wxMenu //----------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler) - void wxMenu::Init() { m_accel = gtk_accel_group_new(); @@ -964,6 +958,11 @@ wxMenu::~wxMenu() } } +wxString wxMenu::GetTitle() const +{ + return wxConvertMnemonicsFromGTK(wxMenuBase::GetTitle()); +} + bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos) { GtkWidget *menuItem; @@ -976,7 +975,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos) // TODO menuItem = gtk_menu_item_new(); } - else if (mitem->GetBitmap().Ok()) + else if (mitem->GetBitmap().IsOk()) { text = mitem->wxMenuItemBase::GetItemLabel(); const wxBitmap *bitmap = &mitem->GetBitmap();