Jump to content
PeterPanettone

Does GExperts suffer from amnesia?

Recommended Posts

Delphi 12.1, GExperts 1.3.24 build 4222, Windows 11:

 

Code Librarian doesn't remember its window sizefont size, and the width of its treeview panel, although I have saved the IDE desktop after setting both.

 

Is this a bug, or is there a trick to having these options restored between sessions?

Share this post


Link to post

Since this is no dockable window, saving the IDE's desktop is not necessary to save its settings. Just setting them in the configuration dialog should be enough. And it does work for me. Just tested it in Delphi 10.2.

You didn't specify which Delphi version you are having this problem with. Am I to assume it's Delphi 12 since that what's listed in your profile?

Share this post


Link to post

Dear Thomas,

 

In my posting, I mentioned "Delphi 12.1".

 

I suppose that by configuration dialog, you mean CodeLibrarian's Options dialog where I have set the font size:

 

image.png.b3f3c2d9aebbba584adb2b6816faa342.png

 

But as soon as I reopen CodeLibrarian, the settings are lost.

Share this post


Link to post

Argl. Maybe it's me who is suffering from amnesia...

I know the culprit: It's the bloody scaling again. It overwrites the font sizes read from the registry with the defaults.

But the layout should not be affected by this, and in my installation it isn't.

Share this post


Link to post

Dear Thomas,

 

Thank you for quickly finding the cause of the CodeLibrarian's misbehavior! Does this mean that you also have a remedy?

 

The "Side-by-side" Layout is preferable on a widescreen monitor, of course:

 

image.png.470ade075c62fd0c7b68c617106455ce.png

 

However, it's the width of the treeview that is not remembered.

 

image.png.86d1fa5a9e32233cbe8a45d1ea2a4d63.png

Share this post


Link to post

The remedy is not to use scaling. 😉 (won't help here either, because the code is still called.)

Not yet, unfortunately it's rather complex to fix this, especially since this applies to all dialogs that allow changing the font size.

Share this post


Link to post
6 minutes ago, dummzeuch said:

HighDPI scaling

Has Delphi not been suffering from this problem for many years now?

Share this post


Link to post
3 hours ago, dummzeuch said:

The remedy is not to use scaling. 😉 (won't help here either, because the code is still called.)

Not yet, unfortunately it's rather complex to fix this, especially since this applies to all dialogs that allow changing the font size.

The problem is IMHO: SaveSettings() is called only from the Destructor; that is when the IDE is closed.

In case of the Code Librarian, the font size and splitter position issues could be solved by calling SaveSettings() during FormHide(), and calling LoadSettings() during FormShow(). Optionally call SaveSettings() when returning from the Configuration dialog.

  • Thanks 1

Share this post


Link to post
6 minutes ago, Achim Kalwa said:

SaveSettings() is called only from the Destructor; that is when the IDE is closed.

This might also cause another existing problem: Currently, if the IDE CRASHES (which unfortunately happens sometimes), all changes in CodeLibrarian (e.g., adding an Item) are LOST!

 

So, the remedy proposed by you should also be applied to content saving: All CodeLibrarian CONTENT CHANGES should also be saved during FormHide).

Share this post


Link to post

The problem is not that the settings are not saved. I checked it and they are. The problem is that the settings are loaded after the scaling has been initialized and that initialization saves the font sizes. Then the settings are loaded and the font sizes are set, just to be overwritten again when scaling is applied after that. 

This is why the problem only occurs in Delphi 11 and 12, but not e.g. in Delphi 10.2, as I stated above.

Share this post


Link to post
Posted (edited)
52 minutes ago, dummzeuch said:

the scaling has been initialized

Are you sure that "scaling" generally works as intended? Maybe we could do without it 

Edited by PeterPanettone

Share this post


Link to post
12 hours ago, PeterPanettone said:

Are you sure that "scaling" generally works as intended? Maybe we could do without it—all the more so because it interferes with the font settings.

Yes, it works as intended with most windows by now. And turning it off is not an option anyway.

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
×