Closed LihemdiRachid closed 1 year ago
Change this in TSpTBXFormPopupMenu.InternalPopup:
TCustomFormAccess(FPopupForm).ScaleForPPI(PPI);
FWrapperForm.ScaleForPPI(PPI);
To:
if PPI <> TCustomFormAccess(FPopupForm).CurrentPPI then begin
TCustomFormAccess(FPopupForm).ScaleForPPI(PPI);
FWrapperForm.ScaleForPPI(PPI);
end;
Thanks for the quick reaction! I confirm it solves the issue. Tested under the following conditions:
Thanks a lot!
Just tested with DPI Awareness = Per Monitor V2 ==> Fails With the test in the original post, designed in 96 dpi
Just to let you know, as I don't use Per Monitor yet in my application
Try the latest commit
(Migrating a BDS2006 & SpTBXLib 2.4.5 to Delphi 10.4 & SpTBXLib 2.5.10)
Create a new VLC Application, Form1 is created by default
Add SpTBXFormPopupMenuthe in the uses section
Declare a private variable of Form1:
Add a new form, Form2 is created.
Give a size to Form2 of, let's say, 400x600
In Form1, drop a Button, and on its OnClick event, put the following code
Run the app and click the button, Form2 is popped up, but not in 200x200. It keeps its design size. The exact same code works fine in BDS2006
The issue has been introduced with the call to ScaleForPPI in TSpTBXFormPopupMenu.InternalPopup