There is a bug in the wxSmith code for wxSpinDoubleCtrl of the property Inrement. On Re-opening the project any increment values < 0,0f are replaced by 0. But the increment proerty 0 causes an Assert when opening the resource windows of wxSmith. Also after the value has been replaced by 0 the preview does not show the wxSpinDouble control any more as long as the increment is zero. After replacing the value with, say 0.01f it works again, but the value is lost on next project re-open.
How to reproduce:
- Make a Minimal wxWidgets Project with "wxSmith" as GUI builder
- Enter a Panel, 2 sizers and a wxSpinDoubleControl. Observe that the Initial Inrement property is "0,01f" (with comma)
- Compile the project and save it.
- Re-start CodeBlocks and re-open the project. Enter Resource view and select the spin control. Observe that the increment has changed from "0,0f" to "0.0" (now with dot)
- Re-start CodeBlocks and re-open the project again. Enter Resource view. Observe an Assert.
- Select "continue" and observe that the control is missing from the preview.
- Inspect the Increment property. Observe that the value is "0".
- Change the value to "0,0" and observe that the control is visible again.
Workaround:
For each wxSpinDouble control set the increment to 1 and use the code to set the incrememnt value programatically when values <1 are required.
Please state C::B and wxWidgets versions. Does your locale use comma as decimal separator?
There was a problem with locales in wxSpinCtrlDouble, fixed by this commit in wx3.1.6.
I have just remembered I reported the same problem with locales in wxFloatProperty, this is what is bugging wxSmith.
This was fixed by this commit on Dec 17, 2023, but will not be effective until wx3.2.5 is published (next week, hopefully)..
Version : svn-r13432
SDK Version : 2.25.0
Scintilla Version : 3.7.5
OS : Linux 4.15.0-213-generic x86_64
wxWidgets Library (wxGTK port)
Version 3.0.5 (Unicode: wchar_t, debug level: 1),
Runtime version of toolkit used is 3.22.
Compile-time GTK+ version is 3.22.30.
MyLocale: hm. not really sure. Libre office uses comma, wxControls use dot
wx3.0.5 is affected by both bugs.
wxFloatProperty uses the C locale for converting double to string (wxString::Format) and the UI locale for the inverse (wxNumberFormatter), hence the comma/dot dance.