本文整理汇总了Python中PM.PM_SpinBox.PM_SpinBox.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Python PM_SpinBox.setEnabled方法的具体用法?Python PM_SpinBox.setEnabled怎么用?Python PM_SpinBox.setEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PM.PM_SpinBox.PM_SpinBox
的用法示例。
在下文中一共展示了PM_SpinBox.setEnabled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: BuildProtein_PropertyManager
# 需要导入模块: from PM.PM_SpinBox import PM_SpinBox [as 别名]
# 或者: from PM.PM_SpinBox.PM_SpinBox import setEnabled [as 别名]
#.........这里部分代码省略.........
part = self.win.assy.part
proteinExists, proteinChunk = checkIfProteinChunkInPart(part)
if proteinExists:
#check to see if current_protein is still in part, otherwise set
# this to first available protein
try:
index = self.structureComboBox.findText(self.current_protein)
index1 = self.protein_name_list.index(self.current_protein)
except ValueError:
index = 0
index1 = 0
self.set_current_protein_chunk_name(self.protein_name_list[index1])
self.structureComboBox.setCurrentIndex(index)
proteinChunk = self.protein_chunk_list[index1]
self._numberOfAA = len(proteinChunk.protein.get_sequence_string())
else:
#remove all items from the combo box
count = self.structureComboBox.count()
for i in range(count):
self.structureComboBox.removeItem(0)
self._numberOfAA = 0
self.set_current_protein_chunk_name("")
self.numberOfAASpinBox.setValue(self._numberOfAA)
#get the sequence for this protein chunk
if proteinExists:
sequence = proteinChunk.protein.get_sequence_string()
self.sequenceEditor.setSequence(sequence)
secStructure = proteinChunk.protein.get_secondary_structure_string()
self.sequenceEditor.setSecondaryStructure(secStructure)
self.sequenceEditor.setRuler(len(secStructure))
self.editPropertiesPushButton.setEnabled(True)
else:
self.editPropertiesPushButton.setEnabled(False)
self.sequenceEditor.hide()
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 and self.isAlreadyConnected:
return
if not isConnect and self.isAlreadyDisconnected:
return
self.isAlreadyConnected = isConnect
self.isAlreadyDisconnected = not isConnect
if isConnect:
change_connect = self.win.connect
else:
change_connect = self.win.disconnect
change_connect(self.structureComboBox,
SIGNAL("currentIndexChanged(int)"),
self._updateProteinParameters)
change_connect(self.editPropertiesPushButton,
SIGNAL("clicked()"),
示例2: DnaStrand_PropertyManager
# 需要导入模块: from PM.PM_SpinBox import PM_SpinBox [as 别名]
# 或者: from PM.PM_SpinBox.PM_SpinBox import setEnabled [as 别名]
class DnaStrand_PropertyManager( DnaOrCnt_PropertyManager):
"""
The DnaStrand_PropertyManager class provides a Property Manager
for the DnaStrand_EditCommand.
@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 = "DnaStrand Properties"
iconPath = "ui/actions/Properties Manager/Strand.png"
def __init__( self, command ):
"""
Constructor for the Build DNA property manager.
"""
self.sequenceEditor = None
self._numberOfBases = 0
self._conformation = 'B-DNA'
self.dnaModel = 'PAM3'
_superclass.__init__( self, command)
self.showTopRowButtons( PM_DONE_BUTTON | \
PM_WHATS_THIS_BUTTON)
return
def _addGroupBoxes( self ):
"""
Add group boxes to this PM.
"""
self._pmGroupBox1 = PM_GroupBox( self, title = "Parameters" )
self._loadGroupBox1( self._pmGroupBox1 )
self._displayOptionsGroupBox = PM_GroupBox( self,
title = "Display Options" )
self._loadDisplayOptionsGroupBox( self._displayOptionsGroupBox )
#Sequence Editor. This is NOT a groupbox, needs cleanup. Doing it here
#so that the sequence editor gets connected! Perhaps
#superclass should define _loadAdditionalWidgets. -- Ninad2008-10-03
self._loadSequenceEditor()
return
def _loadGroupBox1(self, pmGroupBox):
"""
Load widgets in group box 1.
"""
self.nameLineEdit = PM_LineEdit( pmGroupBox,
label = "Name:",
text = "",
setAsDefault = False)
self.numberOfBasesSpinBox = \
PM_SpinBox( pmGroupBox,
label = "Number of bases:",
value = self._numberOfBases,
setAsDefault = False,
minimum = 2,
maximum = 10000 )
self.disableStructHighlightingCheckbox = \
PM_CheckBox( pmGroupBox,
text = "Don't highlight while editing DNA",
widgetColumn = 0,
state = Qt.Unchecked,
setAsDefault = True,
spanWidth = True
)
#As of 2008-03-31, the properties such as number of bases will be
#editable only by using the resize handles.
self.numberOfBasesSpinBox.setEnabled(False)
return
def _loadSequenceEditor(self):
"""
Temporary code that shows the Sequence editor ..a doc widget docked
at the bottom of the mainwindow. The implementation is going to change
before 'rattleSnake' product release.
As of 2007-11-20: This feature (sequence editor) is waiting
for the ongoing dna model work to complete.
"""
self.sequenceEditor = self.win.createDnaSequenceEditorIfNeeded()
self.sequenceEditor.hide()
return
def _loadDisplayOptionsGroupBox(self, pmGroupBox):
"""
#.........这里部分代码省略.........
示例3: DnaStrand_PropertyManager
# 需要导入模块: from PM.PM_SpinBox import PM_SpinBox [as 别名]
# 或者: from PM.PM_SpinBox.PM_SpinBox import setEnabled [as 别名]
#.........这里部分代码省略.........
self.basesPerTurnDoubleSpinBox = \
PM_DoubleSpinBox( pmGroupBox,
label = "Bases per turn:",
value = self.basesPerTurn,
setAsDefault = True,
minimum = 8.0,
maximum = 20.0,
decimals = 2,
singleStep = 0.1 )
self.duplexRiseDoubleSpinBox = \
PM_DoubleSpinBox( pmGroupBox,
label = "Rise:",
value = self.duplexRise,
setAsDefault = True,
minimum = 2.0,
maximum = 4.0,
decimals = 3,
singleStep = 0.01 )
self.disableStructHighlightingCheckbox = \
PM_CheckBox( pmGroupBox,
text = "Don't highlight while editing DNA",
widgetColumn = 0,
state = Qt.Unchecked,
setAsDefault = True,
spanWidth = True
)
#As of 2008-03-31, the properties such as number of bases will be
#editable only by using the resize handles. post FNANO we will support
#the
self.numberOfBasesSpinBox.setEnabled(False)
self.basesPerTurnDoubleSpinBox.setEnabled(False)
self.duplexRiseDoubleSpinBox.setEnabled(False)
def _loadSequenceEditor(self):
"""
Temporary code that shows the Sequence editor ..a doc widget docked
at the bottom of the mainwindow. The implementation is going to change
before 'rattleSnake' product release.
As of 2007-11-20: This feature (sequence editor) is waiting
for the ongoing dna model work to complete.
"""
self.sequenceEditor = self.win.createDnaSequenceEditorIfNeeded()
self.sequenceEditor.hide()
def _loadDisplayOptionsGroupBox(self, pmGroupBox):
"""
Overrides superclass method.
Also loads the color chooser widget.
"""
self._loadColorChooser(pmGroupBox)
_superclass._loadDisplayOptionsGroupBox(self, pmGroupBox)
def _connect_showCursorTextCheckBox(self):
"""
Connect the show cursor text checkbox with user prefs_key.
Overrides
DnaOrCnt_PropertyManager._connect_showCursorTextCheckBox
"""
示例4: BuildProtein_PropertyManager
# 需要导入模块: from PM.PM_SpinBox import PM_SpinBox [as 别名]
# 或者: from PM.PM_SpinBox.PM_SpinBox import setEnabled [as 别名]
class BuildProtein_PropertyManager( EditCommand_PM, DebugMenuMixin ):
"""
The BuildDna_PropertyManager class provides a Property Manager
for the B{Build > DNA } 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 = "Build Protein"
pmName = title
#change this ico path later
iconPath = "ui/actions/Tools/Build Structures/Peptide.png"
def __init__( self, win, editCommand ):
"""
Constructor for the Build DNA property manager.
"""
#For model changed signal
self.previousSelectionParams = None
#Urmi 20080713: set the protein chunk name and its length
#for the first available chunk and not the selected one, that's
#not implemented as yet
#self.showProteinParametersAndSequenceEditorForInit(win)
#see self.connect_or_disconnect_signals for comment about this flag
self.isAlreadyConnected = False
self.isAlreadyDisconnected = False
EditCommand_PM.__init__( self,
win,
editCommand)
DebugMenuMixin._init1( self )
self.showTopRowButtons( PM_DONE_BUTTON | \
PM_CANCEL_BUTTON | \
PM_WHATS_THIS_BUTTON)
def show(self):
self.showProteinParametersAndSequenceEditor(self.win)
EditCommand_PM.show(self)
return
def close(self):
self.sequenceEditor.hide()
env.history.statusbar_msg("")
EditCommand_PM.close(self)
return
def showProteinParametersAndSequenceEditor(self, win):
"""
Show/ Hide protein parameters and sequence editor based
"""
part = win.assy.part
from simulation.ROSETTA.rosetta_commandruns import checkIfProteinChunkInPart
proteinExists, proteinChunk = checkIfProteinChunkInPart(part)
if proteinExists:
self._proteinChunkName = proteinChunk.protein.get_pdb_id() + proteinChunk.protein.get_chain_id()
self._numberOfAA = len(proteinChunk.protein.get_sequence_string())
else:
self._proteinChunkName = ''
self._numberOfAA = 0
self.nameLineEdit.setText(self._proteinChunkName)
self.numberOfAASpinBox.setValue(self._numberOfAA)
if proteinExists:
self.nameLineEdit.setEnabled(True)
else:
self.nameLineEdit.setEnabled(False)
self.sequenceEditor = win.createProteinSequenceEditorIfNeeded()
#get the sequence for this protein chunk
if proteinExists:
sequence = proteinChunk.protein.get_sequence_string()
self.sequenceEditor.setSequence(sequence)
secStructure = proteinChunk.protein.get_secondary_structure_string()
self.sequenceEditor.setSecondaryStructure(secStructure)
self.sequenceEditor.setRuler(len(secStructure))
self.sequenceEditor.show()
else:
self.sequenceEditor.hide()
def connect_or_disconnect_signals(self, isConnect):
#.........这里部分代码省略.........