// Name: src/gtk1/menu.cpp
// Purpose:
// Author: Robert Roebling
-// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#endif // wxUSE_ACCEL
#include "wx/gtk1/private.h"
+#include "wx/gtk1/private/mnemonics.h"
#include <gdk/gdkkeysyms.h>
// 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()
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)
wxMenu* menu = node->GetData();
- return wxConvertFromGTKToWXLabel(menu->GetTitle());
+ return menu->GetTitle();
}
void wxMenuBar::SetMenuLabel( size_t pos, const wxString& label )
// 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());
// wxMenuItem
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
-
wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu,
int id,
const wxString& name,
// wxMenu
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
-
void wxMenu::Init()
{
m_accel = gtk_accel_group_new();
}
}
+wxString wxMenu::GetTitle() const
+{
+ return wxConvertMnemonicsFromGTK(wxMenuBase::GetTitle());
+}
+
bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos)
{
GtkWidget *menuItem;
// 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();