Beispiel #1
0
)

#: The standard "revert all changes" action
RevertAction = Action(
    name="Revert",
    action="_on_revert",
    defined_when="ui.history is not None",
    enabled_when="ui.history.can_undo",
)

#: The standard "show help" action
HelpAction = Action(name="Help", action="show_help")

#: The standard Traits UI menu bar
StandardMenuBar = MenuBar(
    Menu(CloseAction, name="File"),
    Menu(UndoAction, RedoAction, RevertAction, name="Edit"),
    Menu(HelpAction, name="Help"),
)

# -------------------------------------------------------------------------
#  Standard buttons (i.e. actions):
# -------------------------------------------------------------------------

NoButton = Action(name="")

#: Appears as two buttons: **Undo** and **Redo**. When **Undo** is clicked, the
#: most recent change to the data is cancelled, restoring the previous value.
#: **Redo** cancels the most recent "undo" operation.
UndoButton = Action(name="Undo")
Beispiel #2
0
                    action='_on_redo',
                    defined_when='ui.history is not None',
                    enabled_when='ui.history.can_redo')

#: The standard "revert all changes" action
RevertAction = Action(name='Revert',
                      action='_on_revert',
                      defined_when='ui.history is not None',
                      enabled_when='ui.history.can_undo')

#: The standard "show help" action
HelpAction = Action(name='Help', action='show_help')

#: The standard Traits UI menu bar
StandardMenuBar = MenuBar(
    Menu(CloseAction, name='File'),
    Menu(UndoAction, RedoAction, RevertAction, name='Edit'),
    Menu(HelpAction, name='Help'))

#-------------------------------------------------------------------------
#  Standard buttons (i.e. actions):
#-------------------------------------------------------------------------

NoButton = Action(name='')

#: Appears as two buttons: **Undo** and **Redo**. When **Undo** is clicked, the
#: most recent change to the data is cancelled, restoring the previous value.
#: **Redo** cancels the most recent "undo" operation.
UndoButton = Action(name='Undo')

#: When the user clicks the **Revert** button, all changes made in the window are