How to use the pyface.tasks.action.api.SMenu function in pyface

To help you get started, we’ve selected a few pyface examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github robmcmullen / omnivore / omnivore_old / hex_edit / task.py View on Github external
def get_actions_Menu_Edit_SelectGroup(self):
        return [
            SelectAllAction(),
            SelectNoneAction(),
            SelectInvertAction(),
            SMenu(
                MarkSelectionAsCodeAction(),
                MarkSelectionAsDataAction(),
                MarkSelectionAsUninitializedDataAction(),
                MarkSelectionAsDisplayListAction(),
                MarkSelectionAsJumpmanLevelAction(),
                MarkSelectionAsJumpmanHarvestAction(),
                id="mark1", name="Mark Selection As"),
            ]
github robmcmullen / omnivore / omnivore_old / hex_edit / task.py View on Github external
def get_actions_Menu_Edit_CopyPasteGroup(self):
        return [
            CutAction(),
            CopyAction(),
            SMenu(
                CopyDisassemblyAction(),
                CopyCommentsAction(),
                CopyAsReprAction(),
                CopyAsCBytesAction(),
                id='copyspecial', name="Copy Special"),
            PasteAction(),
            SMenu(
                PasteAndRepeatAction(),
                PasteCommentsAction(),
                id='pastespecial', name="Paste Special"),
            ]
github enthought / pyface / examples / tasks / steps / mac-menubar-switching.py View on Github external
def _menu_bar_default(self):
        return SMenuBar(
            SMenu(
                TaskAction(name="New", method="new", accelerator="Ctrl+N"),
                id="File",
                name="&File",
            ),
            SMenu(
                DockPaneToggleGroup(),
                TaskToggleGroup(),
                id="View",
                name="&View",
            ),
            SMenu(
                TaskAction(name="Item 1", method="item1"),
                TaskAction(name="Item 2", method="item2"),
                id="Task2",
                name="&Task2",
            ),
github enthought / pyface / examples / tasks / steps / step6a.py View on Github external
""" A simple task for opening a blank editor.
    """

    # Task interface -------------------------------------------------------

    id = "example.example_task"
    name = "Multi-Tab Editor"

    active_editor = Property(
        Instance(IEditor), depends_on="editor_area.active_editor"
    )

    editor_area = Instance(IEditorAreaPane)

    menu_bar = SMenuBar(
        SMenu(
            TaskAction(name="New", method="new", accelerator="Ctrl+N"),
            id="File",
            name="&File",
        ),
        SMenu(
            DockPaneToggleGroup(), TaskToggleGroup(), id="View", name="&View"
        ),
    )

    tool_bars = [
        SToolBar(
            TaskAction(
                method="new",
                tooltip="New file",
                image=ImageResource("document_new"),
            ),
github enthought / envisage / examples / plugins / tasks / attractors / visualize_2d_task.py View on Github external
from model_config_pane import ModelConfigPane
from model_help_pane import ModelHelpPane
from plot_2d_pane import Plot2dPane


class Visualize2dTask(Task):
    """ A task for visualizing attractors in 2D.
    """

    #### 'Task' interface #####################################################

    id = "example.attractors.task_2d"
    name = "2D Visualization"

    menu_bar = SMenuBar(
        SMenu(id="File", name="&File"),
        SMenu(id="Edit", name="&Edit"),
        SMenu(TaskToggleGroup(), id="View", name="&View"),
    )

    #### 'Visualize2dTask' interface ##########################################

    # The attractor model that is currently active (visible in the center
    # pane).
    active_model = Any

    # The list of available attractor models.
    models = List(Instance(IPlottable2d))

    ###########################################################################
    # 'Task' interface.
    ###########################################################################
github robmcmullen / omnivore / omnivore_old / hex_edit / task.py View on Github external
def get_actions_Menu_Edit_CopyPasteGroup(self):
        return [
            CutAction(),
            CopyAction(),
            SMenu(
                CopyDisassemblyAction(),
                CopyCommentsAction(),
                CopyAsReprAction(),
                CopyAsCBytesAction(),
                id='copyspecial', name="Copy Special"),
            PasteAction(),
            SMenu(
                PasteAndRepeatAction(),
                PasteCommentsAction(),
                id='pastespecial', name="Paste Special"),
            ]
github enthought / envisage / examples / plugins / tasks / attractors / visualize_2d_task.py View on Github external
from model_help_pane import ModelHelpPane
from plot_2d_pane import Plot2dPane


class Visualize2dTask(Task):
    """ A task for visualizing attractors in 2D.
    """

    #### 'Task' interface #####################################################

    id = "example.attractors.task_2d"
    name = "2D Visualization"

    menu_bar = SMenuBar(
        SMenu(id="File", name="&File"),
        SMenu(id="Edit", name="&Edit"),
        SMenu(TaskToggleGroup(), id="View", name="&View"),
    )

    #### 'Visualize2dTask' interface ##########################################

    # The attractor model that is currently active (visible in the center
    # pane).
    active_model = Any

    # The list of available attractor models.
    models = List(Instance(IPlottable2d))

    ###########################################################################
    # 'Task' interface.
    ###########################################################################
github bpteague / cytoflow / cytoflowgui / flow_task.py View on Github external
accelerator='Ctrl+S'),
                              TaskAction(name='Save As...',
                                         method='on_save_as',
                                         accelerator='Ctrl+e'),
                              TaskAction(name='Save Plot...',
                                         method='on_export',
                                         accelerator='Ctrl+x'),
#                               TaskAction(name='Export Jupyter notebook...',
#                                          method='on_notebook',
#                                          accelerator='Ctrl+I'),                              
#                               TaskAction(name='Preferences...',
#                                          method='on_prefs',
#                                          accelerator='Ctrl+P'),
                              id='File', name='&File'),
                        SMenu(id = 'View', name = '&View'),
                        SMenu(TaskAction(name = 'Report a problem....',
                                         method = 'on_problem'),
                              TaskAction(name='About...',
                                         method='on_about'),
                              id="Help", name ="&Help"))
    
    tool_bars = [ SToolBar(TaskAction(method='on_new',
                                      name = "New",
                                      tooltip='New workflow',
                                      image=ImageResource('new')),
                           TaskAction(method='on_open',
                                      name = "Open",
                                      tooltip='Open a file',
                                      image=ImageResource('open')),
                           TaskAction(method='on_save',
                                      name = "Save",
                                      tooltip='Save the current file',
github robmcmullen / omnivore / omnivore_old / hex_edit / task.py View on Github external
def get_actions_Menu_View_PredefinedGroup(self):
        actions = []
        for m in machine.predefined['machine']:
            actions.append(PredefinedMachineAction(machine=m))
        return [
            SMenu(
                Group(
                    *actions,
                    id="a1", separator=True),
                id='MachineChoiceSubmenu1', separator=False, name="Predefined Machines"),
            ]
github robmcmullen / omnivore / omnivore / old-pyface-stuff / byte_edit / task.py View on Github external
def get_actions_Menu_View_FontGroup(self):
        font_mapping_actions = self.get_font_mapping_actions()
        font_renderer_actions = []
        for r in machine.predefined['font_renderer']:
            font_renderer_actions.append(va.FontRendererAction(font_renderer=r))
        return [
            SMenu(
                Group(
                    va.UseFontAction(font=fonts.A8DefaultFont),
                    va.UseFontAction(font=fonts.A8ComputerFont),
                    va.UseFontAction(font=fonts.A2DefaultFont),
                    va.UseFontAction(font=fonts.A2MouseTextFont),
                    id="a1", separator=True),
                va.FontChoiceGroup(id="a2", separator=True),
                Group(
                    va.LoadFontAction(),
                    ba.GetFontFromSelectionAction(),
                    id="a3", separator=True),
                id='mm5', separator=False, name="Font"),
            SMenu(
                Group(
                    *font_renderer_actions,
                    id="a1", separator=True),