View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0034297||Lazarus||IDE||public||2018-09-19 00:36||2018-09-19 16:56|
|Reporter||wp||Assigned To||Bart Broersma|
|Target Version||1.8.6||Fixed in Version||1.8.6|
|Summary||0034297: Issues with testing TFindDialog and TReplaceDialog in form designer|
|Description||The descendants of TCommonDialog have a component editor which allows testing the corresponding dialog at designtime when the dialog is double-clicked in the form designer. This does not work correctly for TFindDialog and TReplaceDialog:|
- TFindDialog: the dialog is not centered vertically but is at the top of the screen, the title bar is even above the screen top such that only a thin stripe is available for grabbing with the mouse.
- TReplaceDialog: the dialog cannot be closed any more. In Laz trunk, the dialog is at position (0, 0), in older versions it is again at the screen top such that the title bar is no longer visible at all and the form cannot be moved to another place. The dialog is poorly designed (overlapping controls - see attached screenshot) in contrast to run time.
This description is for Windows 10. On Linux I see essentially the same issues, except for the top position of the dialog which does not reach beyond the screen top.
|Steps To Reproduce||At design time, drop a TFindDialog on a form. Double-click on the component and see the bug.|
Repeat with TReplaceDialog.
|Additional Information||I looked at older Lazarus installations on my system: Version 1.2 was the last one on my system which was still ok. The next installation 1.4.4 already has the bug.|
|Tags||No tags attached.|
|Fixed in Revision||r59083|
Yeah, it's horrible indeed.
Not sure it's related to 0033528 though.
||It is related to 0033528 in the sense that now the top position of the ReplaceDialog is at (0, 0) and the dialog can be moved with the mouse. But you are right, 0033528 certainly did not cause the issue because it has been there for a long time.|
There is something iffy going on with TReplaceDialog in the IDE.
If you test the dialog then this happens with TFindDialog:
- Execute is called
- Execute calls CalcPosition (in CalcPosition I now have a check for csDesigning and simply set Position to poScreenCenter)
- After CalcPosition Execute calls FFindForm.Show
Now I put in a blocking ShowMessage in CalcPosition for quick debugging.
For TFindDialog this works as expected.
I see the ShowMessage and the dialog only appears after I click the ShowMessage away.
For TReplaceDialog however this does NOT happen.
Execute is called, the ShowMessage appears, but simultaneously (?) the TReplaceDialog is shown.
And by the look of that form SetLayout has not been called yet, which is rather strange, since that should be called in the CreateNew constructor for TReplaceDialogForm.
Inside CalcPosition I can see that aForm.Showing is False in the case of TFindDialog (as expected) but True for TReplaceDialog.
The TReplaceDialog seems to be shown before CalcPosition returns.
I also can see that TReplaceDialog.SetLayout is being called, which makes this even more a mystery to me.
And all this insanity goes away by changing this in TReplaceDialog.CreateForm:
Result := TReplaceDialogForm.CreateNew(Self,Options);
Result := TReplaceDialogForm.CreateNew(nil,Options);
And yes, in TFindDialog.CreateForm you find:
// do not use Self as Owner, otherwise as desgntime this will not work
Result := TFindDialogForm.CreateNew(nil,Options);
I really don't know how this (retruning prematurely from a function that has a blocking showmessage) can happen though.
||Please test and close if OK.|
||Wow! Thank you.|
|2018-09-19 00:36||wp||New Issue|
|2018-09-19 00:36||wp||Summary||Issues with testing TFindDialog and TReplaceDialog in desinger => Issues with testing TFindDialog and TReplaceDialog in form designer|
|2018-09-19 00:37||wp||File Added: replacedlg.png|
|2018-09-19 00:38||wp||Description Updated||View Revisions|
|2018-09-19 00:39||wp||Description Updated||View Revisions|
|2018-09-19 12:12||wp||Relationship added||related to 0033528|
|2018-09-19 14:42||Bart Broersma||Note Added: 0110875|
|2018-09-19 14:42||Bart Broersma||Status||new => confirmed|
|2018-09-19 14:43||Bart Broersma||Note Edited: 0110875||View Revisions|
|2018-09-19 15:22||wp||Note Added: 0110876|
|2018-09-19 15:55||Bart Broersma||Note Added: 0110879|
|2018-09-19 15:56||Bart Broersma||Note Edited: 0110879||View Revisions|
|2018-09-19 16:27||Bart Broersma||Note Added: 0110883|
|2018-09-19 16:34||Bart Broersma||Note Added: 0110884|
|2018-09-19 16:35||Bart Broersma||Assigned To||=> Bart Broersma|
|2018-09-19 16:35||Bart Broersma||Status||confirmed => assigned|
|2018-09-19 16:40||Bart Broersma||Fixed in Revision||=> r59083|
|2018-09-19 16:40||Bart Broersma||LazTarget||- => 1.8.6|
|2018-09-19 16:40||Bart Broersma||Note Added: 0110885|
|2018-09-19 16:40||Bart Broersma||Status||assigned => resolved|
|2018-09-19 16:40||Bart Broersma||Fixed in Version||=> 1.8.6|
|2018-09-19 16:40||Bart Broersma||Resolution||open => fixed|
|2018-09-19 16:40||Bart Broersma||Target Version||=> 1.8.6|
|2018-09-19 16:56||wp||Note Added: 0110886|
|2018-09-19 16:56||wp||Status||resolved => closed|