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


Python PM_ToolButton.setCheckable方法代码示例

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


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

示例1: MultipleDnaSegmentResize_PropertyManager

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

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

    def _addGroupBoxes( self ):
        """
        Add the Property Manager group boxes.
        """                
        self._pmGroupBox1 = PM_GroupBox( self, title = "Segments for Resizing" )
        self._loadGroupBox1( self._pmGroupBox1 )
        
        self._displayOptionsGroupBox = PM_GroupBox( self, 
                                                    title = "Display Options" )
        self._loadDisplayOptionsGroupBox( self._displayOptionsGroupBox )
        

    def _loadGroupBox1(self, pmGroupBox):
        """
        load widgets in groupbox1
        """
        self.segmentListWidget = PM_SelectionListWidget(
            pmGroupBox,
            self.win,
            label = "",
            heightByRows = 12)
      
        self.segmentListWidget.setFocusPolicy(Qt.StrongFocus)
        self.segmentListWidget.setFocus()
        self.setFocusPolicy(Qt.StrongFocus)       
        
        self.addSegmentsToolButton = PM_ToolButton(
                        pmGroupBox, 
                        text = "Add segments to the list",
                        iconPath  = "ui/actions/Properties Manager"\
                        "/AddSegment_To_ResizeSegmentList.png",
                        spanWidth = True  )
        self.addSegmentsToolButton.setCheckable(True)
        self.addSegmentsToolButton.setAutoRaise(True)
        
        self.removeSegmentsToolButton = PM_ToolButton(
                        pmGroupBox, 
                        text = "Remove segments from the list",
                        iconPath  = "ui/actions/Properties Manager"\
                        "/RemoveSegment_From_ResizeSegmentList.png",
                        spanWidth = True  )
        self.removeSegmentsToolButton.setCheckable(True)
        self.removeSegmentsToolButton.setAutoRaise(True)
        
        #Widgets to include in the widget row. 
        widgetList = [
            ('QLabel', "  Add/Remove Segments:", 0),
            ('QSpacerItem', 5, 5, 1),
            ('PM_ToolButton', self.addSegmentsToolButton, 2),
             ('QSpacerItem', 5, 5, 3),
            ('PM_ToolButton', self.removeSegmentsToolButton, 4),                      
            ('QSpacerItem', 5, 5, 5) ]
        
        widgetRow = PM_WidgetRow(pmGroupBox,
                                 title     = '',
                                 widgetList = widgetList,
                                 label = "",
                                 spanWidth = True )
        
        
    def _addWhatsThisText(self):
        """
        Add what's this text. 
        Abstract method.
        """
开发者ID:elfion,项目名称:nanoengineer,代码行数:70,代码来源:MultipleDnaSegmentResize_PropertyManager.py

示例2: PM_ObjectChooser

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

#.........这里部分代码省略.........
                       self.activateAddTool)
        change_connect(self._removeToolButton, 
                       SIGNAL("toggled(bool)"), 
                       self.activateRemoveTool)
        
    
    def _loadWidgets(self):
        """
        """
        self._loadSelectionListWidget()
        self._loadAddRemoveButtons()
        
    def _loadSelectionListWidget(self):
        """
        """
        self._listWidget = PM_SelectionListWidget(
            self,
            self.win,
            label = "",
            heightByRows = 12)
      
        self._listWidget.setFocusPolicy(Qt.StrongFocus)
        self._listWidget.setFocus()
        self.setFocusPolicy(Qt.StrongFocus)       
            
    def _loadAddRemoveButtons(self):
        """
        """
        self._addToolButton = PM_ToolButton(
                        self, 
                        text = "Add items to the list",
                        iconPath  = self._addIcon,
                        spanWidth = True  )
        self._addToolButton.setCheckable(True)
        self._addToolButton.setAutoRaise(True)
        
        self._removeToolButton = PM_ToolButton(
                        self, 
                        text = "Remove items from the list",
                        iconPath  = self._removeIcon,
                        spanWidth = True  )
        self._removeToolButton.setCheckable(True)
        self._removeToolButton.setAutoRaise(True)
        
        #Widgets to include in the widget row. 
        widgetList = [
            ('QLabel', "  Add/Remove Items:", 0),
            ('QSpacerItem', 5, 5, 1),
            ('PM_ToolButton', self._addToolButton, 2),
             ('QSpacerItem', 5, 5, 3),
            ('PM_ToolButton', self._removeToolButton, 4),                      
            ('QSpacerItem', 5, 5, 5) ]
        
        widgetRow = PM_WidgetRow(self,
                                 title     = '',
                                 widgetList = widgetList,
                                 label = "",
                                 spanWidth = True )
    
    def isAddToolActive(self): 
        """
        Returns True if the add objects tool is active.
        """
            
        if self._addToolButton.isChecked():
            #For safety
开发者ID:elfion,项目名称:nanoengineer,代码行数:70,代码来源:PM_ObjectChooser.py

示例3: Ui_MovePropertyManager

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

#.........这里部分代码省略.........
              "ui/actions/Properties Manager/TranslateX.png", "", "X", 1),
            ( "QToolButton", 3,  "TRANSY",  
              "ui/actions/Properties Manager/TranslateY.png", "", "Y", 2),
            ( "QToolButton", 4,  "TRANSZ",  
              "ui/actions/Properties Manager/TranslateZ.png", "", "Z", 3),
            ( "QToolButton", 5,  "ROT_TRANS_ALONG_AXIS",  
              "ui/actions/Properties Manager/translate+rotate-A.png", "", \
              "A", 4)
                        
            ]
            
        self.freeDragTranslateButtonGroup = \
            PM_ToolButtonRow( inPmGroupBox, 
                               title        = "",
                               buttonList   = BUTTON_LIST,
                               checkedId    = 1,
                               setAsDefault = True,
                               )
        self.transFreeButton =self.freeDragTranslateButtonGroup.getButtonById(1)
        self.transXButton = self.freeDragTranslateButtonGroup.getButtonById(2)
        self.transYButton = self.freeDragTranslateButtonGroup.getButtonById(3)
        self.transZButton = self.freeDragTranslateButtonGroup.getButtonById(4)
        self.transAlongAxisButton = \
            self.freeDragTranslateButtonGroup.getButtonById(5)
        
        self.moveFromToButton = PM_ToolButton(
                    inPmGroupBox, 
                    text = "Translate from/to",
                    iconPath  = "ui/actions/Properties Manager"\
                    "/Translate_Components.png",
                    spanWidth = True
                    
                    )
        self.moveFromToButton.setCheckable(True)
        self.moveFromToButton.setAutoRaise(True)
        self.moveFromToButton.setToolButtonStyle(
            Qt.ToolButtonTextBesideIcon)
        
        
        self.startCoordLineEdit = PM_LineEdit( 
            inPmGroupBox, 
            label        = "ui/actions/Properties Manager"\
                    "/Move_Start_Point.png",
            text         = "Define 'from' and 'to' points",
            setAsDefault = False,
            )
        self.startCoordLineEdit.setReadOnly(True)
        self.startCoordLineEdit.setEnabled(False)
        
    def _loadByDeltaGroupBox(self, inPmGroupBox):
        """
        Load widgets in the translate By Delta group box, which is present 
        within the Translate groupbox.
        @param inPmGroupBox: The Translate By Delta group box in the translate 
                             group box. 
        @type  inPmGroupBox: L{PM_GroupBox}
        """

        self.moveDeltaXSpinBox = \
            PM_DoubleSpinBox( 
                inPmGroupBox, 
                label        = "ui/actions/Properties Manager/Delta_X.png",
                value        = 0.0, 
                setAsDefault = True,
                minimum      = -100.0, 
                maximum      =  100.0, 
开发者ID:elfion,项目名称:nanoengineer,代码行数:70,代码来源:Ui_MovePropertyManager.py

示例4: _loadSegmentListWidget

# 需要导入模块: from PM.PM_ToolButton import PM_ToolButton [as 别名]
# 或者: from PM.PM_ToolButton.PM_ToolButton import setCheckable [as 别名]
class ListWidgetItems_PM_Mixin:


    def _loadSegmentListWidget(self, pmGroupBox):
        self.segmentListWidget = PM_SelectionListWidget(
            pmGroupBox,
            self.win,
            label = "",
            heightByRows = 12)

        self.segmentListWidget.setFocusPolicy(Qt.StrongFocus)
        self.segmentListWidget.setFocus()
        self.setFocusPolicy(Qt.StrongFocus)

        self.addSegmentsToolButton = PM_ToolButton(
                        pmGroupBox,
                        text = "Add segments to the list",
                        iconPath  = "ui/actions/Properties Manager"\
                        "/AddSegment_To_ResizeSegmentList.png",
                        spanWidth = True  )
        self.addSegmentsToolButton.setCheckable(True)
        self.addSegmentsToolButton.setAutoRaise(True)

        self.removeSegmentsToolButton = PM_ToolButton(
                        pmGroupBox,
                        text = "Remove segments from the list",
                        iconPath  = "ui/actions/Properties Manager"\
                        "/RemoveSegment_From_ResizeSegmentList.png",
                        spanWidth = True  )
        self.removeSegmentsToolButton.setCheckable(True)
        self.removeSegmentsToolButton.setAutoRaise(True)

        #Widgets to include in the widget row.
        widgetList = [
            ('QLabel', "  Add/Remove Segments:", 0),
            ('QSpacerItem', 5, 5, 1),
            ('PM_ToolButton', self.addSegmentsToolButton, 2),
             ('QSpacerItem', 5, 5, 3),
            ('PM_ToolButton', self.removeSegmentsToolButton, 4),
            ('QSpacerItem', 5, 5, 5) ]

        widgetRow = PM_WidgetRow(pmGroupBox,
                                 title     = '',
                                 widgetList = widgetList,
                                 label = "",
                                 spanWidth = True )

    def listWidgetHasFocus(self):
        """
        Checks if the list widget that lists dnasegments (that will undergo
        special operations such as 'resizing them at once or making
        crossovers between the segments etc) has the
        Qt focus. This is used to just remove items from the list widget
        (without actually 'deleting' the corresponding Dnasegment in the GLPane)
        @see: MultipleDnaSegment_GraphicsMode.keyPressEvent() where it is called
        """
        if self.segmentListWidget.hasFocus():
            return True
        return False


    def updateListWidgets(self):
        self.updateSegmentListWidget()

    def updateSegmentListWidget(self):
        """
        Update the list of segments shown in the segments list widget
        @see: self.updateListWidgets, self.updateStrandListWidget
        """

        segmentList = []

        segmentList = self.command.getSegmentList()


        if segmentList:
            self.segmentListWidget.insertItems(
                row = 0,
                items = segmentList)
        else:
            self.segmentListWidget.clear()



    def isAddSegmentsToolActive(self):
        """
        Returns True if the add segments tool (which adds the segments to the
        list of segments) is active
        """

        if self.addSegmentsToolButton.isChecked():
            #For safety
            if not self.removeSegmentsToolButton.isChecked():
                return True

        return False

    def isRemoveSegmentsToolActive(self):
        """
        Returns True if the remove segments tool (which removes the segments
#.........这里部分代码省略.........
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:103,代码来源:ListWidgetItems_PM_Mixin.py

示例5: InsertNanotube_PropertyManager

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

#.........这里部分代码省略.........
        self._pmGroupBox1.hide()

        self._pmGroupBox2 = PM_GroupBox( self, title = "Parameters" )
        self._loadGroupBox2( self._pmGroupBox2 )

        self._displayOptionsGroupBox = PM_GroupBox( self,
                                                    title = "Display Options" )
        self._loadDisplayOptionsGroupBox( self._displayOptionsGroupBox )

        self._pmGroupBox3 = PM_GroupBox( self, title = "Nanotube Distortion" )
        self._loadGroupBox3( self._pmGroupBox3 )
        self._pmGroupBox3.hide() #@ Temporary.

        self._pmGroupBox4 = PM_GroupBox( self, title = "Multi-Walled CNTs" )
        self._loadGroupBox4( self._pmGroupBox4 )
        self._pmGroupBox4.hide() #@ Temporary.

        self._pmGroupBox5 = PM_GroupBox( self, title = "Advanced Options" )
        self._loadGroupBox5( self._pmGroupBox5 )
        self._pmGroupBox5.hide() #@ Temporary.

    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in group box 1.
        """
        #Following toolbutton facilitates entering a temporary NanotubeLineMode
        #to create a CNT using endpoints of the specified line.
        self.specifyCntLineButton = PM_ToolButton(
            pmGroupBox,
            text = "Specify Endpoints",
            iconPath  = "ui/actions/Properties Manager/Pencil.png",
            spanWidth = True
        )
        self.specifyCntLineButton.setCheckable(True)
        self.specifyCntLineButton.setAutoRaise(True)
        self.specifyCntLineButton.setToolButtonStyle(
            Qt.ToolButtonTextBesideIcon)

        #EndPoint1 and endPoint2 coordinates. These widgets are hidden
        # as of 2007- 12 - 05
        self._endPoint1SpinBoxes = PM_CoordinateSpinBoxes(pmGroupBox,
                                                label = "End Point 1")
        self.x1SpinBox = self._endPoint1SpinBoxes.xSpinBox
        self.y1SpinBox = self._endPoint1SpinBoxes.ySpinBox
        self.z1SpinBox = self._endPoint1SpinBoxes.zSpinBox

        self._endPoint2SpinBoxes = PM_CoordinateSpinBoxes(pmGroupBox,
                                                label = "End Point 2")
        self.x2SpinBox = self._endPoint2SpinBoxes.xSpinBox
        self.y2SpinBox = self._endPoint2SpinBoxes.ySpinBox
        self.z2SpinBox = self._endPoint2SpinBoxes.zSpinBox

        self._endPoint1SpinBoxes.hide()
        self._endPoint2SpinBoxes.hide()

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

        _ntTypeChoices = ['Carbon',
                          'Boron Nitride']
        self.ntTypeComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Type:",
                         choices       =  _ntTypeChoices,
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:70,代码来源:InsertNanotube_PropertyManager.py

示例6: DnaDuplexPropertyManager

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

#.........这里部分代码省略.........
    def _addGroupBoxes( self ):
        """
        Add the DNA Property Manager group boxes.
        """
        self._pmReferencePlaneGroupBox = PM_GroupBox( self,
                                                      title = "Placement Options" )
        self._loadReferencePlaneGroupBox( self._pmReferencePlaneGroupBox )

        self._pmGroupBox1 = PM_GroupBox( self, title = "Endpoints" )
        self._loadGroupBox1( self._pmGroupBox1 )

        self._pmGroupBox1.hide()

        self._pmGroupBox2 = PM_GroupBox( self, title = "Parameters" )
        self._loadGroupBox2( self._pmGroupBox2 )

        self._displayOptionsGroupBox = PM_GroupBox( self,
                                                    title = "Display Options" )
        self._loadDisplayOptionsGroupBox( self._displayOptionsGroupBox )


    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in group box 3.
        """
        #Folllowing toolbutton facilitates entering a temporary DnaLineMode
        #to create a DNA using endpoints of the specified line.
        self.specifyDnaLineButton = PM_ToolButton(
            pmGroupBox,
            text = "Specify Endpoints",
            iconPath  = "ui/actions/Properties Manager/Pencil.png",
            spanWidth = True
        )
        self.specifyDnaLineButton.setCheckable(True)
        self.specifyDnaLineButton.setAutoRaise(True)
        self.specifyDnaLineButton.setToolButtonStyle(
            Qt.ToolButtonTextBesideIcon)

        #EndPoint1 and endPoint2 coordinates. These widgets are hidden
        # as of 2007- 12 - 05
        self._endPoint1SpinBoxes = PM_CoordinateSpinBoxes(pmGroupBox,
                                                          label = "End Point 1")
        self.x1SpinBox = self._endPoint1SpinBoxes.xSpinBox
        self.y1SpinBox = self._endPoint1SpinBoxes.ySpinBox
        self.z1SpinBox = self._endPoint1SpinBoxes.zSpinBox

        self._endPoint2SpinBoxes = PM_CoordinateSpinBoxes(pmGroupBox,
                                                          label = "End Point 2")
        self.x2SpinBox = self._endPoint2SpinBoxes.xSpinBox
        self.y2SpinBox = self._endPoint2SpinBoxes.ySpinBox
        self.z2SpinBox = self._endPoint2SpinBoxes.zSpinBox

        self._endPoint1SpinBoxes.hide()
        self._endPoint2SpinBoxes.hide()

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

        self.conformationComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Conformation:",
                         choices       =  ["B-DNA"],
                         setAsDefault  =  True)
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:69,代码来源:DnaDuplexPropertyManager.py


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