本文整理匯總了Python中PM.PM_GroupBox.PM_GroupBox.isEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Python PM_GroupBox.isEnabled方法的具體用法?Python PM_GroupBox.isEnabled怎麽用?Python PM_GroupBox.isEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PM.PM_GroupBox.PM_GroupBox
的用法示例。
在下文中一共展示了PM_GroupBox.isEnabled方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: DnaStrand_PropertyManager
# 需要導入模塊: from PM.PM_GroupBox import PM_GroupBox [as 別名]
# 或者: from PM.PM_GroupBox.PM_GroupBox import isEnabled [as 別名]
#.........這裏部分代碼省略.........
return
self.isAlreadyConnected = isConnect
self.isAlreadyDisconnected = not isConnect
if isConnect:
change_connect = self.win.connect
else:
change_connect = self.win.disconnect
if self.sequenceEditor:
self.sequenceEditor.connect_or_disconnect_signals(isConnect)
_superclass.connect_or_disconnect_signals(self, isConnect)
change_connect(self.disableStructHighlightingCheckbox,
SIGNAL('stateChanged(int)'),
self.change_struct_highlightPolicy)
change_connect(self.showCursorTextCheckBox,
SIGNAL('stateChanged(int)'),
self._update_state_of_cursorTextGroupBox)
def model_changed(self):
"""
@see: DnaStrand_EditCommand.model_changed()
@see: DnaStrand_EditCommand.hasResizableStructure()
"""
isStructResizable, why_not = self.editCommand.hasResizableStructure()
if not isStructResizable:
#disable all widgets
if self._pmGroupBox1.isEnabled():
self._pmGroupBox1.setEnabled(False)
msg1 = ("Viewing properties of %s <br>") %(self.editCommand.struct.name)
msg2 = redmsg("DnaStrand is not resizable. Reason: %s"%(why_not))
self.updateMessage(msg1 + msg2)
else:
if not self._pmGroupBox1.isEnabled():
self._pmGroupBox1.setEnabled(True)
msg1 = ("Viewing properties of %s <br>") %(self.editCommand.struct.name)
msg2 = "Use resize handles to resize the strand. Use sequence editor"\
"to assign a new sequence or the current one to a file."
self.updateMessage(msg1 + msg2)
def show(self):
"""
Show this PM
As of 2007-11-20, it also shows the Sequence Editor widget and hides
the history widget. This implementation may change in the near future
This method also retrives the name information from the
editCommand's structure for its name line edit field.
@see: DnaStrand_EditCommand.getStructureName()
@see: self.close()
"""
_superclass.show(self)
self._showSequenceEditor()
if self.editCommand is not None:
name = self.editCommand.getStructureName()
if name is not None:
self.nameLineEdit.setText(name)
def close(self):
"""
示例2: DnaStrand_PropertyManager
# 需要導入模塊: from PM.PM_GroupBox import PM_GroupBox [as 別名]
# 或者: from PM.PM_GroupBox.PM_GroupBox import isEnabled [as 別名]
#.........這裏部分代碼省略.........
change_connect(self.showCursorTextCheckBox,
SIGNAL('stateChanged(int)'),
self._update_state_of_cursorTextGroupBox)
change_connect(self.nameLineEdit,
SIGNAL("editingFinished()"),
self._nameChanged)
return
def _update_UI_do_updates(self):
"""
@see: Command_PropertyManager. _update_UI_do_updates()
@see: DnaStrand_EditCommand.command_update_UI()
@see: DnaStrand_EditCommand.hasResizableStructure()
"""
if not self.command.hasValidStructure():
print "DnaStrand not a valid structure."
self._pmGroupBox1.setEnabled(False)
self._displayOptionsGroupBox.setEnabled(False)
self.sequenceEditor.updateSequence(strand = " ")
self.sequenceEditor.setEnabled(False)
self.nameLineEdit.setText("")
self.numberOfBasesSpinBox.setValue(0)
return
else:
self._pmGroupBox1.setEnabled(True)
self._displayOptionsGroupBox.setEnabled(True)
self.sequenceEditor.setEnabled(True)
isStructResizable, why_not = self.command.hasResizableStructure()
if not isStructResizable:
#disable all widgets
if self._pmGroupBox1.isEnabled():
self._pmGroupBox1.setEnabled(False)
msg1 = ("Attention: ") % (self.command.struct.name)
msg2 = redmsg("DnaStrand <b>%s</b> is not resizable. Reason: %s" % \
(self.command.struct.name, why_not))
self.updateMessage(msg1 + msg2)
else:
if not self._pmGroupBox1.isEnabled():
self._pmGroupBox1.setEnabled(True)
msg1 = ("Editing <b>%s</b>. ") % (self.command.struct.name)
msg2 = "Use resize handles to resize the strand. "\
"Use the <i>Sequence Editor</i> to edit the sequence."
self.updateMessage(msg1 + msg2)
return
def close(self):
"""
Close this property manager.
Also sets the name of the self.command's structure to the one
displayed in the line edit field.
@see self.show()
@see: DnaSegment_EditCommand.setStructureName
"""
if self.command is not None:
name = str(self.nameLineEdit.text())
self.command.setStructureName(name)
if self.sequenceEditor:
self.sequenceEditor.close()
_superclass.close(self)
return