# HG changeset patch # User Laurent Bessard # Date 1382045243 -7200 # Node ID ee795a8d4404b6044b55f60d93e0e87c951149fe # Parent 9bd4c783c98dcdc68e50d195f11e00df6f4cea1c Fixed coil and contact dialog to let user select a complex type variable for contact and coil expression diff -r 9bd4c783c98d -r ee795a8d4404 dialogs/LDElementDialog.py --- a/dialogs/LDElementDialog.py Thu Oct 17 12:20:36 2013 +0200 +++ b/dialogs/LDElementDialog.py Thu Oct 17 23:27:23 2013 +0200 @@ -91,7 +91,7 @@ flag=wx.GROW|wx.TOP) # Create a combo box for defining LD element variable - self.ElementVariable = wx.ComboBox(self, style=wx.CB_READONLY|wx.CB_SORT) + self.ElementVariable = wx.ComboBox(self, style=wx.CB_SORT) self.Bind(wx.EVT_COMBOBOX, self.OnVariableChanged, self.ElementVariable) self.LeftGridSizer.AddWindow(self.ElementVariable, border=5, @@ -117,7 +117,6 @@ if (type == "contact" or var_type != "Input") and \ value_type == "BOOL": self.ElementVariable.Append(name) - self.ElementVariable.Enable(self.ElementVariable.GetCount() > 0) # Normal radio button is default control having keyboard focus self.ModifierRadioButtons[element_modifiers[0]].SetFocus() @@ -144,7 +143,7 @@ # Parameter is LD element variable if name == "variable": - self.ElementVariable.SetStringSelection(value) + self.ElementVariable.SetValue(value) # Set value of other controls elif name == "modifier": @@ -189,7 +188,7 @@ self.Element = self.ElementClass( self.Preview, self.GetElementModifier(), - self.ElementVariable.GetStringSelection()) + self.ElementVariable.GetValue()) # Call BlockPreviewDialog function BlockPreviewDialog.RefreshPreview(self)