ListShortcut is a subclass of HyperTreeList, customized to look like the GIMP main shortcut list. This class is used to display the shortcut label (with an optional bitmap next to it), its accelerator and the help string associated with it (if present).
This information is displayed in 3 columns inside ListShortcut.
__init__ | Default class constructor. |
AcceptShortcut | Returns True if the input accelerator is a valid shortcut, False otherwise. |
BuildImageList | Recursively builds the ListShortcut image list based on the bitmaps in the |
CalculateOffset | Calculates an offset (in pixels) so that the Shortcut items without |
DisableShortcut | If the user decides to reassign a shortcut to another item, this method will disable |
FireShortcutChanged | Fires the EVT_SHORTCUT_CHANGED event for ListShortcut. |
FireShortcutChanging | Fires the EVT_SHORTCUT_CHANGING event for ListShortcut. |
GetItemIdentity | Return a hashable object that represents the identity of a ListShortcut item. |
HasFlag | Overridden from wx.Window as a workaround on the conflicts between treemixin and |
MakeImageList | Builds the ListShortcut image list based on the bitmaps in the Shortcut hierarchy. |
OnExpandCollapse | Handles the wx.EVT_TREE_ITEM_COLLAPSED / wx.EVT_TREE_ITEM_EXPANDED events for ListShortcut. |
OnKillFocus | Handles the wx.EVT_KILL_FOCUS event for ListShortcut. |
OnLeftDown | Handles the wx.EVT_LEFT_DOWN event for ListShortcut. |
OnSelChanged | Handles the wx.EVT_TREE_SEL_CHANGED event for ListShortcut. |
OnShortcut | Handles the wx.EVT_CHAR_HOOK event for ShortcutEditor, implemented in ListShortcut |
Populate | Recursively populates the ListShortcut with information from the Shortcut tree. |
RecreateTree | Recreates the entire ListShortcut (columns excluded). |
SetFilter | Sets the filter string against all the shortcuts in the ListShortcut are matched. |
ShowShortcutText | Shows/Hides a wx.TextCtrl used to display the combination of keystrokes the user |
ListShortcut is a subclass of HyperTreeList, customized to look like the GIMP main shortcut list. This class is used to display the shortcut label (with an optional bitmap next to it), its accelerator and the help string associated with it (if present).
This information is displayed in 3 columns inside ListShortcut.
Default class constructor.
Parameters: | parent – an instance of ShortcutEditor. |
---|
Returns True if the input accelerator is a valid shortcut, False otherwise.
Parameters: |
|
---|
Note
Conflicting shortcuts are handled inside this method by presenting the user with a conflict dialog. At this point the user can decide to reassign an existing shortcut or to back away, in which case this method will return False.
Recursively builds the ListShortcut image list based on the bitmaps in the Shortcut hierarchy.
Parameters: |
|
---|
Calculates an offset (in pixels) so that the Shortcut items without a bitmap look parallel to the ones with a bitmap.
If the user decides to reassign a shortcut to another item, this method will disable the conflicting shortcut (by putting a “Disabled” string as its accelerator).
Parameters: |
|
---|
Fires the EVT_SHORTCUT_CHANGED event for ListShortcut.
Parameters: |
|
---|
Fires the EVT_SHORTCUT_CHANGING event for ListShortcut.
The event propagation (and thus the shortcut renaming by the user) can be interrupted by not calling event.Skip() in your handler for this event.
Parameters: |
|
---|
Return a hashable object that represents the identity of a ListShortcut item.
In this implementation this returns the item label.
Parameters: | item – an instance of GenericTreeItem. |
---|
Overridden from wx.Window as a workaround on the conflicts between treemixin and HyperTreeList with the wx.TR_HIDE_ROOT agwStyle set.
Parameters: | flag (integer) – an integer bit flag specifying the agwStyle style. |
---|---|
Returns: | True if the ListShortcut has the input flag set, False otherwise. |
Note
Overridden from wx.Window.
Builds the ListShortcut image list based on the bitmaps in the Shortcut hierarchy.
Handles the wx.EVT_TREE_ITEM_COLLAPSED / wx.EVT_TREE_ITEM_EXPANDED events for ListShortcut.
Parameters: | event – an instance of wx.TreeEvent. |
---|
Handles the wx.EVT_KILL_FOCUS event for ListShortcut.
Parameters: | event – an instance of wx.FocusEvent. |
---|
Handles the wx.EVT_LEFT_DOWN event for ListShortcut.
Parameters: | event – an instance of wx.MouseEvent. |
---|
Handles the wx.EVT_TREE_SEL_CHANGED event for ListShortcut.
Parameters: | event – an instance of wx.TreeEvent. |
---|
Handles the wx.EVT_CHAR_HOOK event for ShortcutEditor, implemented in ListShortcut as it is easier to deal with in this class.
Parameters: | event – an instance of wx.KeyEvent. |
---|
Recursively populates the ListShortcut with information from the Shortcut tree.
Parameters: |
|
---|
Recreates the entire ListShortcut (columns excluded).
Sets the filter string against all the shortcuts in the ListShortcut are matched.
Parameters: | filter (string) – a string to match. |
---|
Shows/Hides a wx.TextCtrl used to display the combination of keystrokes the user has entered. This wx.TextCtrl remains visible only for a short amount of time and only when some keys are down.
Parameters: | show (bool) – True to show the wx.TextCtrl, False to hide it. |
---|