X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..9e9574fe45b176ee74bba8fad7574cf9906145d1:/interface/wx/accel.h
diff --git a/interface/wx/accel.h b/interface/wx/accel.h
index 2be0bdded1..0444340d06 100644
--- a/interface/wx/accel.h
+++ b/interface/wx/accel.h
@@ -2,8 +2,7 @@
// Name: accel.h
// Purpose: interface of wxAccelerator* classes
// Author: wxWidgets team
-// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@@ -16,13 +15,16 @@ enum wxAcceleratorEntryFlags
/** hold Alt key down */
wxACCEL_ALT,
- /** hold Ctrl key down */
+ /** hold Ctrl key down, corresponds to Command key on OS X */
wxACCEL_CTRL,
/** hold Shift key down */
wxACCEL_SHIFT,
- /** Command key on OS X; identic to wxACCEL_CTRL on other platforms. */
+ /** corresponds to real Ctrl key on OS X, identic to @c wxACCEL_CTRL on other platforms */
+ wxACCEL_RAW_CTRL,
+
+ /** deprecated, identic to @c wxACCEL_CTRL on all platforms. */
wxACCEL_CMD
};
@@ -34,7 +36,7 @@ enum wxAcceleratorEntryFlags
(see wxAcceleratorTable).
@library{wxcore}
- @category{misc}
+ @category{data}
@see wxAcceleratorTable, wxWindow::SetAcceleratorTable
*/
@@ -45,10 +47,10 @@ public:
Constructor.
@param flags
- A combination of the wxAcceleratorEntryFlags values, which
+ A combination of the ::wxAcceleratorEntryFlags values, which
indicates which modifier keys are held down.
@param keyCode
- The keycode to be detected. See @ref page_keycodes for a full list of keycodes.
+ The keycode to be detected. See ::wxKeyCode for a full list of keycodes.
@param cmd
The menu or control command identifier (ID).
@param item
@@ -86,10 +88,10 @@ public:
Sets the accelerator entry parameters.
@param flags
- A combination of the wxAcceleratorEntryFlags values, which
+ A combination of the ::wxAcceleratorEntryFlags values, which
indicates which modifier keys are held down.
@param keyCode
- The keycode to be detected. See @ref page_keycodes for a full list of keycodes.
+ The keycode to be detected. See ::wxKeyCode for a full list of keycodes.
@param cmd
The menu or control command identifier (ID).
@param item
@@ -103,17 +105,40 @@ public:
bool IsOk() const;
/**
- Returns a wxString for this accelerator.
- This function formats it using the @c "flags-keycode" format
- where @c flags maybe a hyphen-separed list of @c "shift|alt|ctrl".
+ Returns a textual representation of this accelerator.
+
+ The returned string is of the form [Alt+][Ctrl+][RawCtrl+][Shift+]Key
+ where the modifier keys are present only if the corresponding flag is
+ set.
*/
wxString ToString() const;
+ /**
+ Returns a textual representation of this accelerator which is
+ appropriate for saving in configuration files.
+
+ Unlike the string returned by ToString(), this one is never translated
+ so, while it's not suitable for showing to the user, it can be used to
+ uniquely identify the accelerator independently of the user language.
+
+ The returned string can still be parsed by FromString().
+
+ @since 2.9.4
+ */
+ wxString ToRawString() const;
+
/**
Parses the given string and sets the accelerator accordingly.
@param str
- Should be a string in the form "flags-keycode"
+ This string may be either in the same format as returned by
+ ToString(), i.e. contain the accelerator itself only, or have the
+ format of a full menu item text with i.e. Label TAB
+ Accelerator
. In the latter case, the part of the string
+ before the TAB is ignored. Notice that the latter format is only
+ supported for the compatibility with the previous wxWidgets
+ versions and the new code should pass only the accelerator string
+ itself to this function.
@return @true if the given string correctly initialized this object
(i.e. if IsOk() returns true after this call)
@@ -156,7 +181,7 @@ public:
'OK'.
@library{wxcore}
- @category{misc}
+ @category{data}
@stdobjects
::wxNullAcceleratorTable
@@ -178,6 +203,13 @@ public:
Number of accelerator entries.
@param entries
The array of entries.
+
+ @beginWxPerlOnly
+ The wxPerl constructor accepts a list of either
+ Wx::AcceleratorEntry objects or references to 3-element arrays
+ [flags, keyCode, cmd] , like the parameters of
+ Wx::AcceleratorEntry::new.
+ @endWxPerlOnly
*/
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);