thiagoralves / OpenPLC_Editor

OpenPLC Editor - IDE capable of creating programs for the OpenPLC Runtime
GNU General Public License v2.0
415 stars 202 forks source link

Fixfloat #64

Closed petrkr closed 1 year ago

petrkr commented 1 year ago

By WX documentation SetValue of SpinCtrl want int or text (https://docs.wxpython.org/wx.SpinCtrl.html#wx.SpinCtrl.SetValue) but x/y are float. So let's cast them to integer.

It causes this bug

Traceback (most recent call last):
  File "/home/petrkr/svn/OpenPLC_Editor/editor/IDEFrame.py", line 1442, in OnPouSelectedChanged
    window.RefreshView()
  File "/home/petrkr/svn/OpenPLC_Editor/editor/editors/ProjectNodeEditor.py", line 85, in RefreshView
    self.ProjectProperties.RefreshView()
  File "/home/petrkr/svn/OpenPLC_Editor/editor/controls/ProjectPropertiesPanel.py", line 245, in RefreshView
    self.SetValues(self.Controller.GetProjectProperties())
  File "/home/petrkr/svn/OpenPLC_Editor/editor/controls/ProjectPropertiesPanel.py", line 262, in SetValues
    self.Scalings[language][0].SetValue(x)
TypeError: SpinCtrl.SetValue(): arguments did not match any overloaded call:
  overload 1: argument 1 has unexpected type 'float'
  overload 2: argument 1 has unexpected type 'float'
thiagoralves commented 1 year ago

What version of wx are you using? This OpenPLC Editor port to wx Phoenix is based on version 4.1.1. Correct me if I'm wrong, but it seems that wx keep changing a lot of things on their API on every release, so I rather port it to a fixed version first, and then work on fixing the small details to have it running on the latest version once it is stable.

petrkr commented 1 year ago

pacman -Ss python-wxpython community/python-wxpython 1:4.1.1-3 [installed]

pip list |grep wx wxPython 4.1.1