(self, inputDef, handledHandles, mainInput=False)
| 223 | vector.SetDirectionOnly(vectorDef.lengthHandle == mainInputHandle) |
| 224 | |
| 225 | def __addInputField(self, inputDef, handledHandles, mainInput=False): |
| 226 | if not self.__checkInputConditions(inputDef): |
| 227 | return |
| 228 | handledHandles.add(inputDef.handle) |
| 229 | fieldSizer = wx.BoxSizer(wx.HORIZONTAL) |
| 230 | tooltipText = (inputDef.mainTooltip if mainInput else inputDef.secondaryTooltip) or '' |
| 231 | if mainInput: |
| 232 | fieldTextBox = FloatRangeBox(self, self._storedRanges.get((inputDef.handle, inputDef.unit), inputDef.defaultRange)) |
| 233 | fieldTextBox.Bind(wx.EVT_TEXT, self.OnMainInputChanged) |
| 234 | else: |
| 235 | fieldTextBox = FloatBox(self, self._storedConsts.get((inputDef.handle, inputDef.unit), inputDef.defaultValue)) |
| 236 | fieldTextBox.Bind(wx.EVT_TEXT, self.OnNonMainInputChanged) |
| 237 | fieldTextBox.SetToolTip(wx.ToolTip(tooltipText)) |
| 238 | fieldSizer.Add(fieldTextBox, 0, wx.EXPAND | wx.RIGHT, 5) |
| 239 | fieldIcon = None |
| 240 | if inputDef.iconID is not None: |
| 241 | icon = BitmapLoader.getBitmap(inputDef.iconID, 'icons') |
| 242 | if icon is not None: |
| 243 | fieldIcon = wx.StaticBitmap(self) |
| 244 | fieldIcon.SetBitmap(icon) |
| 245 | fieldIcon.SetToolTip(wx.ToolTip(tooltipText)) |
| 246 | fieldSizer.Add(fieldIcon, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3) |
| 247 | fieldLabel = wx.StaticText(self, wx.ID_ANY, self.formatLabel(inputDef)) |
| 248 | fieldLabel.SetToolTip(wx.ToolTip(tooltipText)) |
| 249 | fieldSizer.Add(fieldLabel, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 0) |
| 250 | self.inputsSizer.Add(fieldSizer, 0, wx.EXPAND | wx.BOTTOM, 5) |
| 251 | # Store info about added input box |
| 252 | inputBox = InputBox(handle=inputDef.handle, unit=inputDef.unit, textBox=fieldTextBox, icon=fieldIcon, label=fieldLabel) |
| 253 | if mainInput: |
| 254 | self._mainInputBox = inputBox |
| 255 | else: |
| 256 | self._miscInputBoxes.append(inputBox) |
| 257 | |
| 258 | def __addInputCheckbox(self, checkboxDef, handledHandles): |
| 259 | if not self.__checkInputConditions(checkboxDef): |
no test coverage detected