An object used by an application wishing to create an accelerator table (see wx.AcceleratorTable).
See also
wx.AcceleratorTable, wx.Window.SetAcceleratorTable
Constructor. |
|
Parses the given string and sets the accelerator accordingly. |
|
Returns the command identifier for the accelerator table entry. |
|
Returns the flags for the accelerator table entry. |
|
Returns the keycode for the accelerator table entry. |
|
Returns the menu item associated with this accelerator entry. |
|
Returns |
|
Sets the accelerator entry parameters. |
|
Returns a textual representation of this accelerator which is appropriate for saving in configuration files. |
|
Returns a textual representation of this accelerator. |
|
See |
|
See |
|
See |
|
See |
wx.
AcceleratorEntry
(object)¶Possible constructors:
AcceleratorEntry(flags=0, keyCode=0, cmd=0, item=None)
AcceleratorEntry(entry)
An object used by an application wishing to create an accelerator table (see AcceleratorTable).
__init__
(self, *args, **kw)¶__init__ (self, flags=0, keyCode=0, cmd=0, item=None)
Constructor.
flags (int) – A combination of the wx.AcceleratorEntryFlags values, which indicates which modifier keys are held down.
keyCode (int) – The keycode to be detected. See wx.KeyCode for a full list of keycodes.
cmd (int) – The menu or control command identifier (ID
).
item (wx.MenuItem) – The menu item associated with this accelerator.
__init__ (self, entry)
Copy constructor.
entry (wx.AcceleratorEntry) –
FromString
(self, str)¶Parses the given string and sets the accelerator accordingly.
str (string) – This string may be either in the same format as returned by wx.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.
bool
True
if the given string correctly initialized this object (i.e. if IsOk
returns True
after this call)
GetCommand
(self)¶Returns the command identifier for the accelerator table entry.
int
GetFlags
(self)¶Returns the flags for the accelerator table entry.
int
GetKeyCode
(self)¶Returns the keycode for the accelerator table entry.
int
GetMenuItem
(self)¶Returns the menu item associated with this accelerator entry.
IsOk
(self)¶Returns True
if this object is correctly initialized.
bool
Set
(self, flags, keyCode, cmd, item=None)¶Sets the accelerator entry parameters.
flags (int) – A combination of the wx.AcceleratorEntryFlags values, which indicates which modifier keys are held down.
keyCode (int) – The keycode to be detected. See wx.KeyCode for a full list of keycodes.
cmd (int) – The menu or control command identifier (ID
).
item (wx.MenuItem) – The menu item associated with this accelerator.
ToRawString
(self)¶Returns a textual representation of this accelerator which is appropriate for saving in configuration files.
Unlike the string returned by wx.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 wx.FromString .
string
New in version 2.9.4.
ToString
(self)¶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.
string
__ne__
(self)¶entry (wx.AcceleratorEntry) –
__eq__
(self)¶entry (wx.AcceleratorEntry) –
Command
¶See GetCommand
KeyCode
¶See GetKeyCode
MenuItem
¶See GetMenuItem