本文整理汇总了Python中PM.PM_LineEdit.PM_LineEdit.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Python PM_LineEdit.setEnabled方法的具体用法?Python PM_LineEdit.setEnabled怎么用?Python PM_LineEdit.setEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PM.PM_LineEdit.PM_LineEdit
的用法示例。
在下文中一共展示了PM_LineEdit.setEnabled方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Ui_BuildAtomsPropertyManager
# 需要导入模块: from PM.PM_LineEdit import PM_LineEdit [as 别名]
# 或者: from PM.PM_LineEdit.PM_LineEdit import setEnabled [as 别名]
#.........这里部分代码省略.........
index = 0,
setAsDefault = False,
spanWidth = True )
#Following fixes bug 2550
self.atomChooserComboBox.setFocusPolicy(Qt.NoFocus)
self._addElementChooserGroupBox(inPmGroupBox)
self._add_PAM5_AtomChooserGroupBox(inPmGroupBox)
self._add_PAM3_AtomChooserGroupBox(inPmGroupBox)
def _loadSelectionOptionsGroupBox(self, inPmGroupBox):
"""
Load widgets in the Selection Options group box.
@param inPmGroupBox: The Selection Options box in the PM
@type inPmGroupBox: L{PM_GroupBox}
"""
self.selectionFilterCheckBox = \
PM_CheckBox( inPmGroupBox,
text = "Enable atom selection filter",
widgetColumn = 0,
state = Qt.Unchecked )
self.selectionFilterCheckBox.setDefaultValue(False)
self.filterlistLE = PM_LineEdit( inPmGroupBox,
label = "",
text = "",
setAsDefault = False,
spanWidth = True )
self.filterlistLE.setReadOnly(True)
if self.selectionFilterCheckBox.isChecked():
self.filterlistLE.setEnabled(True)
else:
self.filterlistLE.setEnabled(False)
self.showSelectedAtomInfoCheckBox = \
PM_CheckBox(
inPmGroupBox,
text = "Show Selected Atom Info",
widgetColumn = 0,
state = Qt.Unchecked)
self.selectedAtomPosGroupBox = \
PM_GroupBox( inPmGroupBox, title = "")
self._loadSelectedAtomPosGroupBox(self.selectedAtomPosGroupBox)
self.toggle_selectedAtomPosGroupBox(show = 0)
self.enable_or_disable_selectedAtomPosGroupBox( bool_enable = False)
self.reshapeSelectionCheckBox = \
PM_CheckBox( inPmGroupBox,
text = 'Dragging reshapes selection',
widgetColumn = 0,
state = Qt.Unchecked )
connect_checkbox_with_boolean_pref( self.reshapeSelectionCheckBox,
reshapeAtomsSelection_prefs_key )
env.prefs[reshapeAtomsSelection_prefs_key] = False
self.waterCheckBox = \
PM_CheckBox( inPmGroupBox,
text = "Z depth filter (water surface)",
widgetColumn = 0,
示例2: Ui_MovePropertyManager
# 需要导入模块: from PM.PM_LineEdit import PM_LineEdit [as 别名]
# 或者: from PM.PM_LineEdit.PM_LineEdit import setEnabled [as 别名]
#.........这里部分代码省略.........
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,
singleStep = 1.0,
decimals = 3,
suffix = ' Angstroms',
spanWidth = False )
self.moveDeltaYSpinBox = \
PM_DoubleSpinBox(
inPmGroupBox,
label = "ui/actions/Properties Manager/Delta_Y.png",
value = 0.0,
setAsDefault = True,
minimum = -100.0,
maximum = 100.0,
singleStep = 1.0,
示例3: EditNanotube_PropertyManager
# 需要导入模块: from PM.PM_LineEdit import PM_LineEdit [as 别名]
# 或者: from PM.PM_LineEdit.PM_LineEdit import setEnabled [as 别名]
#.........这里部分代码省略.........
# Nanotube chirality. These are disabled (read-only) for now. --Mark
self.chiralityNSpinBox = \
PM_SpinBox( pmGroupBox,
label = "Chirality (n) :",
minimum = 2,
maximum = 100,
setAsDefault = True )
self.chiralityNSpinBox.setDisabled(True)
self.chiralityMSpinBox = \
PM_SpinBox( pmGroupBox,
label = "Chirality (m) :",
minimum = 0,
maximum = 100,
setAsDefault = True )
self.chiralityMSpinBox.setDisabled(True)
def _addWhatsThisText(self):
"""
Add what's this text.
"""
pass
def _addToolTipText(self):
"""
Add Tooltip text
"""
pass
def _nameChanged(self):
"""
Slot for "Name" field.
@TODO: Include a validator for the name field.
"""
_name = str(self.nameLineEdit.text())
if not _name: # Minimal test. Need to implement a validator.
self.updateNameField()
return
self.command.setStructureName(_name)
msg = "Editing structure <b>%s</b>." % _name
self.updateMessage(msg)
return
def updateNameField(self):
"""
Update the name field showing the name of the currently selected protein.
clear the combobox list.
"""
if self.command.hasValidStructure():
self.nameLineEdit.setEnabled(True)
self.nameLineEdit.setText(self.command.getStructureName())
else:
self.nameLineEdit.setDisabled(True)
self.nameLineEdit.setText("")
return
def updateLength( self ):
"""
Update the nanotube Length lineEdit widget.
"""
if self.command.hasValidStructure():
_nanotubeLength = vlen(self.endPoint1 - self.endPoint2)
_lengthText = "%-7.4f Angstroms" % (_nanotubeLength)
else:
_lengthText = ""
self.ntLengthLineEdit.setText(_lengthText)
return
def updateNanotubeDiameter(self):
"""
Update the nanotube Diameter lineEdit widget.
"""
if self.command.hasValidStructure():
_diameterText = "%-7.4f Angstroms" % (self.nanotube.getDiameter())
else:
_diameterText = ""
self.ntDiameterLineEdit.setText(_diameterText)
return
def updateChirality( self ):
"""
Update the nanotube chirality spinboxes (read-only).
"""
if self.command.hasValidStructure():
n, m = self.nanotube.getChirality()
else:
n = 0
m = 0
self.chiralityNSpinBox.setValue(n)
self.chiralityMSpinBox.setValue(m)
return
pass # End of EditNanotube_PropertyManager class
示例4: CompareProteins_PropertyManager
# 需要导入模块: from PM.PM_LineEdit import PM_LineEdit [as 别名]
# 或者: from PM.PM_LineEdit.PM_LineEdit import setEnabled [as 别名]
#.........这里部分代码省略.........
# Force the Global Display Style to "Protein" since this is the only way
# to see comparisons. The global display style will be restored when leaving
# this command (via self.close()).
self.originalDisplayStyle = self.o.displayMode
self.o.setGlobalDisplayStyle(diPROTEIN)
return
def _addGroupBoxes(self):
"""
Add the Property Manager group boxes.
"""
self._pmGroupBox1 = PM_GroupBox(self, title="Compare")
self._loadGroupBox1(self._pmGroupBox1)
return
def _addWhatsThisText(self):
"""
What's This text for widgets in this Property Manager.
"""
pass
def _addToolTipText(self):
"""
Tool Tip text for widgets in this Property Manager.
"""
pass
def _loadGroupBox1(self, pmGroupBox):
"""
Load widgets in group box.
"""
self.structure1LineEdit = PM_LineEdit(pmGroupBox, label="First structure:", setAsDefault=False)
self.structure1LineEdit.setEnabled(False)
self.structure2LineEdit = PM_LineEdit(pmGroupBox, label="Second structure:", setAsDefault=False)
self.structure2LineEdit.setEnabled(False)
self.thresholdDoubleSpinBox = PM_DoubleSpinBox(
pmGroupBox,
label="Threshold:",
value=self.threshold,
setAsDefault=True,
minimum=0.0,
maximum=360.0,
decimals=1,
singleStep=30.0,
suffix=" deg",
spanWidth=False,
)
self.comparePushButton = PM_PushButton(pmGroupBox, text="Compare", setAsDefault=True)
self.hidePushButton = PM_PushButton(pmGroupBox, text="Hide differences", setAsDefault=True)
return
def _compareProteins(self):
"""
Slot for Compare button.
Compares two selected proteins of the same length.
Amino acids that differ greater than the "threshold"
value are displayed in two colors (red for the first protein
and yellow for the second protein) and are only visible when
the two proteins are displayed in the
reduced display style.
示例5: OrderDna_PropertyManager
# 需要导入模块: from PM.PM_LineEdit import PM_LineEdit [as 别名]
# 或者: from PM.PM_LineEdit.PM_LineEdit import setEnabled [as 别名]
#.........这里部分代码省略.........
def close(self):
"""
Closes the Property Manager. Overrides PM_Dialog.close.
"""
self.connect_or_disconnect_signals(False)
PM_Dialog.close(self)
def _addGroupBoxes( self ):
"""
Add the Property Manager group boxes.
"""
self._pmGroupBox1 = PM_GroupBox( self, title = "Options" )
self._loadGroupBox1( self._pmGroupBox1 )
def _loadGroupBox1(self, pmGroupBox):
"""
Load widgets in group box.
"""
includeStrandsChoices = ["All strands in model",
"Selected strands only"]
self.includeStrandsComboBox = \
PM_ComboBox( pmGroupBox,
label = "Include strands:",
choices = includeStrandsChoices,
setAsDefault = True)
self.numberOfBasesLineEdit = \
PM_LineEdit( pmGroupBox,
label = "Number of bases:",
text = str(self.getNumberOfBases()))
self.numberOfBasesLineEdit.setEnabled(False)
self.viewDnaOrderFileButton = \
PM_PushButton( pmGroupBox,
label = "",
text = "View DNA Order File...",
spanWidth = True)
def _addWhatsThisText( self ):
"""
What's This text for widgets in the DNA Property Manager.
"""
pass
def _addToolTipText(self):
"""
Tool Tip text for widgets in the DNA Property Manager.
"""
pass
# Ask Bruce where this should live (i.e. class Part?) --Mark
def getAllDnaStrands(self, selectedOnly = False):
"""
Returns a list of all the DNA strands in the current part, or only
the selected strands if I{selectedOnly} is True.
@param selectedOnly: If True, return only the selected DNA strands.
@type selectedOnly: bool
"""
dnaStrandList = []
def func(node):
示例6: OrderDna_PropertyManager
# 需要导入模块: from PM.PM_LineEdit import PM_LineEdit [as 别名]
# 或者: from PM.PM_LineEdit.PM_LineEdit import setEnabled [as 别名]
class OrderDna_PropertyManager(Command_PropertyManager):
"""
The OrderDna_PropertyManager class provides a Property Manager
for the B{Order Dna} command on the flyout toolbar in the
Build > Dna mode.
@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 = "Order DNA"
pmName = title
iconPath = "ui/actions/Command Toolbar/BuildDna/OrderDna.png"
def __init__( self, command ):
"""
Constructor for the property manager.
"""
_superclass.__init__(self, command)
self.assy = self.win.assy
self.showTopRowButtons( PM_DONE_BUTTON | \
PM_WHATS_THIS_BUTTON)
self.update_includeStrands() # Updates the message box.
return
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.viewDnaOrderFileButton,
SIGNAL("clicked()"),
self.viewDnaOrderFile)
change_connect( self.includeStrandsComboBox,
SIGNAL("activated(int)"),
self.update_includeStrands )
return
def _addGroupBoxes( self ):
"""
Add the Property Manager group boxes.
"""
self._pmGroupBox1 = PM_GroupBox( self, title = "Options" )
self._loadGroupBox1( self._pmGroupBox1 )
def _loadGroupBox1(self, pmGroupBox):
"""
Load widgets in group box.
"""
includeStrandsChoices = ["All strands in model",
"Selected strands only"]
self.includeStrandsComboBox = \
PM_ComboBox( pmGroupBox,
label = "Include strands:",
choices = includeStrandsChoices,
setAsDefault = True)
self.numberOfBasesLineEdit = \
PM_LineEdit( pmGroupBox,
label = "Total nucleotides:",
text = str(self.getNumberOfBases()))
self.numberOfBasesLineEdit.setEnabled(False)
self.numberOfXBasesLineEdit = \
PM_LineEdit( pmGroupBox,
label = "Unassigned:",
text = str(self.getNumberOfBases(unassignedOnly = True)))
self.numberOfXBasesLineEdit.setEnabled(False)
self.viewDnaOrderFileButton = \
PM_PushButton( pmGroupBox,
label = "",
text = "View DNA Order File...",
spanWidth = True)
return
#.........这里部分代码省略.........