.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2020 by Total Control Software License: wxWindows License .. include:: headings.inc .. _wx.AcceleratorEntry: ========================================================================================================================================== |phoenix_title| **wx.AcceleratorEntry** ========================================================================================================================================== An object used by an application wishing to create an accelerator table (see :ref:`wx.AcceleratorTable`). .. seealso:: :ref:`wx.AcceleratorTable`, :meth:`wx.Window.SetAcceleratorTable` | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class AcceleratorEntry:
| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.AcceleratorEntry.__init__` Constructor. :meth:`~wx.AcceleratorEntry.FromString` Parses the given string and sets the accelerator accordingly. :meth:`~wx.AcceleratorEntry.GetCommand` Returns the command identifier for the accelerator table entry. :meth:`~wx.AcceleratorEntry.GetFlags` Returns the flags for the accelerator table entry. :meth:`~wx.AcceleratorEntry.GetKeyCode` Returns the keycode for the accelerator table entry. :meth:`~wx.AcceleratorEntry.GetMenuItem` Returns the menu item associated with this accelerator entry. :meth:`~wx.AcceleratorEntry.IsOk` Returns ``True`` if this object is correctly initialized. :meth:`~wx.AcceleratorEntry.Set` Sets the accelerator entry parameters. :meth:`~wx.AcceleratorEntry.ToRawString` Returns a textual representation of this accelerator which is appropriate for saving in configuration files. :meth:`~wx.AcceleratorEntry.ToString` Returns a textual representation of this accelerator. :meth:`~wx.AcceleratorEntry.__ne__` :meth:`~wx.AcceleratorEntry.__eq__` ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.AcceleratorEntry.Command` See :meth:`~wx.AcceleratorEntry.GetCommand` :attr:`~wx.AcceleratorEntry.Flags` See :meth:`~wx.AcceleratorEntry.GetFlags` :attr:`~wx.AcceleratorEntry.KeyCode` See :meth:`~wx.AcceleratorEntry.GetKeyCode` :attr:`~wx.AcceleratorEntry.MenuItem` See :meth:`~wx.AcceleratorEntry.GetMenuItem` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: 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). .. method:: __init__(self, *args, **kw) |overload| Overloaded Implementations: :html:`

` **__init__** `(self, flags=0, keyCode=0, cmd=0, item=None)` Constructor. :param `flags`: A combination of the :ref:`wx.AcceleratorEntryFlags` values, which indicates which modifier keys are held down. :type `flags`: int :param `keyCode`: The keycode to be detected. See :ref:`wx.KeyCode` for a full list of keycodes. :type `keyCode`: int :param `cmd`: The menu or control command identifier (``ID``). :type `cmd`: int :param `item`: The menu item associated with this accelerator. :type `item`: wx.MenuItem :html:`

` **__init__** `(self, entry)` Copy constructor. :param `entry`: :type `entry`: wx.AcceleratorEntry :html:`

` .. method:: FromString(self, str) Parses the given string and sets the accelerator accordingly. :param `str`: 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. :type `str`: string :rtype: `bool` :returns: ``True`` if the given string correctly initialized this object (i.e. if :meth:`IsOk` returns ``True`` after this call) .. method:: GetCommand(self) Returns the command identifier for the accelerator table entry. :rtype: `int` .. method:: GetFlags(self) Returns the flags for the accelerator table entry. :rtype: `int` .. method:: GetKeyCode(self) Returns the keycode for the accelerator table entry. :rtype: `int` .. method:: GetMenuItem(self) Returns the menu item associated with this accelerator entry. :rtype: :ref:`wx.MenuItem` .. method:: IsOk(self) Returns ``True`` if this object is correctly initialized. :rtype: `bool` .. method:: Set(self, flags, keyCode, cmd, item=None) Sets the accelerator entry parameters. :param `flags`: A combination of the :ref:`wx.AcceleratorEntryFlags` values, which indicates which modifier keys are held down. :type `flags`: int :param `keyCode`: The keycode to be detected. See :ref:`wx.KeyCode` for a full list of keycodes. :type `keyCode`: int :param `cmd`: The menu or control command identifier (``ID``). :type `cmd`: int :param `item`: The menu item associated with this accelerator. :type `item`: wx.MenuItem .. method:: 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` . :rtype: `string` .. versionadded:: 2.9.4 .. method:: 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. :rtype: `string` .. method:: __ne__(self) :param `entry`: :type `entry`: wx.AcceleratorEntry .. method:: __eq__(self) :param `entry`: :type `entry`: wx.AcceleratorEntry .. attribute:: Command See :meth:`~wx.AcceleratorEntry.GetCommand` .. attribute:: Flags See :meth:`~wx.AcceleratorEntry.GetFlags` .. attribute:: KeyCode See :meth:`~wx.AcceleratorEntry.GetKeyCode` .. attribute:: MenuItem See :meth:`~wx.AcceleratorEntry.GetMenuItem`