本文整理匯總了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.
"""
示例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
示例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,
示例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
#.........這裏部分代碼省略.........
示例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,
示例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)