当前位置: 首页>>代码示例>>Python>>正文


Python PM_ComboBox.setCurrentIndex方法代码示例

本文整理汇总了Python中PM.PM_ComboBox.PM_ComboBox.setCurrentIndex方法的典型用法代码示例。如果您正苦于以下问题:Python PM_ComboBox.setCurrentIndex方法的具体用法?Python PM_ComboBox.setCurrentIndex怎么用?Python PM_ComboBox.setCurrentIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PM.PM_ComboBox.PM_ComboBox的用法示例。


在下文中一共展示了PM_ComboBox.setCurrentIndex方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: StereoProperties_PropertyManager

# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import setCurrentIndex [as 别名]

#.........这里部分代码省略.........
        """
        Add the Property Manager group boxes.
        """
        self._pmGroupBox1 = PM_GroupBox( self, 
                                         title = "Settings")
        self._loadGroupBox1( self._pmGroupBox1 )

        #@ self._pmGroupBox1.hide()

    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in group box.
        """
        #stereoSettingsGroupBox = PM_GroupBox( None )

        self.stereoEnabledCheckBox = \
            PM_CheckBox(pmGroupBox,
                        text         = 'Enable Stereo View',
                        widgetColumn = 1
                        )        

        stereoModeChoices = ['Relaxed view', 
                             'Cross-eyed view',
                             'Red/blue anaglyphs',
                             'Red/cyan anaglyphs',
                             'Red/green anaglyphs']

        self.stereoModeComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Stereo Mode:", 
                         choices       =  stereoModeChoices,
                         setAsDefault  =  True)

        self.stereoModeComboBox.setCurrentIndex(env.prefs[stereoViewMode_prefs_key]-1)
            
        self.stereoSeparationSlider =  \
            PM_Slider( pmGroupBox,
                       currentValue = 50,
                       minimum      = 0,
                       maximum      = 300,
                       label        = 'Separation'
                       )        

        self.stereoSeparationSlider.setValue(env.prefs[stereoViewSeparation_prefs_key])

        self.stereoAngleSlider =  \
            PM_Slider( pmGroupBox,
                       currentValue = 50,
                       minimum      = 0,
                       maximum      = 100,
                       label        = 'Angle'
                       )

        self.stereoAngleSlider.setValue(env.prefs[stereoViewAngle_prefs_key])

        self._updateWidgets()
                
    def _addWhatsThisText( self ):
        """
        What's This text for widgets in the Stereo Property Manager.  
        """
        pass

    def _addToolTipText(self):
        """
        Tool Tip text for widgets in the Stereo Property Manager.  
开发者ID:elfion,项目名称:nanoengineer,代码行数:70,代码来源:StereoProperties_PropertyManager.py

示例2: QuteMolPropertyManager

# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import setCurrentIndex [as 别名]

#.........这里部分代码省略.........

    def connect_or_disconnect_signals(self, isConnect):
        """
        Connect or disconnect widget signals sent to their slot methods.
        This can be overridden in subclasses. By default it does nothing.
        @param isConnect: If True the widget will send the signals to the slot
                          method.
        @type  isConnect: boolean
        """
        if isConnect:
            change_connect = self.win.connect
        else:
            change_connect = self.win.disconnect

        change_connect(self.axesCombobox,
                     SIGNAL("currentIndexChanged(const QString&)"),
                     self.changeAxesDisplay)

        change_connect(self.basesCombobox,
                     SIGNAL("currentIndexChanged(const QString&)"),
                     self.changeBasesDisplay)

        change_connect(self.launchQuteMolButton,
                       SIGNAL("clicked()"),
                       self.launchQuteMol)

    def updateMessage(self, msg = ''):
        """
        Updates the message box with an informative message
        @param msg: Message to be displayed in the Message groupbox of
                        the property manager
        @type  msg: string
        """
        self.MessageGroupBox.insertHtmlMessage(msg,
                                               setAsDefault = False,
                                               minLines     = 5)

    def changeAxesDisplay(self, optionText):
        """
        Slot to change the axes display style.

        @param optionText: The text of the combobox option selected.
        @type  optionText: str
        """

        if optionText == self._axes_display_choices[0]:
            self._axesFlags = EXCLUDE_HIDDEN_ATOMS
            # Cannot display axes if axis atoms are excluded.
            self.basesCombobox.setCurrentIndex(0)
        elif optionText == self._axes_display_choices[1]:
            self._axesFlags = EXCLUDE_HIDDEN_ATOMS | EXCLUDE_DNA_AXIS_BONDS
        else:
            print "Unknown axes display option: ", optionText

        #print "Axes display option=", optionText
        #print "Axes Flags=", self._axesFlags

    def changeBasesDisplay(self, optionText):
        """
        Slot to change the bases display style.

        @param optionText: The text of the combobox option selected.
        @type  optionText: str
        """
        if optionText == self._bases_display_choices[0]:
            self._basesFlags = EXCLUDE_HIDDEN_ATOMS
        elif optionText == self._bases_display_choices[1]:
            self._basesFlags = EXCLUDE_HIDDEN_ATOMS | EXCLUDE_DNA_AXIS_ATOMS
            # Cannot display axesif axis atoms are excluded.
            self.axesCombobox.setCurrentIndex(1)
        else:
            print "Unknown bases display option: ", optionText

        #print "Bases display option=", optionText
        #print "Bases Flags=", self._basesFlags

    def launchQuteMol(self):
        """
        Slot for 'Launch QuteMolX' button.
        Opens the QuteMolX rendering program and loads a copy of the current
        model.

        Method:

        1. Write a PDB file of the current part.
        2. Write an atom attributes table text file containing atom radii and
           color information.
        3. Launches QuteMolX (with the PDB file as an argument).

        """
        cmd = greenmsg("QuteMolX : ")

        excludeFlags = self._axesFlags | self._basesFlags
        #print "Exclude flags=", excludeFlags

        pdb_file = write_qutemol_files(self.win.assy, excludeFlags)
        # Launch QuteMolX. It will verify the plugin.
        errorcode, msg = launch_qutemol(pdb_file)
        # errorcode is ignored.
        env.history.message(cmd + msg)
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:104,代码来源:QuteMolPropertyManager.py

示例3: QuteMolPropertyManager

# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import setCurrentIndex [as 别名]

#.........这里部分代码省略.........
    
    def connect_or_disconnect_signals(self, isConnect):
        """
        Connect or disconnect widget signals sent to their slot methods.
        This can be overridden in subclasses. By default it does nothing.
        @param isConnect: If True the widget will send the signals to the slot 
                          method. 
        @type  isConnect: boolean
        """
        if isConnect:
            change_connect = self.win.connect
        else:
            change_connect = self.win.disconnect
        
        change_connect(self.axesCombobox,
                     SIGNAL("currentIndexChanged(const QString&)"),
                     self.changeAxesDisplay)
        
        change_connect(self.basesCombobox,
                     SIGNAL("currentIndexChanged(const QString&)"),
                     self.changeBasesDisplay)
        
        change_connect(self.launchQuteMolButton, 
                       SIGNAL("clicked()"), 
                       self.launchQuteMol)
    
    def updateMessage(self, msg = ''):
        """
        Updates the message box with an informative message
        @param msg: Message to be displayed in the Message groupbox of 
                        the property manager
        @type  msg: string
        """
        self.MessageGroupBox.insertHtmlMessage(msg, 
                                               setAsDefault = False,
                                               minLines     = 5)
    
    def changeAxesDisplay(self, optionText):
        """
        Slot to change the axes display style.
        
        @param optionText: The text of the combobox option selected.
        @type  optionText: str        
        """
        
        if optionText == self._axes_display_choices[0]:
            self._axesFlags = EXCLUDE_HIDDEN_ATOMS
            # Cannot display axes if axis atoms are excluded.
            self.basesCombobox.setCurrentIndex(0)
        elif optionText == self._axes_display_choices[1]:
            self._axesFlags = EXCLUDE_HIDDEN_ATOMS | EXCLUDE_DNA_AXIS_BONDS
        else:
            print "Unknown axes display option: ", optionText
            
        #print "Axes display option=", optionText
        #print "Axes Flags=", self._axesFlags
    
    def changeBasesDisplay(self, optionText):
        """
        Slot to change the bases display style.
        
        @param optionText: The text of the combobox option selected.
        @type  optionText: str
        """
        if optionText == self._bases_display_choices[0]:
            self._basesFlags = EXCLUDE_HIDDEN_ATOMS
        elif optionText == self._bases_display_choices[1]:
            self._basesFlags = EXCLUDE_HIDDEN_ATOMS | EXCLUDE_DNA_AXIS_ATOMS
            # Cannot display axesif axis atoms are excluded.
            self.axesCombobox.setCurrentIndex(1)
        else:
            print "Unknown bases display option: ", optionText
            
        #print "Bases display option=", optionText
        #print "Bases Flags=", self._basesFlags
    
    def launchQuteMol(self):
        """
        Slot for 'Launch QuteMolX' button.
        Opens the QuteMolX rendering program and loads a copy of the current 
        model.

        Method:

        1. Write a PDB file of the current part.
        2. Write an atom attributes table text file containing atom radii and
           color information.
        3. Launches QuteMolX (with the PDB file as an argument). 

        """    
        cmd = greenmsg("QuteMolX : ")
        
        excludeFlags = self._axesFlags | self._basesFlags
        #print "Exclude flags=", excludeFlags
        
        pdb_file = write_qutemol_files(self.win.assy, excludeFlags)
        # Launch QuteMolX. It will verify the plugin.
        errorcode, msg = launch_qutemol(pdb_file) 
        # errorcode is ignored. 
        env.history.message(cmd + msg)
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:104,代码来源:QuteMolPropertyManager.py

示例4: ColorScheme_PropertyManager

# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import setCurrentIndex [as 别名]

#.........这里部分代码省略.........
                             color = env.prefs[hoverHighlightingColor_prefs_key]
                             )

        # selection style and color
        self.selectionStyleComboBox = \
            PM_ComboBox( pmGroupBox,
                         label     =  "Selection:",
                         )

        self._loadSelectionStyleItems()

        selColorList = [darkgreen, green, orange, red,
                        magenta, cyan, blue, white, black,
                        gray]
        selColorNames = ["Dark green (default)", "Green", "Orange", "Red",
                         "Magenta", "Cyan", "Blue", "White", "Black",
                         "Other color..."]

        self.selectionColorComboBox = \
            PM_ColorComboBox(pmGroupBox,
                             colorList = selColorList,
                             colorNames = selColorNames,
                             color = env.prefs[selectionColor_prefs_key]
                             )
        return

    def _updateAllWidgets(self):
        """
        Update all the PM widgets. This is typically called after applying
        a favorite.
        """
        self._updateBackgroundColorComboBoxIndex()
        self.updateCustomColorItemIcon(RGBf_to_QColor(env.prefs[backgroundColor_prefs_key]))
        self.hoverHighlightingStyleComboBox.setCurrentIndex(HHS_INDEXES.index(env.prefs[hoverHighlightingColorStyle_prefs_key]))
        self.hoverHighlightingColorComboBox.setColor(env.prefs[hoverHighlightingColor_prefs_key])
        self.selectionStyleComboBox.setCurrentIndex(SS_INDEXES.index(env.prefs[selectionColorStyle_prefs_key]))
        self.selectionColorComboBox.setColor(env.prefs[selectionColor_prefs_key])
        return

    def _loadSelectionStyleItems(self):
        """
        Load the selection color style combobox with items.
        """
        for selectionStyle in SS_OPTIONS:
            self.selectionStyleComboBox.addItem(selectionStyle)
        return

    def _loadHoverHighlightingStyleItems(self):
        """
        Load the hover highlighting style combobox with items.
        """
        for hoverHighlightingStyle in HHS_OPTIONS:
            self.hoverHighlightingStyleComboBox.addItem(hoverHighlightingStyle)
        return

    def _loadBackgroundColorItems(self):
        """
        Load the background color combobox with all the color options and sets
        the current background color
        """
        backgroundIndexes = [bg_BLUE_SKY, bg_EVENING_SKY, bg_SEAGREEN,
                             bg_BLACK, bg_WHITE, bg_GRAY, bg_CUSTOM]

        backgroundNames   = ["Blue Sky (default)", "Evening Sky", "Sea Green",
                             "Black", "White", "Gray", "Custom..."]
开发者ID:foulowl,项目名称:nanoengineer,代码行数:69,代码来源:ColorScheme_PropertyManager.py

示例5: DnaGeneratorPropertyManager

# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import setCurrentIndex [as 别名]

#.........这里部分代码省略.........
        B = C,G, or T<br>
        D = A,G, or T<br>
        H = A,C, or T<br>
        V = A,C, or G<br>
        R = A or G (puRine)<br>
        Y = C or T (pYrimidine)<br>
        K = G or T (Keto)<br>
        M = A or C (aMino)<br>
        S = G or C (Strong -3H bonds)<br>
        W = A or T (Weak - 2H bonds)<br>
        </p>""")

        self.actionsComboBox.setWhatsThis("""<b>Action</b>
        <p>Select an action to perform on the sequence.</p>""")

    def conformationComboBoxChanged( self, inIndex ):
        """
        Slot for the Conformation combobox. It is called whenever the
        Conformation choice is changed.

        @param inIndex: The new index.
        @type  inIndex: int
        """
        self.basesPerTurnComboBox.clear()
        conformation  =  self.conformationComboBox.currentText()

        if conformation == "B-DNA":
            self.basesPerTurnComboBox.insertItem(0, "10.0")
            self.basesPerTurnComboBox.insertItem(1, "10.5")
            self.basesPerTurnComboBox.insertItem(2, "10.67")

            #10.5 is the default value for Bases per turn.
            #So set the current index to 1
            self.basesPerTurnComboBox.setCurrentIndex(1)

        elif conformation == "Z-DNA":
            self.basesPerTurnComboBox.insertItem(0, "12.0")

        elif inIndex == -1:
            # Caused by clear(). This is tolerable for now. Mark 2007-05-24.
            conformation = "B-DNA" # Workaround for "Restore Defaults".
            pass

        else:
            msg = redmsg("conformationComboBoxChanged(): \
            Error - unknown DNA conformation. Index = "+ inIndex)
            env.history.message(msg)

        self.duplexLengthSpinBox.setSingleStep(
                self.getDuplexRise(conformation) )

    def modelComboBoxChanged( self, inIndex ):
        """
        Slot for the Model combobox. It is called whenever the
        Model choice is changed.

        @param inIndex: The new index.
        @type  inIndex: int
        """
        conformation  =  self._modelChoices[ inIndex ]

        self.disconnect( self.conformationComboBox,
                         SIGNAL("currentIndexChanged(int)"),
                         self.conformationComboBoxChanged )

        self.conformationComboBox.clear() # Generates signal!
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:70,代码来源:DnaGeneratorPropertyManager.py

示例6: TestGraphics_PropertyManager

# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import setCurrentIndex [as 别名]
class TestGraphics_PropertyManager(Command_PropertyManager):
    """
    The TestGraphics_PropertyManager class provides a Property Manager
    for the Test Graphics command.

    @ivar title: The title that appears in the property manager header.
    @type title: str

    @ivar pmName: The name of this property manager. This is used to set
                  the name of the PM_Dialog object via setObjectName().
    @type name: str

    @ivar iconPath: The relative path to the PNG file that contains a
                    22 x 22 icon image that appears in the PM header.
    @type iconPath: str
    """

    title         =  "Test Graphics"
    pmName        =  title
    iconPath      =  None ###k "ui/actions/View/Stereo_View.png" ### FIX - use some generic or default icon


    def __init__( self, command ):
        """
        Constructor for the property manager.
        """
        _superclass.__init__(self, command)

        self.showTopRowButtons( PM_DONE_BUTTON |
                                PM_WHATS_THIS_BUTTON)

        msg = "Test the performance effect of graphics settings below. " \
              "(To avoid bugs, choose testCase before bypassing paintGL.)"

        self.updateMessage(msg)


    def _addGroupBoxes( self ):
        """
        Add the Property Manager group boxes.
        """
        self._pmGroupBox1 = PM_GroupBox( self,
                                         title = "Settings") ### fix title
        self._loadGroupBox1( self._pmGroupBox1 )

    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in group box.
        """
        from widgets.prefs_widgets  import ObjAttr_StateRef ### toplevel

        self._cb2 = \
            PM_CheckBox(pmGroupBox,
                        text         = "redraw continuously",
                        )
        self._cb2.connectWithState( ObjAttr_StateRef( self.command, 'redraw_continuously' ))

        self._cb3 = \
            PM_CheckBox(pmGroupBox,
                        text         = "spin model",
                        )
        self._cb3.connectWithState( ObjAttr_StateRef( self.command, 'spin_model' ))

        self._cb4 = \
            PM_CheckBox(pmGroupBox,
                        text         = "print fps to console",
                        )
        self._cb4.connectWithState( ObjAttr_StateRef( self.command, 'print_fps' ))

        self._cb1 = \
            PM_CheckBox(pmGroupBox,
                        text         = "replace paintGL with testCase",
                        )
        self._cb1.connectWithState( ObjAttr_StateRef( self.command, 'bypass_paintgl' ))
            # note: this state (unlike the highest-quality staterefs)
            # is not change-tracked [as of 081003], so nothing aside from
            # user clicks on this checkbox should modify it after this runs,
            # or our UI state will become out of sync with the state.

        self.testCase_ComboBox = PM_ComboBox(pmGroupBox,
                                      label =  "testCase:", labelColumn = 0,
                                      choices = self.command.testCaseChoicesText,
                                      setAsDefault = False )
        self.testCase_ComboBox.setCurrentIndex(self.command.testCaseIndex)

        self.nSpheres_ComboBox = PM_ComboBox(pmGroupBox,
                                      label =  "n x n spheres:", labelColumn = 0,
                                      choices = self.command._NSPHERES_CHOICES,
                                      setAsDefault = False )
        nSpheres_index = self.command._NSPHERES_CHOICES.index( str( self.command.nSpheres) )
        self.nSpheres_ComboBox.setCurrentIndex( nSpheres_index)
        self._set_nSpheresIndex( nSpheres_index)

        self.detail_level_ComboBox = PM_ComboBox(pmGroupBox,
                                      label =  "Level of detail:", labelColumn = 0,
                                      choices = ["Low", "Medium", "High", "Variable"],
                                      setAsDefault = False )
        lod = env.prefs[levelOfDetail_prefs_key]
        if lod > 2:
            lod = 2
#.........这里部分代码省略.........
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:103,代码来源:TestGraphics_PropertyManager.py

示例7: PlanePropertyManager

# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import setCurrentIndex [as 别名]

#.........这里部分代码省略.........
            plane.updateCosmeticProps(previewing = True)
            if plane.imagePath:
                self.imageDisplayFileChooser.setText(plane.imagePath)
            self.imageDisplayCheckBox.setChecked(plane.display_image)

            #Make sure that the plane placement option is always set to
            #'Custom' when the Plane PM is shown. This makes sure that bugs like
            #2949 won't occur. Let the user change the plane placement option
            #explicitely
            button = self.pmPlacementOptions.getButtonById(3)
            button.setChecked(True)

    def setParameters(self, params):
        """
        """
        width, height, gridColor, gridLineType, \
             gridXSpacing, gridYSpacing, originLocation, \
             displayLabelStyle = params

        # blockSignals = True  flag makes sure that the
        # spinbox.valueChanged()
        # signal is not emitted after calling spinbox.setValue().
        self.widthDblSpinBox.setValue(width, blockSignals = True)
        self.heightDblSpinBox.setValue(height, blockSignals = True)
        self.win.glpane.gl_update()


        self.gpColorTypeComboBox.setColor(gridColor)
        self.gridLineType = gridLineType

        self.gpXSpacingDoubleSpinBox.setValue(gridXSpacing)
        self.gpYSpacingDoubleSpinBox.setValue(gridYSpacing)

        self.gpOriginComboBox.setCurrentIndex(originLocation)
        self.gpPositionComboBox.setCurrentIndex(displayLabelStyle)


    def getCurrrentDisplayParams(self):
        """
        Returns a tuple containing current display parameters such as current
        image path and grid display params.
        @see: Plane_EditCommand.command_update_internal_state() which uses this
        to decide whether to modify the structure (e.g. because of change in the
        image path or display parameters.)
        """
        imagePath = self.imageDisplayFileChooser.text
        gridColor = self.gpColorTypeComboBox.getColor()

        return (imagePath, gridColor, self.gridLineType,
                self.gridXSpacing, self.gridYSpacing,
                self.originLocation, self.displayLabelStyle)

    def getParameters(self):
        """
        """
        width = self.widthDblSpinBox.value()
        height = self.heightDblSpinBox.value()
        gridColor = self.gpColorTypeComboBox.getColor()

        params = (width, height, gridColor, self.gridLineType,
                  self.gridXSpacing, self.gridYSpacing, self.originLocation,
                  self.displayLabelStyle)

        return params

开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:68,代码来源:PlanePropertyManager.py

示例8: DnaDisplayStyle_PropertyManager

# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import setCurrentIndex [as 别名]

#.........这里部分代码省略.........
                              maximum       =  3.0,
                              decimals      =  2,
                              singleStep    =  0.1 )

        nucleotidesColorChoices = ['Same as strand',
                                   'Base order',
                                   'Strand order',
                                   'Base type']

        self.nucleotidesColorComboBox = \
            PM_ComboBox( nucleotidesGroupBox ,
                         label         =  "Color:",
                         choices       =  nucleotidesColorChoices,
                         setAsDefault  =  True)

        self.dnaStyleBasesDisplayLettersCheckBox = \
            PM_CheckBox(nucleotidesGroupBox ,
                        text         = 'Display base letters',
                        widgetColumn = 1
                        )

    def updateDnaDisplayStyleWidgets( self , blockSignals = False):
        """
        Updates all the DNA Display style widgets based on the current pref keys
        values.

        @param blockSignals: If its set to True, the set* methods of the
                             the widgets (currently only PM_ Spinboxes and
                             ComboBoxes) won't emit a signal.
        @type blockSignals: bool

        @see: self.show() where this method is called.
        @see: PM_Spinbox.setValue()
        @see: PM_ComboBox.setCurrentIndex()

        @note: This should be called each time the PM is displayed (see show()).
        """

        self.dnaRenditionComboBox.setCurrentIndex(
            env.prefs[dnaRendition_prefs_key],
            blockSignals = blockSignals )

        self.axisShapeComboBox.setCurrentIndex(
            env.prefs[dnaStyleAxisShape_prefs_key], blockSignals = blockSignals)

        self.axisScaleDoubleSpinBox.setValue(
            env.prefs[dnaStyleAxisScale_prefs_key], blockSignals = blockSignals)

        self.axisColorComboBox.setCurrentIndex(
            env.prefs[dnaStyleAxisColor_prefs_key], blockSignals = blockSignals)

        self.axisEndingStyleComboBox.setCurrentIndex(
            env.prefs[dnaStyleAxisEndingStyle_prefs_key], blockSignals = blockSignals)

        self.strandsShapeComboBox.setCurrentIndex(
            env.prefs[dnaStyleStrandsShape_prefs_key], blockSignals = blockSignals)

        self.strandsScaleDoubleSpinBox.setValue(
            env.prefs[dnaStyleStrandsScale_prefs_key], blockSignals = blockSignals)

        self.strandsColorComboBox.setCurrentIndex(
            env.prefs[dnaStyleStrandsColor_prefs_key], blockSignals = blockSignals)

        self.strandsArrowsComboBox.setCurrentIndex(
            env.prefs[dnaStyleStrandsArrows_prefs_key], blockSignals = blockSignals)
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:69,代码来源:DnaDisplayStyle_PropertyManager.py

示例9: StereoProperties_PropertyManager

# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import setCurrentIndex [as 别名]

#.........这里部分代码省略.........
        Add the Property Manager group boxes.
        """
        self._pmGroupBox1 = PM_GroupBox( self, 
                                         title = "Settings")
        self._loadGroupBox1( self._pmGroupBox1 )

        #@ self._pmGroupBox1.hide()

    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in group box.
        """

        #stereoSettingsGroupBox = PM_GroupBox( None )

        self.stereoEnabledCheckBox = \
            PM_CheckBox(pmGroupBox,
                        text         = 'Enable Stereo View',
                        widgetColumn = 1
                        )        

        stereoModeChoices = ['Relaxed view', 
                             'Cross-eyed view',
                             'Red/blue anaglyphs',
                             'Red/cyan anaglyphs',
                             'Red/green anaglyphs']

        self.stereoModeComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Stereo Mode:", 
                         choices       =  stereoModeChoices,
                         setAsDefault  =  True)

        self.stereoModeComboBox.setCurrentIndex(env.prefs[stereoViewMode_prefs_key]-1)
            
        self.stereoSeparationSlider =  \
            PM_Slider( pmGroupBox,
                       currentValue = 50,
                       minimum      = 0,
                       maximum      = 300,
                       label        = 'Separation'
                       )        

        self.stereoSeparationSlider.setValue(env.prefs[stereoViewSeparation_prefs_key])

        self.stereoAngleSlider =  \
            PM_Slider( pmGroupBox,
                       currentValue = 50,
                       minimum      = 0,
                       maximum      = 100,
                       label        = 'Angle'
                       )        

        self.stereoAngleSlider.setValue(env.prefs[stereoViewAngle_prefs_key])

        self._updateWidgets()
                
    def _addWhatsThisText( self ):
        """
        What's This text for widgets in the Stereo Property Manager.  
        """
        pass

    def _addToolTipText(self):
        """
        Tool Tip text for widgets in the Stereo Property Manager.  
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:70,代码来源:StereoProperties_PropertyManager.py

示例10: EditRotamers_PropertyManager

# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import setCurrentIndex [as 别名]

#.........这里部分代码省略.........
                              label         =  "Chi2 angle:",
                              value         =  0.000,
                              setAsDefault  =  True,
                              minimum       =  -180.0,
                              maximum       =  180.0,
                              decimals      =  1,
                              singleStep    =  1.0, 
                              spanWidth = False)
        
        self.chi3SpinBox  =  \
            PM_DoubleSpinBox( pmGroupBox,
                              label         =  "Chi3 angle:",
                              value         =  0.000,
                              setAsDefault  =  True,
                              minimum       =  -180.0,
                              maximum       =  180.0,
                              decimals      =  1,
                              singleStep    =  1.0, 
                              spanWidth = False)
        
    def _addWhatsThisText( self ):
        
        #from ne1_ui.WhatsThisText_for_PropertyManagers import WhatsThis_EditRotamers_PropertyManager
        #WhatsThis_EditRotamers_PropertyManager(self)
        pass
    
    def _addToolTipText(self):
        #from ne1_ui.ToolTipText_for_PropertyManagers import ToolTip_EditProteinDisplayStyle_PropertyManager 
        #ToolTip_EditProteinDisplayStyle_PropertyManager(self)
        pass
    
    def _expandNextRotamer(self):
        """
        """
        for chunk in self.win.assy.molecules:
            if chunk.isProteinChunk():
                chunk.protein.traverse_forward()
                self._display_and_recenter()
                self._updateAminoAcidInfo(
                    chunk.protein.get_current_amino_acid_index())
                return

    def _expandPreviousRotamer(self):
        """
        """
        for chunk in self.win.assy.molecules:
            if chunk.isProteinChunk():
                chunk.protein.traverse_backward()
                self._display_and_recenter()
                self._updateAminoAcidInfo(
                    chunk.protein.get_current_amino_acid_index())
                return
        
    def _collapseAllRotamers(self):
        """
        """
        for chunk in self.win.assy.molecules:
            if chunk.isProteinChunk():
                chunk.protein.collapse_all_rotamers()
                self.win.glpane.gl_update()
                return
        
    def _expandAllRotamers(self):
        """
        """
        for chunk in self.win.assy.molecules:
            if chunk.isProteinChunk():
                chunk.protein.expand_all_rotamers()
                self.win.glpane.gl_update()
                return
        
    def _display_and_recenter(self):
        """
        """
        for chunk in self.win.assy.molecules:
            if chunk.isProteinChunk():
                chunk.protein.collapse_all_rotamers()
                current_aa = chunk.protein.get_current_amino_acid()
                if current_aa:
                    chunk.protein.expand_rotamer(current_aa)
                    if self.recenterViewCheckBox.isChecked():
                        ca_atom = current_aa.get_c_alpha_atom()
                        if ca_atom:
                            self.win.glpane.pov = -ca_atom.posn()                            
                    #self.win.glpane.gl_update()
                    self.win.glpane.gl_update()
        
    def _updateAminoAcidInfo(self, index):
        """
        """
        self.aminoAcidsComboBox.setCurrentIndex(index)
        
    def _aminoAcidChanged(self, index):
        """
        """
        for chunk in self.win.assy.molecules:
            if chunk.isProteinChunk():
                chunk.protein.set_current_amino_acid_index(index)
                self._display_and_recenter()
                
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:103,代码来源:EditRotamers_PropertyManager.py

示例11: LightingScheme_PropertyManager

# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import setCurrentIndex [as 别名]

#.........这里部分代码省略.........
            
            fname = getFavoritePathFromBasename( name )
            if os.path.exists(fname):
                
                #favorite file already exists!
                
                _ext= ".txt"
                ret = QMessageBox.warning( self, "Warning!",
                "The favorite file \"" + name + _ext + "\"already exists.\n"
                "Do you want to overwrite the existing file?",
                "&Overwrite", "&Cancel", "",
                0,    # Enter == button 0
                1)   # Escape == button 1  
                
                if ret == 0:
                    #overwrite favorite file
                    ok2, text = writeLightingSchemeToFavoritesFile(name)
                    indexOfDuplicateItem = self.favoritesComboBox.findText(name)
                    self.favoritesComboBox.removeItem(indexOfDuplicateItem)
                    print "Add Favorite: removed duplicate favorite item."
                else:
                    env.history.message("Add Favorite: cancelled overwriting favorite item.")              
                    return 
                
            else:
                ok2, text = writeLightingSchemeToFavoritesFile(name)
        else:
            # User cancelled.
            return
        if ok2:
            
            self.favoritesComboBox.addItem(name)
            _lastItem = self.favoritesComboBox.count()
            self.favoritesComboBox.setCurrentIndex(_lastItem - 1)
            msg = "New favorite [%s] added." % (text)
        else:
            msg = "Can't add favorite [%s]: %s" % (name, text) # text is reason why not
        
        env.history.message(msg) 
        
        return
        
    def deleteFavorite(self):
        """
        Deletes the current favorite from the user's personal list of favorites
        (and from disk, only in the favorites folder though).
        
        @note: Cannot delete "Factory default settings".
        """
        currentIndex = self.favoritesComboBox.currentIndex()
        currentText = self.favoritesComboBox.currentText()
        if currentIndex == 0:
            msg = "Cannot delete '%s'." % currentText
        else:
            self.favoritesComboBox.removeItem(currentIndex)
            
            
            # delete file from the disk
            
            deleteFile= getFavoritePathFromBasename( currentText )
            os.remove(deleteFile)
            
            msg = "Deleted favorite named [%s].\n" \
                "and the favorite file [%s.txt]." \
                % (currentText, currentText)
            
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:69,代码来源:LightingScheme_PropertyManager.py

示例12: ProteinDisplayStyle_PropertyManager

# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import setCurrentIndex [as 别名]

#.........这里部分代码省略.........
        colorListStrand = [cyan, yellow, gray, magenta, red, blue, white, black, orange]

        colorNamesStrand = [
            "Cyan(default)",
            "Yellow",
            "Gray",
            "Magenta",
            "Red",
            "Blue",
            "White",
            "Black",
            "Other color...",
        ]

        self.strandColorComboBox = PM_ColorComboBox(
            pmGroupBox,
            colorList=colorListStrand,
            colorNames=colorNamesStrand,
            label="Strand:",
            color=cyan,
            setAsDefault=True,
        )

        self.coilColorComboBox = PM_ColorComboBox(
            pmGroupBox, colorList=colorListAux, colorNames=colorNamesAux, label="Coil:", color=orange, setAsDefault=True
        )

    def updateProteinDisplayStyleWidgets(self):
        """
        Updates all the Protein Display style widgets based on the current pref keys
        values
        
        """
        self.proteinStyleComboBox.setCurrentIndex(env.prefs[proteinStyle_prefs_key])
        self.splineDoubleSpinBox.setValue(env.prefs[proteinStyleQuality_prefs_key])
        if env.prefs[proteinStyleSmooth_prefs_key] == True:
            self.smoothingCheckBox.setCheckState(Qt.Checked)
        else:
            self.smoothingCheckBox.setCheckState(Qt.Unchecked)
        self.scaleComboBox.setCurrentIndex(env.prefs[proteinStyleScaling_prefs_key])
        self.scaleFactorDoubleSpinBox.setValue(env.prefs[proteinStyleScaleFactor_prefs_key])
        self.proteinComponentComboBox.setCurrentIndex(env.prefs[proteinStyleColors_prefs_key])
        self.customColorComboBox.setColor(env.prefs[proteinStyleCustomColor_prefs_key])
        self.proteinAuxComponentComboBox.setCurrentIndex(env.prefs[proteinStyleAuxColors_prefs_key])
        self.auxColorComboBox.setColor(env.prefs[proteinStyleAuxCustomColor_prefs_key])
        if env.prefs[proteinStyleColorsDiscrete_prefs_key] == True:
            self.discColorCheckBox.setCheckState(Qt.Checked)
        else:
            self.discColorCheckBox.setCheckState(Qt.Unchecked)
        self.helixColorComboBox.setColor(env.prefs[proteinStyleHelixColor_prefs_key])
        self.strandColorComboBox.setColor(env.prefs[proteinStyleStrandColor_prefs_key])
        self.coilColorComboBox.setColor(env.prefs[proteinStyleCoilColor_prefs_key])

        return

    def applyFavorite(self):

        # Rules and other info:
        # The user has to press the button related to this method when he loads
        # a previously saved favorite file

        current_favorite = self.favoritesComboBox.currentText()
        if current_favorite == "Factory default settings":
            env.prefs.restore_defaults(proteinDisplayStylePrefsList)
        else:
            favfilepath = getFavoritePathFromBasename(current_favorite)
开发者ID:octopus89,项目名称:NanoEngineer-1,代码行数:70,代码来源:ProteinDisplayStyle_PropertyManager.py


注:本文中的PM.PM_ComboBox.PM_ComboBox.setCurrentIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。