def SetValues(self, values):
"""
Set default variable parameters
@param values: Variable parameters values
"""
# Get class parameter value
var_class = values.get("class", None)
if var_class is not None:
# Set class selected in class combo box
self.Class.SetStringSelection(VARIABLE_CLASSES_DICT[var_class])
# Refresh names in name list box according to var class
self.RefreshNameList()
# For each parameters defined, set corresponding control value
for name, value in values.items():
# Parameter is variable expression
if name == "expression":
# Set expression text control value
self.Expression.ChangeValue(value)
# Select corresponding text in name list box if it exists
if self.VariableName.FindString(value) != wx.NOT_FOUND:
self.VariableName.SetStringSelection(value)
else:
self.VariableName.SetSelection(wx.NOT_FOUND)
# Parameter is variable execution order
elif name == "executionOrder":
self.ExecutionOrder.SetValue(value)
# Refresh preview panel
self.RefreshPreview()
self.Fit()
评论列表
文章目录