View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0037821||Lazarus||LCL||public||2020-09-26 23:19||2020-09-28 00:36|
|Reporter||jamie philbrook||Assigned To||Juha Manninen|
|Summary||0037821: All Dialogs that have "OldStyleDialog" option when checks moves the Calling FORM to center of screen, Dialog to where it was.|
When using any file dialog that has the OldStyle Option and checked, causes the form that is in focus to move to the center of the screen and places the file dialog to where the form was or near it.
This does not happen when using the modern version of the dialog.
|Tags||No tags attached.|
|Fixed in Revision||r63929|
I have stumbled on the problem and fix, please look at this forum post I have left there and I would like opinions because I really don't know why it was that way in the first place. This has been around for a long time..
the fix I did in the forum post made the dialog work exactly like my old Delphi does, it displays the dialog at the center of the screen and does not effect the active form that called it.
But I noted this, the Vista dialogs and up, do follow along with the active form, in other words, it does not center the dialog so maybe this is more desirable ?
I tested the TOpenDialog with Delphi 10.3 and it seems for what ever reason the OldStyleDialogs option is ignored because it always shows the new style. So I am not sure if this is intentional or a bug on their side ?
But I've found it maybe better to simply comment out the "Reposition" function call during the dialog callback initial message, this allows the OS (Windows) to have the dialog follow the active form exactly in the same manner as the Vista styles do now.
And if that is acceptable we could go as far as removing the code for it too, to un-lard the widget a bit.
So I vote on taking the "Reposition" procedure out of the equation !
This is my first attempt at making a patch file against the trunk.. so excuse me if something goes wrong..
--- win32wsdialogs.pp (revision 63928)
+++ win32wsdialogs.pp (working copy)
@@ -523,7 +523,7 @@
// Windows asks us to initialize dialog. At this moment controls are not
// arranged and this is that moment when we should set bounds of our dialog
+ // Reposition(GetParent(Wnd)); // this causes active form to move out of position with old dilaogs JP
if uMsg = WM_NOTIFY then
here is patch file
win32wsdialogs.pp.patch (544 bytes)
Index: win32wsdialogs.pp =================================================================== --- win32wsdialogs.pp (revision 63928) +++ win32wsdialogs.pp (working copy) @@ -523,7 +523,7 @@ begin // Windows asks us to initialize dialog. At this moment controls are not // arranged and this is that moment when we should set bounds of our dialog - Reposition(GetParent(Wnd)); + // Reposition(GetParent(Wnd)); // this causes active form to move out of position with old dilaogs JP end else if uMsg = WM_NOTIFY then
win32wsdialogs.pp.patch (544 bytes)
Note, I commented out the nested procedure Reposition. It is not used anywhere else.
|2020-09-26 23:19||jamie philbrook||New Issue|
|2020-09-27 04:05||jamie philbrook||Note Added: 0125891|
|2020-09-27 15:53||jamie philbrook||Note Added: 0125900|
|2020-09-27 15:54||jamie philbrook||Note Edited: 0125900||View Revisions|
|2020-09-27 20:01||jamie philbrook||Note Added: 0125907|
|2020-09-27 20:12||jamie philbrook||Note Added: 0125908|
|2020-09-27 20:12||jamie philbrook||File Added: win32wsdialogs.pp.patch|
|2020-09-28 00:15||Juha Manninen||Assigned To||=> Juha Manninen|
|2020-09-28 00:15||Juha Manninen||Status||new => assigned|
|2020-09-28 00:26||Juha Manninen||Status||assigned => resolved|
|2020-09-28 00:26||Juha Manninen||Resolution||open => fixed|
|2020-09-28 00:26||Juha Manninen||Fixed in Revision||=> r63929|
|2020-09-28 00:26||Juha Manninen||LazTarget||=> -|
|2020-09-28 00:26||Juha Manninen||Widgetset||Win32/Win64 => Win32/Win64|
|2020-09-28 00:26||Juha Manninen||Note Added: 0125913|
|2020-09-28 00:36||jamie philbrook||Note Added: 0125914|