本文整理汇总了Python中PM.PM_ComboBox.PM_ComboBox.setItemText方法的典型用法代码示例。如果您正苦于以下问题:Python PM_ComboBox.setItemText方法的具体用法?Python PM_ComboBox.setItemText怎么用?Python PM_ComboBox.setItemText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PM.PM_ComboBox.PM_ComboBox
的用法示例。
在下文中一共展示了PM_ComboBox.setItemText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: LightingScheme_PropertyManager
# 需要导入模块: from PM.PM_ComboBox import PM_ComboBox [as 别名]
# 或者: from PM.PM_ComboBox.PM_ComboBox import setItemText [as 别名]
#.........这里部分代码省略.........
def change_material_finish(self, finish):
"""
This is the slot for the Material Finish spin box.
'finish' is between 0.0 and 1.0.
Saves finish parameter to pref db.
"""
# For whiteness, the stored range is 0.0 (Metal) to 1.0 (Plastic).
env.prefs[material_specular_finish_prefs_key] = finish
def change_material_shininess(self, shininess):
"""
This is the slot for the Material Shininess spin box.
'shininess' is between 15 (low) and 60 (high).
"""
env.prefs[material_specular_shininess_prefs_key] = shininess
def change_material_brightness(self, brightness):
"""
This is the slot for the Material Brightness sping box.
'brightness' is between 0.0 (low) and 1.0 (high).
"""
env.prefs[material_specular_brightness_prefs_key] = brightness
def toggle_light(self, on):
"""
Slot for light 'On' checkbox.
It updates the current item in the light combobox with '(On)' or
'(Off)' label.
"""
if on:
txt = "%d (On)" % (self.lightComboBox.currentIndex()+1)
else:
txt = "%d (Off)" % (self.lightComboBox.currentIndex()+1)
self.lightComboBox.setItemText(self.lightComboBox.currentIndex(),txt)
self.save_lighting()
def change_lighting(self, specularityValueJunk = None):
"""
Updates win.glpane lighting using the current lighting parameters from
the light checkboxes and sliders. This is also the slot for the light
spin boxes.
@param specularityValueJunk: This value from the spin box is not used
We are interested in valueChanged signal
only
@type specularityValueJunk = int or None
"""
light_num = self.lightComboBox.currentIndex()
light1, light2, light3 = self.win.glpane.getLighting()
a = self.ambientDoubleSpinBox.value()
d = self.diffuseDoubleSpinBox.value()
s = self.specularDoubleSpinBox.value()
g = self.xDoubleSpinBox.value()
h = self.yDoubleSpinBox.value()
k = self.zDoubleSpinBox.value()
new_light = [ self.light_color, a, d, s, g, h, k,\
self.enableLightCheckBox.isChecked()]
# This is a kludge. I'm certain there is a more elegant way. Mark 051204.
if light_num == 0:
self.win.glpane.setLighting([new_light, light2, light3])