-//-----------------------------------------------------------------------------
-// idle system
-//-----------------------------------------------------------------------------
-
-static wxString wxReplaceUnderscore( const wxString& title )
-{
- // GTK 1.2 wants to have "_" instead of "&" for accelerators
- wxString str;
-
- for ( wxString::const_iterator pc = title.begin(); pc != title.end(); ++pc )
- {
- if ((*pc == wxT('&')) && (pc+1 != title.end()) && (*(pc+1) == wxT('&')))
- {
- // "&" is doubled to indicate "&" instead of accelerator
- ++pc;
- str << wxT('&');
- }
- else if (*pc == wxT('&'))
- {
- str << wxT('_');
- }
- else
- {
- if ( *pc == wxT('_') )
- {
- // underscores must be doubled to prevent them from being
- // interpreted as accelerator character prefix by GTK
- str << *pc;
- }
-
- str << *pc;
- }
- }
-
- // wxPrintf( wxT("before %s after %s\n"), title.c_str(), str.c_str() );
-
- return str;
-}
-
-static wxString wxConvertFromGTKToWXLabel(const wxString& gtkLabel)
-{
- wxString label;
- for ( const wxChar *pc = gtkLabel.c_str(); *pc; pc++ )
- {
- // '_' is the escape character for GTK+.
-
- if ( *pc == wxT('_') && *(pc+1) == wxT('_'))
- {
- // An underscore was escaped.
- label += wxT('_');
- pc++;
- }
- else if ( *pc == wxT('_') )
- {
- // Convert GTK+ hotkey symbol to wxWidgets/Windows standard
- label += wxT('&');
- }
- else if ( *pc == wxT('&') )
- {
- // Double the ampersand to escape it as far as wxWidgets is concerned
- label += wxT("&&");
- }
- else
- {
- // don't remove ampersands '&' since if we have them in the menu title
- // it means that they were doubled to indicate "&" instead of accelerator
- label += *pc;
- }
- }
-
- return label;
-}
-