Ejemplo n.º 1
0
            sel = self.vf.selection
            _set = sel.__class__(sel.data)

            self.doitWrapper(name, _set)

    def __call__(self, name, _set, **kw):
        """None <- addSelectionToDashboard( self, **kw)
        add a line to the dashboard to represent current selection
        """
        _set = self.vf.expandNodes(_set)
        if len(_set) == 0:
            return
        self.doitWrapper(*(name, _set), **kw)


addSelectionToDashboardCommandGUI = MVCommandGUI()
addSelectionToDashboardCommandGUI.addMenuCommand('menuRoot', 'Select',
                                                 'Add selection To Dashboard')

addSelectionToDashboardGUI = MVCommandGUI()
addSetToDashboardmsg = 'Add the current selection to the dashboard'
from Pmv.moleculeViewer import ICONPATH

addSelectionToDashboardGUI.addToolBar('addSetToDashboard',
                                      icon1='AddToDashboard.gif',
                                      index=15.,
                                      balloonhelp=addSetToDashboardmsg,
                                      type='ToolBarButton',
                                      icon_dir=ICONPATH)

Ejemplo n.º 2
0
                if self.tree.objToNode.has_key(o):
                    node = self.tree.objToNode[o]
                else:
                    return
                if cmdType=='useNegate':
                    negate = not kw['negate']
                    node.chkbtVar[column].set(negate)
                    node.tree.manageChildren(node, column)
                elif cmdType=='radioGroupColor':
                    node.chkbtVar[column].set(1)
                    #print 'value', node.chkbtVar[column].get()
                    node.tree.manageChildren(node, column)
                    for col in range(9,15):
                        if col==column: continue
                        node.chkbtVar[col].set(0)
                        node.tree.manageChildren(node, col)
                    
                
ControlPanel_GUI = MVCommandGUI()
from moleculeViewer import ICONPATH
ControlPanel_GUI.addToolBar('Control_Panel', icon1 = 'view_tree.gif', 
                 icon_dir=ICONPATH, balloonhelp='Control Panel Widget', index=8)
            
commandList = [
    {'name':'controlPanel', 'cmd':ControlPanel(), 'gui':ControlPanel_GUI}
]

def initModule(viewer):
    for dict in commandList:
        viewer.addCommand(dict['cmd'], dict['name'], dict['gui'])
Ejemplo n.º 3
0
        self.vf.GUI.toolbarCheckbuttons['Vision']['Variable'].set(1)

    def hide(self, event=None):
        if self.root:
            self.root.withdraw()
        self.vf.GUI.toolbarCheckbuttons['Vision']['Variable'].set(0)

    def guiCallback(self):
        self.doitWrapper()

    def __call__(self, **kw):
        """None <- vision(**kw) starts the visual programming environment"""
        apply(self.doitWrapper, (), kw)


VisionCommandGUI = MVCommandGUI()
msg = 'show/Hide the visual programming environment Vision'
from moleculeViewer import ICONPATH
VisionCommandGUI.addToolBar('Vision',
                            icon1='vision.png',
                            balloonhelp=msg,
                            icon_dir=ICONPATH,
                            index=5)

commandList = [
    {
        'name': 'vision',
        'cmd': VisionCommand(),
        'gui': VisionCommandGUI
    },
]