wxWindow *win = menu->GetInvokingWindow();
if (win)
- win->GetEventHandler()->ProcessEvent( event );
+ win->HandleWindowEvent( event );
}
extern "C" {
-static void gtk_menu_open_callback( GtkWidget *widget, wxMenu *menu )
+static void gtk_menu_open_callback( GtkWidget *WXUNUSED(widget), wxMenu *menu )
{
wxMenuEvent event(wxEVT_MENU_OPEN, -1, menu);
DoCommonMenuCallbackCode(menu, event);
}
-static void gtk_menu_close_callback( GtkWidget *widget, wxMenuBar *menubar )
+static void gtk_menu_close_callback( GtkWidget *WXUNUSED(widget), wxMenuBar *menubar )
{
if ( !menubar->GetMenuCount() )
{
commandEvent.SetInt(item->IsChecked());
commandEvent.SetEventObject(menu);
- frame->GetEventHandler()->ProcessEvent(commandEvent);
+ frame->HandleWindowEvent(commandEvent);
}
else
{
return;
wxWindow *win = menu->GetInvokingWindow();
- if (win) win->GetEventHandler()->ProcessEvent( event );
+ if (win) win->HandleWindowEvent( event );
}
}
wxWindow *win = menu->GetInvokingWindow();
if (win)
- win->GetEventHandler()->ProcessEvent( event );
+ win->HandleWindowEvent( event );
}
}
// don't delete menu items, the menus take care of that
}
-// return the menu item text without any menu accels
-/* static */
-wxString wxMenuItemBase::GetLabelText(const wxString& text)
-{
- // The argument to this function will now always be in wxWidgets standard label
- // format, not GTK+ format, so we do what the other ports do.
-
- return wxStripMenuCodes(text);
-
-#if 0
- wxString label;
-
- for ( const wxChar *pc = text.c_str(); *pc; pc++ )
- {
- if ( *pc == wxT('\t'))
- break;
-
- if ( *pc == wxT('_') )
- {
- // GTK 1.2 escapes "xxx_xxx" to "xxx__xxx"
- pc++;
- label += *pc;
- continue;
- }
-
- if ( (*pc == wxT('&')) && (*(pc+1) != wxT('&')) )
- {
- // wxMSW escapes "&"
- // "&" is doubled to indicate "&" instead of accelerator
- continue;
- }
-
- label += *pc;
- }
-
- // wxPrintf( wxT("GetLabelText(): text %s label %s\n"), text.c_str(), label.c_str() );
-
- return label;
-#endif
-}
-
wxString wxMenuItem::GetItemLabel() const
{
- return wxConvertFromGTKToWXLabel(m_text);
+ wxString label = wxConvertFromGTKToWXLabel(m_text);
+ if (!m_hotKey.IsEmpty())
+ label = label + wxT("\t") + m_hotKey;
+ return label;
}
void wxMenuItem::SetItemLabel( const wxString& string )
}
else if (mitem->GetBitmap().Ok())
{
- text = mitem->GetItemLabel();
+ text = mitem->wxMenuItemBase::GetItemLabel();
const wxBitmap *bitmap = &mitem->GetBitmap();
// TODO
else // a normal item
{
// text has "_" instead of "&" after mitem->SetItemLabel() so don't use it
- text = mitem->GetItemLabel() ;
+ text = mitem->wxMenuItemBase::GetItemLabel() ;
switch ( mitem->GetKind() )
{