本文整理汇总了Python中PM.PM_ComboBox.PM_ComboBox.currentText方法的典型用法代码示例。如果您正苦于以下问题:Python PM_ComboBox.currentText方法的具体用法?Python PM_ComboBox.currentText怎么用?Python PM_ComboBox.currentText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PM.PM_ComboBox.PM_ComboBox
的用法示例。
在下文中一共展示了PM_ComboBox.currentText方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ColorScheme_PropertyManager
# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import currentText [as 别名]
#.........这里部分代码省略.........
def chooseCustomBackgroundColor(self):
"""
Choose a custom background color.
"""
c = QColorDialog.getColor(RGBf_to_QColor(self.win.glpane.getBackgroundColor()), self)
if c.isValid():
self.win.glpane.setBackgroundColor(QColor_to_RGBf(c))
self.updateCustomColorItemIcon(c)
else:
# User cancelled. Need to reset combobox to correct index.
self._updateBackgroundColorComboBoxIndex()
return
def updateCustomColorItemIcon(self, qcolor):
"""
Update the custom color item icon in the background color combobox
with I{qcolor}.
"""
pixmap = QPixmap(16, 16)
pixmap.fill(qcolor)
self.backgroundColorComboBox.setItemIcon(bg_CUSTOM, QIcon(pixmap))
return
def applyFavorite(self):
"""
Apply the color scheme settings stored in the current favorite
(selected in the combobox) to the current color scheme settings.
"""
# Rules and other info:
# The user has to press the button related to this method when he loads
# a previously saved favorite file
current_favorite = self.favoritesComboBox.currentText()
if current_favorite == 'Factory default settings':
env.prefs.restore_defaults(colorSchemePrefsList)
# set it back to blue sky
self.win.glpane.setBackgroundGradient(1)
else:
favfilepath = getFavoritePathFromBasename(current_favorite)
loadFavoriteFile(favfilepath)
if env.prefs[backgroundGradient_prefs_key]:
self.win.glpane.setBackgroundGradient(env.prefs[backgroundGradient_prefs_key])
else:
self.win.glpane.setBackgroundColor(env.prefs[backgroundColor_prefs_key])
#self.hoverHighlightingColorComboBox.setColor(env.prefs[hoverHighlightingColor_prefs_key])
#self.selectionColorComboBox.setColor(env.prefs[selectionColor_prefs_key])
self._updateAllWidgets()
self.win.glpane.gl_update()
return
def addFavorite(self):
"""
Adds a new favorite to the user's list of favorites.
"""
# Rules and other info:
# - The new favorite is defined by the current color scheme
# settings.
# - The user is prompted to type in a name for the new
# favorite.
# - The color scheme settings are written to a file in a special
# directory on the disk
# (i.e. $HOME/Nanorex/Favorites/ColorScheme/$FAV_NAME.txt).
# - The name of the new favorite is added to the list of favorites in
# the combobox, which becomes the current option.
示例2: DnaGeneratorPropertyManager
# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import currentText [as 别名]
#.........这里部分代码省略.........
A = Adenosine<br>
C = Cytosine<br>
G = Guanosine<br>
T = Thymidine<br>
N = aNy base<br>
X = Unassigned<br>
<br>
Other base letters currently recognized:<br>
<br>
B = C,G, or T<br>
D = A,G, or T<br>
H = A,C, or T<br>
V = A,C, or G<br>
R = A or G (puRine)<br>
Y = C or T (pYrimidine)<br>
K = G or T (Keto)<br>
M = A or C (aMino)<br>
S = G or C (Strong -3H bonds)<br>
W = A or T (Weak - 2H bonds)<br>
</p>""")
self.actionsComboBox.setWhatsThis("""<b>Action</b>
<p>Select an action to perform on the sequence.</p>""")
def conformationComboBoxChanged( self, inIndex ):
"""
Slot for the Conformation combobox. It is called whenever the
Conformation choice is changed.
@param inIndex: The new index.
@type inIndex: int
"""
self.basesPerTurnComboBox.clear()
conformation = self.conformationComboBox.currentText()
if conformation == "B-DNA":
self.basesPerTurnComboBox.insertItem(0, "10.0")
self.basesPerTurnComboBox.insertItem(1, "10.5")
self.basesPerTurnComboBox.insertItem(2, "10.67")
#10.5 is the default value for Bases per turn.
#So set the current index to 1
self.basesPerTurnComboBox.setCurrentIndex(1)
elif conformation == "Z-DNA":
self.basesPerTurnComboBox.insertItem(0, "12.0")
elif inIndex == -1:
# Caused by clear(). This is tolerable for now. Mark 2007-05-24.
conformation = "B-DNA" # Workaround for "Restore Defaults".
pass
else:
msg = redmsg("conformationComboBoxChanged(): \
Error - unknown DNA conformation. Index = "+ inIndex)
env.history.message(msg)
self.duplexLengthSpinBox.setSingleStep(
self.getDuplexRise(conformation) )
def modelComboBoxChanged( self, inIndex ):
"""
Slot for the Model combobox. It is called whenever the
Model choice is changed.
@param inIndex: The new index.
示例3: DnaDisplayStyle_PropertyManager
# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import currentText [as 别名]
#.........这里部分代码省略.........
def change_dnaStrandLabelsDisplay(self, mode):
"""
Changes DNA Strand labels display (and color) mode.
@param mode: The display mode:
- 0 = hide all labels
- 1 = show (same color as chunk)
- 2 = show (black)
- 3 = show (white)
- 4 = show (custom color...)
@type mode: int
"""
if mode == 4:
self.win.userPrefs.change_dnaStrandLabelsColor()
if mode == 0:
#@ Fix this at the same time I (we) remove the DNA display style
# prefs options from the Preferences dialog. --Mark 2008-05-13
self.win.userPrefs.toggle_dnaDisplayStrandLabelsGroupBox(False)
else:
self.win.userPrefs.toggle_dnaDisplayStrandLabelsGroupBox(True)
self.win.userPrefs.change_dnaStrandLabelsColorMode(mode - 1)
def applyFavorite(self):
"""
Apply the DNA display style settings stored in the current favorite
(selected in the combobox) to the current DNA display style settings.
"""
# Rules and other info:
# The user has to press the button related to this method when he loads
# a previously saved favorite file
current_favorite = self.favoritesComboBox.currentText()
if current_favorite == 'Factory default settings':
env.prefs.restore_defaults(dnaDisplayStylePrefsList)
else:
favfilepath = getFavoritePathFromBasename(current_favorite)
loadFavoriteFile(favfilepath)
self.updateDnaDisplayStyleWidgets()
return
def addFavorite(self):
"""
Adds a new favorite to the user's list of favorites.
"""
# Rules and other info:
# - The new favorite is defined by the current DNA display style
# settings.
# - The user is prompted to type in a name for the new
# favorite.
# - The DNA display style settings are written to a file in a special
# directory on the disk
# (i.e. $HOME/Nanorex/Favorites/DnaDisplayStyle/$FAV_NAME.fav).
# - The name of the new favorite is added to the list of favorites in
# the combobox, which becomes the current option.
# Existence of a favorite with the same name is checked in the above
# mentioned location and if a duplicate exists, then the user can either
# overwrite and provide a new name.
# Prompt user for a favorite name to add.
示例4: LightingScheme_PropertyManager
# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import currentText [as 别名]
#.........这里部分代码省略.........
return
def update_light_combobox_items(self):
"""
Updates all light combobox items with '(On)' or '(Off)' label.
"""
for i in range(3):
if self.lights[i][7]:
txt = "%d (On)" % (i+1)
else:
txt = "%d (Off)" % (i+1)
self.lightComboBox.setItemText(i, txt)
return
def changeLightColor(self):
"""
Slot method for the ColorComboBox
"""
color = self.lightColorComboBox.getColor()
env.prefs[self.current_light_key] = color
self.light_color = env.prefs[self.current_light_key]
self.save_lighting()
return
def applyFavorite(self):
"""
Apply the lighting scheme settings stored in the current favorite
(selected in the combobox) to the current lighting scheme settings.
"""
# Rules and other info:
# The user has to press the button related to this method when he loads
# a previously saved favorite file
current_favorite = self.favoritesComboBox.currentText()
if current_favorite == 'Factory default settings':
#env.prefs.restore_defaults(lightingSchemePrefsList)
self.restore_default_lighting()
else:
favfilepath = getFavoritePathFromBasename(current_favorite)
loadFavoriteFile(favfilepath)
self._updateAllWidgets()
self.win.glpane.gl_update()
return
def addFavorite(self):
"""
Adds a new favorite to the user's list of favorites.
"""
# Rules and other info:
# - The new favorite is defined by the current lighting scheme
# settings.
# - The user is prompted to type in a name for the new
# favorite.
# - The lighting scheme settings are written to a file in a special
# directory on the disk
# (i.e. $HOME/Nanorex/Favorites/LightingScheme/$FAV_NAME.txt).
# - The name of the new favorite is added to the list of favorites in
# the combobox, which becomes the current option.
# Existence of a favorite with the same name is checked in the above
# mentioned location and if a duplicate exists, then the user can either
# overwrite and provide a new name.
# Prompt user for a favorite name to add.
from widgets.simple_dialogs import grab_text_line_using_dialog
示例5: DnaDuplexPropertyManager
# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import currentText [as 别名]
#.........这里部分代码省略.........
"""
params = \
[ #Format: (" checkbox text", prefs_key)
("Number of base pairs",
dnaDuplexEditCommand_cursorTextCheckBox_numberOfBasePairs_prefs_key),
("Number of turns",
dnaDuplexEditCommand_cursorTextCheckBox_numberOfTurns_prefs_key),
("Duplex length",
dnaDuplexEditCommand_cursorTextCheckBox_length_prefs_key),
("Angle",
dnaDuplexEditCommand_cursorTextCheckBox_angle_prefs_key) ]
return params
def _addToolTipText(self):
"""
Tool Tip text for widgets in the DNA Property Manager.
"""
pass
def conformationComboBoxChanged( self, inIndex ):
"""
Slot for the Conformation combobox. It is called whenever the
Conformation choice is changed.
@param inIndex: The new index.
@type inIndex: int
"""
conformation = self.conformationComboBox.currentText()
if conformation == "B-DNA":
self.basesPerTurnDoubleSpinBox.setValue("10.0")
elif conformation == "Z-DNA":
self.basesPerTurnDoubleSpinBox.setValue("12.0")
else:
msg = redmsg("conformationComboBoxChanged(): \
Error - unknown DNA conformation. Index = "+ inIndex)
env.history.message(msg)
self.duplexLengthSpinBox.setSingleStep(getDuplexRise(conformation))
def numberOfBasesChanged( self, numberOfBases ):
"""
Slot for the B{Number of Bases} spinbox.
"""
# Update the Duplex Length lineEdit widget.
text = str(getDuplexLength(self._conformation,
numberOfBases,
self._duplexRise)) \
+ " Angstroms"
self.duplexLengthLineEdit.setText(text)
return
def basesPerTurnChanged( self, basesPerTurn ):
"""
Slot for the B{Bases per turn} spinbox.
"""
self.editCommand.basesPerTurn = basesPerTurn
self._basesPerTurn = basesPerTurn
示例6: ProteinDisplayStyle_PropertyManager
# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import currentText [as 别名]
#.........这里部分代码省略.........
"""
Updates all the Protein Display style widgets based on the current pref keys
values
"""
self.proteinStyleComboBox.setCurrentIndex(env.prefs[proteinStyle_prefs_key])
self.splineDoubleSpinBox.setValue(env.prefs[proteinStyleQuality_prefs_key])
if env.prefs[proteinStyleSmooth_prefs_key] == True:
self.smoothingCheckBox.setCheckState(Qt.Checked)
else:
self.smoothingCheckBox.setCheckState(Qt.Unchecked)
self.scaleComboBox.setCurrentIndex(env.prefs[proteinStyleScaling_prefs_key])
self.scaleFactorDoubleSpinBox.setValue(env.prefs[proteinStyleScaleFactor_prefs_key])
self.proteinComponentComboBox.setCurrentIndex(env.prefs[proteinStyleColors_prefs_key])
self.customColorComboBox.setColor(env.prefs[proteinStyleCustomColor_prefs_key])
self.proteinAuxComponentComboBox.setCurrentIndex(env.prefs[proteinStyleAuxColors_prefs_key])
self.auxColorComboBox.setColor(env.prefs[proteinStyleAuxCustomColor_prefs_key])
if env.prefs[proteinStyleColorsDiscrete_prefs_key] == True:
self.discColorCheckBox.setCheckState(Qt.Checked)
else:
self.discColorCheckBox.setCheckState(Qt.Unchecked)
self.helixColorComboBox.setColor(env.prefs[proteinStyleHelixColor_prefs_key])
self.strandColorComboBox.setColor(env.prefs[proteinStyleStrandColor_prefs_key])
self.coilColorComboBox.setColor(env.prefs[proteinStyleCoilColor_prefs_key])
return
def applyFavorite(self):
# Rules and other info:
# The user has to press the button related to this method when he loads
# a previously saved favorite file
current_favorite = self.favoritesComboBox.currentText()
if current_favorite == "Factory default settings":
env.prefs.restore_defaults(proteinDisplayStylePrefsList)
else:
favfilepath = getFavoritePathFromBasename(current_favorite)
loadFavoriteFile(favfilepath)
self.updateProteinDisplayStyleWidgets()
return
def addFavorite(self):
# Rules and other info:
# - The new favorite is defined by the current Protein display style
# settings.
# - The user is prompted to type in a name for the new
# favorite.
# - The DNA display style settings are written to a file in a special
# directory on the disk
# (i.e. $HOME/Nanorex/Favorites/ProteinDisplayStyle/$FAV_NAME.txt).
# - The name of the new favorite is added to the list of favorites in
# the combobox, which becomes the current option.
# Existence of a favorite with the same name is checked in the above
# mentioned location and if a duplicate exists, then the user can either
# overwrite and provide a new name.
# Prompt user for a favorite name to add.
from widgets.simple_dialogs import grab_text_line_using_dialog