- wxDirDialog now presents the file system in standard Unix way
- wxButton now honours wxBU_EXACTFIT
- wxStaticBox now honours wxALIGN_XXX styles
+- added support for non alphanumeric simple character accelerators ('-', '=')
wxHTML:
else if ( current == _("shift") )
accelFlags |= wxACCEL_SHIFT;
else {
- wxLogDebug(wxT("Unknown accel modifier: '%s'"),
- current.c_str());
+ // we may have "Ctrl-+", for example, but we still want to
+ // catch typos like "Crtl-A" so only give the warning if we
+ // have something before the current '+' or '-', else take
+ // it as a literal symbol
+ if ( current.empty() )
+ {
+ current += label[n];
+
+ // skip clearing it below
+ continue;
+ }
+ else
+ {
+ wxLogDebug(wxT("Unknown accel modifier: '%s'"),
+ current.c_str());
+ }
}
- current.Empty();
+ current.clear();
}
else {
current += wxTolower(label[n]);
// ----------------------------------------------------------------------------
#if (GTK_MINOR_VERSION > 0) && wxUSE_ACCEL
+
static wxString GetHotKey( const wxMenuItem& item )
{
wxString hotkey;
hotkey << wxT('F') << code - WXK_F1 + 1;
break;
- // GTK seems to use XStringToKeySym here
+ // TODO: we should use gdk_keyval_name() (a.k.a.
+ // XKeysymToString) here as well as hardcoding the keysym
+ // names this might be not portable
case WXK_NUMPAD_INSERT:
hotkey << wxT("KP_Insert" );
break;
hotkey << wxT("Delete" );
break;
- // if there are any other keys wxGetAccelFromString() may return,
- // we should process them here
+ // if there are any other keys wxGetAccelFromString() may
+ // return, we should process them here
default:
- if ( wxIsalnum(code) )
+ if ( code < 127 )
{
- hotkey << (wxChar)code;
-
- break;
+ gchar *name = gdk_keyval_name((guint)code);
+ if ( name )
+ {
+ hotkey << name;
+ break;
+ }
}
wxFAIL_MSG( wxT("unknown keyboard accel") );
return hotkey;
}
+
#endif // wxUSE_ACCEL
// ----------------------------------------------------------------------------
#if (GTK_MINOR_VERSION > 0) && wxUSE_ACCEL
+
static wxString GetHotKey( const wxMenuItem& item )
{
wxString hotkey;
hotkey << wxT('F') << code - WXK_F1 + 1;
break;
- // GTK seems to use XStringToKeySym here
+ // TODO: we should use gdk_keyval_name() (a.k.a.
+ // XKeysymToString) here as well as hardcoding the keysym
+ // names this might be not portable
case WXK_NUMPAD_INSERT:
hotkey << wxT("KP_Insert" );
break;
hotkey << wxT("Delete" );
break;
- // if there are any other keys wxGetAccelFromString() may return,
- // we should process them here
+ // if there are any other keys wxGetAccelFromString() may
+ // return, we should process them here
default:
- if ( wxIsalnum(code) )
+ if ( code < 127 )
{
- hotkey << (wxChar)code;
-
- break;
+ gchar *name = gdk_keyval_name((guint)code);
+ if ( name )
+ {
+ hotkey << name;
+ break;
+ }
}
wxFAIL_MSG( wxT("unknown keyboard accel") );
return hotkey;
}
+
#endif // wxUSE_ACCEL