Пример #1
0
    def get_context_menu(self, node):
        """ Returns the context menu for a node. """
        
        sat = Group(id='SystemActionsTop')
        nsa = Group(id='NodeSpecificActions')
        sab = Group(id='SystemActionsBottom')

        # The 'New' menu.
        new_actions = self.get_new_actions(node)
        if new_actions is not None and len(new_actions) > 0:
            sat.append(
                MenuManager(
                    name = 'New',
                    *new_actions
                ),
            )
            
        # Node-specific actions.
        actions = self.get_actions(node)
        if actions is not None and len(actions) > 0:
            for item in actions:
                nsa.append(item)
        
        # System actions (actions available on ALL nodes).
        system_actions = self.node_manager.system_actions
        if len(system_actions) > 0:
            for item in system_actions:
                sab.append(item)

        context_menu = MenuManager(sat, nsa, sab)
        context_menu.dump()
        
        return context_menu
Пример #2
0
    def get_context_menu(self, node):
        """ Returns the context menu for a node. """

        sat = Group(id='SystemActionsTop')
        nsa = Group(id='NodeSpecificActions')
        sab = Group(id='SystemActionsBottom')

        # The 'New' menu.
        new_actions = self.get_new_actions(node)
        if new_actions is not None and len(new_actions) > 0:
            sat.append(MenuManager(name='New', *new_actions), )

        # Node-specific actions.
        actions = self.get_actions(node)
        if actions is not None and len(actions) > 0:
            for item in actions:
                nsa.append(item)

        # System actions (actions available on ALL nodes).
        system_actions = self.node_manager.system_actions
        if len(system_actions) > 0:
            for item in system_actions:
                sab.append(item)

        context_menu = MenuManager(sat, nsa, sab)
        context_menu.dump()

        return context_menu
Пример #3
0
    ),

    Group(
        Action(name='Export to HTML...'),
        Action(name='Print...'),

        id = 'ExportGroup'
    ),

    Group(
        Action(name='Exit'),

        id = 'ExitGroup'
    ),
)
file_menu.dump()

###############################################################################

file_menu = MenuManager(
    Action(name='New Project...'),
    Action(name='Open Project...'),

    Separator(),

    Action(name='Close Project'),
    Action(name='Close Active Editor'),

    Separator(),

    Action(name='Export to HTML...'),
Пример #4
0
    ),

    Group(
        Action(name='Export to HTML...'),
        Action(name='Print...'),

        id = 'ExportGroup'
    ),

    Group(
        Action(name='Exit'),

        id = 'ExitGroup'
    ),
)
file_menu.dump()

###############################################################################

file_menu = MenuManager(
    Action(name='New Project...'),
    Action(name='Open Project...'),

    Separator(),

    Action(name='Close Project'),
    Action(name='Close Active Editor'),

    Separator(),

    Action(name='Export to HTML...'),