Making the Glyph Property High DPI Aware for TBitBtn and TSpeedButton

Finally, last step in making my (/your) Delphi application not only high-dpi aware but also high dpi button-glyph-display-size-as-expected-ware. In my last post I’ve shared how to programmatically upsize images in TImageList so that menus, popups, toolbars and other controls using image lists appear more appealing on high dpi displays. This time I’m dealing with button images, more precisely programmatically upsizing the bitmap set for the Glyph property.
Continue reading

Resizing TImageList Bitmaps to Fit High-DPI Scaling Size (for Menus, Toolbars, Trees, etc.)

high dpi menu bitmap rescaling
So, you’ve made your Delphi application high-DPI aware and after a few manual fixes the UI looks more or less usable on 4K displays having logical DPI values set to more than 100% (96 DPI). However, you open up the application’s main menu (or any popup menu) set to display images from an image list – and your fancy images appear super small (or are not drawn at all when you move your mouse over items)? The same small images appear on toolbars? You then note buttons having their Glyph property set to display some 16×16 pixels graphics – caption font is ok, but the glyph is also barely visible. Now what? How to have those images at the correct size for the applied DPI scaling?
Continue reading

Delphi High-DPI Road: Ensuring Your UI Looks Correctly for TImage, TColorBox, Owner Drawn TComboBox , TStatusBar and some more

So you want to go down the high-DPI road? Feeling alone? I did 🙂 The classical answer “it works on my machine” will not be sufficient here. Your non high-dpi aware Delphi application might look nice on your development machine, but it certainly looks super small or ugly stretched on your client’s shiny new 4K resolution laptop – and it really does not work – at least not how you and your client would expect!

Continue reading

Writing and Enabling Delphi Applications to Support High DPI Displays and 4K Screen Resolutions

Set DPI
Woohoo! After a few weeks of struggle I’ve finally high-dpi enabled my used-across-the-globe Delphi application.

It was not a too hard job – it just took a lot of time and experimenting (read: fixing) how the UI of the application appears on various 4K displays having various settings for “Make text and other items larger or smaller” (Windows Vista/7/8), which is the same as “Set a custom scaling level” (Windows 10).

Continue reading

Quick Tip: Implement Zoom In Virtual TreeView Using CTRL + / CTRL –

Virtual TreeView Zoom Most Windows applications I use in my daily work (email clients, browsers, text editors) have a handy feature allowing to make the text larger by increasing (or smaller by decreasing) the font size. Increasing the text size in a web browser is something I got accustomed to doing frequently – to make the web page easier to read if the default text size was set too small for my eyes.

Even though all applications have some visual way (track bars mainly) to zoom in/out their display – all also support zooming by using (standard?) keyboard shortcuts. CTRL+Plus to increase the font size, CTRL+Minus to decrease. Am not sure if you know, but Delphi IDE unit editor also has this feature.
Continue reading

Time Out a Message Dialog – Auto Close a Dialog Window After Some Time / Seconds

messagedlgtimed Users do not read dialogs. They. Do. Not. Neither do we developers (admit it). Dialogs are scary things that pop to the user asking to make some kind of selection / decision. Users mostly simply click the little [x] button and hope no further questions would be raised. Regression: do you know what happens in your code if you display a [Yes|No] dialog and the user closes it by clicking on the [x] button?

Among various types of dialogs (and the information inside) you present to the user, be it a warning, error or information, one type actually requires no user input. Such dialogs are those displaying only the OK (or any single) button. It is questionable should you even have a dialog stating something to the user where the only possible user action is to click on the only button (+ the [x]) displayed by the dialog. Anyhow, I’m certain you have (at least I do) lots of those (…,mtInformation, [mbOk], …) scattered around your code.
Continue reading

Speed Up Your Delphi Database Apps Using Remote SQL

remotesql I recently came across a new product in the Delphi world called RemoteSQL. I use and see a lot of Delphi components in my day to day work, but this one caught my eye because it deals with one of my (/everyone’s) pet peeves – speed. RemoteSQL is an additional client-server application tier that significantly speeds up the connection of a client application to its database, when they are not in the same network. According to GoFast, the creators of RemoteSQL, in a typical environment using their system can speeds up your connection by a factor of between 5 and 40, and in extreme cases up to a factor of 80 which, if true, are rather impressive numbers.
Continue reading

64-bit Delphi Applications Using TWebBrowser to Display PDF Documents – Go or No-Go?

I have an application using TWebBrowser component to allow viewing of Adobe PDF documents within the application. This approach is really pretty simple: when a user of the application has Adobe Reader (/Acrobat) installed, by default any PDF documents will get open inside Internet Explorer (and therefore inside TWebBrowser) – neat and simple way to provide easy PDF preview in a Delphi application (until you go 64-bit…).
Continue reading