View Revisions: Issue #36127

Summary 0036127: [Patch] TForm's bounds and restored bounds are inconsistent
Revision 2019-10-03 14:45 by Juha Manninen
Description The attached patch tries to fix the following issues:

When form is designed with WindowState=wsMaximized:
1. Restored dimension is wrong (related to 0027894, 0022771, 0027375)
2. Width/Height in OnShow() and OnActivate() events are wrong (related to 0021119)
     Under Delphi 3:
          - OnCreate(): design time restored width/height
          - OnShow() and OnActivate(): maximized width/height

When form's WindowsState=not maximized
3. Restored bounds in OnResize() and OnChangeBounds() events are wrong or not updated (related to 0032631)

Note: Expanded on the idea of Yuichiro Takahashi from Issue 0008576 to use Application.QueueAsyncCall() to "queue" the procedure to update the restored values, to the main event loop, thus delaying it until the form is properly moved or resized. The first calls to OnShow() and OnActivate() are also moved to this procedure so that querying Width/Height during these events will return the correct values.

Tested on GTK2 and Win32.
Revision 2019-10-02 09:55 by Joeny Ang
Description The attached patch tries to fix the following issues:

When form is designed with WindowState=wsMaximized:
1. Restored dimension is wrong (related to 0027894, 0022771, 0027375)
2. Width/Height in OnShow() and OnActivate() events are wrong (related to 0021119)
     Under Delphi 3:
          - OnCreate(): design time restored width/height
          - OnShow() and OnActivate(): maximized width/height

When form's WindowsState=not maximized
3. Restored bounds in OnResize() and OnChangeBounds() events are wrong or not updated (related to 0032631)

Note: Expanded on the idea of Yuichiro Takahashi from Issue#8576 to use Application.QueueAsyncCall() to "queue" the procedure to update the restored values, to the main event loop, thus delaying it until the form is properly moved or resized. The first calls to OnShow() and OnActivate() are also moved to this procedure so that querying Width/Height during these events will return the correct values.

Tested on GTK2 and Win32.