Class SelectAction
object --+
|
debug.debugmixin --+
|
SelectAction
- Known Subclasses:
-
- ListAction
- , ToggleAction
- , frame.DeleteWindow
- , frame.NewWindow
- , mainmenu.CancelMinibuffer
- , mainmenu.Close
- , actions.base.STCModificationAction
- , mainmenu.DescribeAction
- , actions.base.TextModificationAction
- , mainmenu.ExecuteActionByName
- , mainmenu.Exit
- , mainmenu.New
- , mainmenu.NewTab
- , mainmenu.OpenDialog
- , mainmenu.OpenFile
- , mainmenu.OpenFileGUI
- , mainmenu.OpenFundamental
- , mainmenu.OpenURL
- , mainmenu.Revert
- , mainmenu.RunScript
- , mainmenu.Save
- , mainmenu.SaveAs
- , mainmenu.SaveAsGUI
- , mainmenu.SaveURL
- , mainmenu.WordCount
- , dired.DiredClearFlags
- , dired.DiredDelete
- , dired.DiredDeleteBackwards
- , dired.DiredExecute
- , dired.DiredMark
- , dired.DiredMarkBackwards
- , dired.DiredNext
- , dired.DiredPrevious
- , dired.DiredRefresh
- , dired.DiredReplace
- , dired.DiredShow
- , plugins.mpd_major_mode.ConnectedAction
- , plugins.mpd_major_mode.Login
- , plugins.mpd_major_mode.PlayingAction
- , plugins.preferences.Preferences
- , plugins.help.HelpAbout
- , plugins.help.HelpManual
- , plugins.graphviz_mode.SampleDot
- , plugins.hexedit_mode.OpenHexEditor
- , plugins.editra_styleeditor.EditraStyles
- , plugins.makefile_mode.SampleMakefile
- , plugins.python_mode.SamplePython
- , plugins.image_mode.OpenImageViewer
- , plugins.image_mode.ZoomIn
- , plugins.image_mode.ZoomOut
- , plugins.sandbox.SlowProgressBarTest
- , plugins.sandbox.ShowStyles
- , plugins.c_mode.SampleCFile
- , plugins.widget_inspector.WidgetInspector
- , plugins.cursor_movement.BeginningOfBuffer
- , plugins.cursor_movement.EndOfBuffer
- , plugins.buffer_list_mode.BufferListClearFlags
- , plugins.buffer_list_mode.BufferListDelete
- , plugins.buffer_list_mode.BufferListDeleteBackwards
- , plugins.buffer_list_mode.BufferListExecute
- , plugins.buffer_list_mode.BufferListMark
- , plugins.buffer_list_mode.BufferListMarkBackwards
- , plugins.buffer_list_mode.BufferListNext
- , plugins.buffer_list_mode.BufferListPrevious
- , plugins.buffer_list_mode.BufferListReplace
- , plugins.buffer_list_mode.BufferListSave
- , plugins.buffer_list_mode.BufferListSaveBackwards
- , plugins.buffer_list_mode.BufferListShow
- , plugins.buffer_list_mode.ListAllDocuments
- , plugins.tutorial_plugin.InsertHelloWorld
- , plugins.debug_classes.DebugGarbage
- , hsi.hsi_major_mode.CubeAction
- , hsi.hsi_major_mode.NextBand
- , hsi.hsi_major_mode.PrevBand
The base class of any action (menu item, toolbar item, or keyboard
command).
Actions represent individual commands that can be initiated by the
user. The same subclass of action is used to represent the keyboard, menu
and toolbar command because it doesn't matter how the action is called --
if it's the same action, it is the same class.
If an action should behave differently when called from a different
user input method, it should be a different subclass.
The subclass should override the action
method to provide the implementation and isEnabled to return the enable/disabled (i.e. the
grayed-out) state of the menu item or toolbar item.
A SelectAction is a simple action that shows up as a
normal menu item, a normal toolbar button, and a simple keystroke
command. For the toolbar and menu system, ToggleActions
and RadioActions are available. For the menu bar system, ListActions and
ToggleListActions are available.
Menu items can also be updated dynamically by mixing in the OnDemandActionMixin class, or using the OnDemandGlobalListAction class.
|
|
| __call__(self,
evt,
number=1) |
|
|
|
|
|
|
|
__init__(self,
frame,
menu=None,
toolbar=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
|
|
|
|
action(self,
index=-1,
multiplier=1)
Override this to provide the functionality of the action. |
|
|
|
|
|
|
|
|
|
|
| getTooltip(self,
id=None,
name=None) |
|
|
|
|
|
|
|
|
|
|
| insertIntoMenu(self,
menu) |
|
|
|
|
| insertIntoToolbar(self,
toolbar) |
|
|
|
|
isEnabled(self)
Override this to provide the enable/disable state of the item. |
|
|
|
|
|
|
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__str__
|
|
|
alias = ''
This alias holds an emacs style name that is used during M-X
processing.
|
|
|
debuglevel = 0
|
|
|
default_menu = ()
The default menu location is specified here as a tuple containing the
menu path (separated by / characters) and a number between 1 and 1000
representing the position within the menu.
|
|
|
default_toolbar = True
Toolbar item will automatically be created unless this is False
|
|
|
global_id = None
If the action doesn't use a stock id, it will automatically get
assigned a global id here.
|
|
|
icon = None
If there is an icon associated with this action, name it here.
|
|
|
key_bindings = None
Map of platform to default keybinding.
|
|
|
keyboard = None
|
|
|
name = None
This is the name of the menu entry as it appears in the menu bar.
|
|
|
stock_id = None
If this menu action has a stock wx id, such as wx.ID_ABOUT or
wx.ID_PREFERENCES, add it here and the wx menu system can do some
special things to it, like automatically give it the correct location
on WXMAC.
|
|
|
tooltip = None
Tooltip that is displayed when the mouse is hovering over the menu
entry.
|
|
Inherited from object:
__class__
|
__init__(self,
frame,
menu=None,
toolbar=None)
(Constructor)
|
|
x.__init__(...) initializes x; see x.__class__.__doc__ for
signature
- Overrides:
object.__init__
- (inherited documentation)
|
action(self,
index=-1,
multiplier=1)
|
|
Override this to provide the functionality of the action.
This method gets called when the user initiates the action, whether it
be from the menu bar, toolbar, or keyboard.
- Parameters:
index - The index of the item in the list. This is only useful for list
or radio items.
multiplier - the multiplier supplied by the keyboard handler. The keyboard
handler allows for emacs-style repeat commands. For some
actions, it makes sense to allow repetition of the command. For
instance, in a command that uppercases words, the multiplier
could be 4, would mean that the next 4 words get uppercased. The
default is 1.
|
|
Override this to provide the enable/disable state of the item.
The menu system will call this method before the menu is drawn (or
periodically during idle time for toolbar items) to determine whether or
not the item should be disabled (grayed out).
Default is to always enable the item.
|
worksWithMajorMode(cls,
mode)
Class Method
|
|
Hook to restrict the action to only be displayed with a specific major
mode
This hook is called by the menu creation code to determine if the
action should be displayed when showing the major mode's user
interface.
- Parameters:
mode - the major mode instance
- Returns:
- True if the action is allowed to be associated with the major
mode
|
alias
This alias holds an emacs style name that is used during M-X
processing. If you don't want this action to have an emacs style name,
don't include this or set it equal to None
- Value:
-
|
default_menu
The default menu location is specified here as a tuple containing the
menu path (separated by / characters) and a number between 1 and 1000
representing the position within the menu. A negative number means that
a separator should appear before the item
- Value:
-
|
global_id
If the action doesn't use a stock id, it will automatically get
assigned a global id here. Note that if you are subclassing an action,
you should explicitly assign a global id (or None) to your subclass's
global_id attribute, otherwise the menu system will get confused and
attempt to use the superclass's global_id
- Value:
-
|
icon
If there is an icon associated with this action, name it here. Icons
are referred to by path name relative to the peppy directory. A toolbar
entry will be automatically created if the icon is specified here, unless
you specify default_toolbar = False
- Value:
-
|
key_bindings
Map of platform to default keybinding. This is used to assign the
class attribute keyboard, which is the current keybinding. Currently,
the defined platforms are named "win", "mac", and
"emacs". A platform named 'default' may also be included that
will be the default key unless overridden by a specific platform
- Value:
-
|
name
This is the name of the menu entry as it appears in the menu bar. i18n
processing happens within the menu system, so no need to wrap this string
in a call to the _ function
- Value:
-
|
tooltip
Tooltip that is displayed when the mouse is hovering over the menu
entry. If the tooltip is None, the tooltip is taken from the first line
of the docstring, if it exists.
- Value:
-
|