GrandOrgue / GoOdf

A tool for creating/editing organ definition files for GrandOrgue
GNU General Public License v3.0
11 stars 1 forks source link

Saving bug #36

Open Bumblebee001 opened 1 year ago

Bumblebee001 commented 1 year ago

I note that changes are not saved unless the curser is moved away from the change made. So before saving one has to click some other item moving away from the edited item for that change to be effected and therefore can be saved.

It is a bug in my opinion and ought to be corrected.

larspalo commented 1 year ago

I guess you're referring to the spin control behavior. If so, then it's not really a bug, but how the wxSpinCtrl and wxSpinCtrlDouble behaves (at least if one only handle the main event macro type). Also it's well documented in the help that you need to exit the text field of a spin control (for instance by using TAB). The text part of the spin control is actually not evaluated until focus is lost - it's not done while you're typing (which can be done in a pure wxTextCtrl). Stepping the value with the arrows work to change the value but it's not always convenient when large changes should be made.

From the wxSpinCtrl documentation:

Finally, if the user modifies the text in the edit part of the spin control directly, the EVT_TEXT is generated, like for the wxTextCtrl. When the use enters text into the text area, the text is not validated until the control loses focus (e.g. by using the TAB key). The value is then adjusted to the range and a wxSpinEvent sent then if the value is different from the last value sent.

I'll investigate if it's possible to change this behavior without actually resorting to creating a separate wxTextCtrl instead of using the text field that comes with the spin control - which would way more than double the amount of needed code for each spin control. I'm not so eager to do that...