Jump to content
PeterPanettone

I fixed the DPI errors in the CodeLibrarian Search dialog

Recommended Posts

On my HighDPI monitor the CodeLibrarian Search dialog was still broken in r4431, so I fixed it:

 

image.thumb.png.ad86cd5ee744561960125c698563ef71.png

 

This should now work with all DPI settings on the end user side, as it now uses a Manifest in modern Delphi 12 Athens instead of a custom "InitDpiScaler":

constructor TfmCodeSearch.Create(_Owner: TComponent);
begin
  inherited;
  //InitDpiScaler; // now using Manifest in Delphi 12
end;

fmCodeSearch.Scaled := True; // Set in Object Inspector

image.thumb.png.8db890799a82cc4e53eb1db7f917a08d.png

 

I've also modernized the LAYOUT from StoneAge Layout (simply place components anywhere without layout considerations) to Modern Layout (use Align and AlignWithMargins properties).

 

Here is the new source of the Search dialog:

 

GX_CodeSrch.zip

 

Edited by PeterPanettone

Share this post


Link to post

Sorry, but I cannot accept this as a patch. This is not compatible to older Delphi versions.

Share this post


Link to post
31 minutes ago, dummzeuch said:

Sorry, but I cannot accept this as a patch. This is not compatible to older Delphi versions.

I clearly said this is for Delphi 12 Athens. Using just a few compiler conditional directives, you can restrict any code to specific newer Delphi versions, for example:

{$IF CompilerVersion >= 36.1}
  // Code for Delphi 12.1 or later
  {$MESSAGE WARN 'Only for modern Delphi versions'}
{$ELSE}
  // code for older Delphi versions
{$IFEND}

 

Edited by PeterPanettone

Share this post


Link to post
2 hours ago, PeterPanettone said:

I clearly said this is for Delphi 12 Athens. Using just a few compiler conditional directives, you can restrict any code to specific newer Delphi versions,

OK, so, where would you put the IFDEF for this?

4 hours ago, PeterPanettone said:

fmCodeSearch.Scaled := True; // Set in Object Inspector

 

Share this post


Link to post

Hm I don't see any scaling issue with this dialog. It looks fine with 125% scaling and rescales properly when I move it between displays with 125% and 100% scaling. I guess that's another case where it works fine with my setup but does not with other people's.

 

Let me guess: You have one or more displays with a scaling > 100% but all displays set to the same.

 

Edit: Yes, if I only use my HighDPI display, I can reproduce it.

Edited by dummzeuch

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×