Fix stock accelerators handling in wxOSX.

No modifiers were used for stock accelerators, i.e. Append(wxID_NEW) resulted
in an item with the label "New" and plain "N" as accelerator in wxOSX. This
was due to wxACCEL_CMD not being handled in wxAcceleratorEntry::ToString() so
map it to the same prefix as wxACCEL_CTRL there, this is enough to make the
accelerators work even though it's not clear whether this is really the best
thing to do or if we should use a separate "Cmd+" prefix for it (and recognize
it in Parse() too then) as otherwise it's unclear why do we have wxACCEL_CMD
at all, it just seems to be treated identically to wxACCEL_CTRL everywhere.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-07-30 21:54:05 +00:00
parent 75618d57e4
commit d641b2d2a0

View File

@@ -307,7 +307,7 @@ wxString wxAcceleratorEntry::ToString() const
int flags = GetFlags();
if ( flags & wxACCEL_ALT )
text += _("Alt+");
if ( flags & wxACCEL_CTRL )
if ( flags & (wxACCEL_CTRL | wxACCEL_CMD) )
text += _("Ctrl+");
if ( flags & wxACCEL_SHIFT )
text += _("Shift+");