X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..091fdbfacb880124683f94944225e71ced00d978:/wxPython/src/_accel.i diff --git a/wxPython/src/_accel.i b/wxPython/src/_accel.i index 322c0fc022..a047466d29 100644 --- a/wxPython/src/_accel.i +++ b/wxPython/src/_accel.i @@ -30,32 +30,97 @@ //--------------------------------------------------------------------------- %newgroup; +DocStr(wxAcceleratorEntry, +"A class used to define items in an `wx.AcceleratorTable`. wxPython +programs can choose to use wx.AcceleratorEntry objects, but using a +list of 3-tuple of integers (flags, keyCode, cmdID) usually works just +as well. See `__init__` for details of the tuple values. + +:see: `wx.AcceleratorTable`", ""); class wxAcceleratorEntry { public: - wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0, wxMenuItem *item = NULL); + DocCtorStr( + wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmdID = 0/*, wxMenuItem *menuitem = NULL*/), + "Construct a wx.AcceleratorEntry.", + " + :param flags: A bitmask of wx.ACCEL_ALT, wx.ACCEL_SHIFT, + wx.ACCEL_CTRL or wx.ACCEL_NORMAL used to specify + which modifier keys are held down. + :param keyCode: The keycode to be detected + :param cmdID: The menu or control command ID to use for the + accellerator event. +"); ~wxAcceleratorEntry(); - void Set(int flags, int keyCode, int cmd, wxMenuItem *item = NULL); + DocDeclStr( + void , Set(int flags, int keyCode, int cmd/*, wxMenuItem *menuItem = NULL*/), + "(Re)set the attributes of a wx.AcceleratorEntry. +:see `__init__`", ""); + + +// void SetMenuItem(wxMenuItem *item); +// wxMenuItem *GetMenuItem() const; + + DocDeclStr( + int , GetFlags(), + "Get the AcceleratorEntry's flags.", ""); + + DocDeclStr( + int , GetKeyCode(), + "Get the AcceleratorEntry's keycode.", ""); + + DocDeclStr( + int , GetCommand(), + "Get the AcceleratorEntry's command ID.", ""); +}; + - void SetMenuItem(wxMenuItem *item); - wxMenuItem *GetMenuItem() const; - int GetFlags(); - int GetKeyCode(); - int GetCommand(); -}; +DocStr(wxAcceleratorTable, +"An accelerator table allows the application to specify a table of +keyboard shortcuts for menus or other commands. On Windows, menu or +button commands are supported; on GTK, only menu commands are +supported.", " + +The object ``wx.NullAcceleratorTable`` is defined to be a table with +no data, and is the initial accelerator table for a window. + +An accelerator takes precedence over normal processing and can be a +convenient way to program some event handling. For example, you can +use an accelerator table to make a hotkey generate an event no matter +which window within a frame has the focus. + +Foe example:: + + aTable = wx.AcceleratorTable([(wx.ACCEL_ALT, ord('X'), exitID), + (wx.ACCEL_CTRL, ord('H'), helpID), + (wx.ACCEL_CTRL, ord('F'), findID), + (wx.ACCEL_NORMAL, wx.WXK_F3, findnextID) + ]) + self.SetAcceleratorTable(aTable) + + +:see: `wx.AcceleratorEntry`, `wx.Window.SetAcceleratorTable` +"); + class wxAcceleratorTable : public wxObject { public: - // Can also accept a list of 3-tuples + DocAStr(wxAcceleratorTable, + "__init__(entries) -> AcceleratorTable", + "Construct an AcceleratorTable from a list of `wx.AcceleratorEntry` +items or or of 3-tuples (flags, keyCode, cmdID) + +:see: `wx.AcceleratorEntry`", ""); wxAcceleratorTable(int n, const wxAcceleratorEntry* entries); ~wxAcceleratorTable(); bool Ok() const; }; + %immutable; // See also wxPy_ReinitStockObjects in helpers.cpp