X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ab46dc18ab5cee150a1cc7a52dae21a9bcae4043..6b3eb77aece0708b6c9dd0c58bd2b4408e4fac9d:/src/gtk/menu.cpp diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index b66fc7b9fb..6907fe1d68 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -109,8 +109,12 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title ) { #if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0) str << _T('_'); + } else + if (*pc == _T('/')) + { + str << _T('\\'); #endif - } + } else str << *pc; } @@ -483,6 +487,10 @@ void wxMenuItem::SetName( const wxString& str ) { #if (GTK_MINOR_VERSION > 0) m_text << _T('_'); + } else + if (*pc == _T('/')) + { + m_text << _T('\\'); #endif } else @@ -492,8 +500,11 @@ void wxMenuItem::SetName( const wxString& str ) /* only GTK 1.2 know about hot keys */ m_hotKey = _T(""); #if (GTK_MINOR_VERSION > 0) - pc++; - m_hotKey = pc; + if(*pc == _T('\t')) + { + pc++; + m_hotKey = pc; + } #endif if (m_menuItem) @@ -589,9 +600,23 @@ void wxMenu::AppendSeparator() wxMenuItem *mitem = new wxMenuItem(); mitem->SetId(ID_SEPARATOR); +#if (GTK_MINOR_VERSION > 0) + GtkItemFactoryEntry entry; + entry.path = "/sep"; + entry.callback = (GtkItemFactoryCallback) NULL; + entry.callback_action = 0; + entry.item_type = ""; + entry.accelerator = (gchar*) NULL; + + gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */ + + /* this will be wrong for more than one separator. do we care? */ + GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, "
/sep" ); +#else GtkWidget *menuItem = gtk_menu_item_new(); gtk_menu_append( GTK_MENU(m_menu), menuItem ); gtk_widget_show( menuItem ); +#endif mitem->SetMenuItem(menuItem); m_items.Append( mitem ); @@ -664,7 +689,6 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool wxString s = _T("
/"); for ( const wxChar *pc = text; *pc != _T('\0'); pc++ ) { - if (*pc == _T('\t')) break; if (*pc == _T('_')) pc++; /* skip it */ s << *pc; }