ConTEXT for High DPI with new Icons

Today I published a new version of the ConTEXT editor.

As I explained in my previous posts ConTEXT is a small, fast and powerful freeware text editor, developed to serve as a secondary tool for software developers.

It has originally been hosted here. Since I couldn’t contact the original developers I published the source code under bitbucket. The code can be compiled with Delphi 10.3.3 Rio. I also added the Win32 and Win64 binaries. For the German language I uploaded a language file.

The first huge change that I added to ConTEXT are new icons. The old ones looked some kind of ancient and didn’t exist in higher resolutions. That’s why one of the Embarcadero Product Managers, David Millington, sponsored new icons. They really look fantastic and many thanks to David for this great support!  He also told me that he will publish theses icons under an open source license, so that the Delphi community can use them. As soon as David will publish them I will tell you.

Since the new icons are available in different resolutions I used the new TVirtualImageList of Delphi Rio. The Embarcadero Wiki explains all details about this component. In short words it finds out during runtime which resolution of an icon fits best to the current resolution of the screen. This means that in this case the icons are not stretched under High DPI, the virtual image list simply uses the icons with the higher resolution.

I also set the “scaled” property of all forms during designtime to true. In a nutshell scaled forms automatically resize themselves to the DPI of the screen. This feature has been improved in Delphi Rio so that I can only recommend to use Delphi Rio for High DPI.

ConTEXT use some very old components that use hard coded positions with Left, Top, Width and Height. For this code you always have to consider that the Delphi designer internally saves all positions for 96 DPI. This means that you have to recalculate these positions with MulDiv like

Height := MulDiv(Height, Screen.PixelsPerInch, 96);

If you are interested then use ConTEXT and enjoy the fact that the legacy code has been compiled with Delphi Rio and supports modern features like High DPI! And also look at David’s new icons!

This entry was posted in RAD Studio 10 Seattle, RAD Studio 10.1 Berlin, RAD Studio 10.2 Tokyo, RAD Studio 10.3 Rio, RAD Studio XE5, RAD Studio XE6, RAD Studio XE8, Tips and Tricks, Uncategorized. Bookmark the permalink.