示例#1
0
    def prepareContextMenu(self, menu):
        ComplexTemplateHandler.prepareContextMenu(self, menu)

        graphicalViewPossible = all(isinstance(var, StdDataGraphVW) for var in self.varWrapper.children)

        # we only allow the graphical view if all contained elements are standard variables; also,
        # do not show the menu if the variable view is collapsed
        if self.varWrapper.isOpen and graphicalViewPossible:
            action = menu.addAction(QIcon(":/icons/images/graph.png"), "Graphical view for %s" % self.varWrapper.getExp(), self.toggleGraphicalView)
            action.setCheckable(True)
            action.setChecked(self.graphicalView)

            if self.graphicalView:
                submenu = menu.addMenu("Set plot type")
                add_actions_for_all_styles(submenu, self)
示例#2
0
 def __init__(self, varWrapper, distributedObjects):
     """ Constructor
     @param varWrapper    datagraph.datagraphvw.DataGraphVW, holds the Data to show """
     ComplexTemplateHandler.__init__(self, varWrapper, distributedObjects, 'structvariableview.mako')
     self.graphicalView = False
     self.style = Bar