WINDOWCREATE and DIALOGCREATE accept a "setup" inputlist which is documented as a way to add widgets before the window is shown (or for a dialog, before it goes modal). If, from the setup instructionlist, you create exactly one button on the window or exactly only one listbox (possibly any widget, I haven't confirmed), then that widget takes the full width/height of the dialog/window, instead of the provided x/y/width/height.
This is a regression from FMSLogo 6.35.0 that was introduced in FMSLogo 7.0.0. I have confirmed that this was caused by upgrading wxWidgets from 2.8.12 to 3.1.0 and not any change in the FMSLogo code base.
Work Around:
Because this bug only affects when a window/dialog has a single child, you can work around this by adding a dummy widget that is invisible before adding the one you want. For example, something like
STATICCREATE "mywin "dummy [] 0 0 0 0
Steps to Reproduce
1) Enter the following code in the workspace editor
to repro
windowcreate "main "win [title] 0 0 200 200 [setup]
end
to setup
buttoncreate "win "b1 [Close Window] 5 5 80 20 [windowdelete "main]
; LISTBOXCREATE "win "l1 5 20 30 20
; STATICCREATE "win "s1 [Static Text] 5 50 50 25
end
2) type "repro" in the commander and press Execute.
What Happens:
A window with "title" is shown and it has a button that fills the entire window (see "single-button-bug-takes-full-width.png" screenshot attachment).
Expected Result
A window with "title" is shown the button is in the upper left with a little margin (see "single-button-expected-behavior.png" screenshot attachment).
This was reported in the discussion forum.
I have opened this as a bug on wxWidgets.
I have committed a fix for this in [r4425], This will be available in FMSLogo 7.2.0.
The wxWidgets developer reported that this was always the expected behavior and it was just by bad luck that I happened to rely on a bug in 2.8.12 that for some reason bypassed the behavior. My fix was to disable the behavior by adding a dummy wxBoxSizer to the dialog.
Related
Commit: [r4425]