Supporting System Font in InputQuery Delphi Function

Filed under:  — 

Now, once all forms in Delphi application are modified to support Large Fonts and System Font ok, there are two forms outside of control. These are the forms that are invoked by InputQuery and MessageDlg VCL functions.
Fortunately, MessageDlg supports Large Fonts and System Font ok. InputQuery supports only Large Fonts, and does not support System Font.

Screenshot: Original InputQuery when System Font is Tahoma

InputQuery not supporting System Font

InputQuery implementation is hidden inside VCL, so a patch VCL source code is needed.

  1. Locale Dialogs.pas unit in VCL source folder
  2. Save As Dialogs.pas to project folder using NewDialogs.pas file name
  3. Go to Project/Options window, then go to Directories/Conditionals tab, then go to Aliases/Unit Aliases group and define new unit alias: Dialogs=NewDialogs
  4. Locate InputQuery function in implementation part of NewDialogs.pas unit
  5. Insert code from previous two posts adjusting Custom DPI and System Font right before "if ShowModal = mrOk then" line
  6. Build the project

The resulting InputQuery window will look like:

InputQuery supporting System Font

Trackbacks for this post

No trackbacks exist yet. Be the first to comment on this post!

» Trackback URL for this post is http://www.gerixsoft.com/trackback/17

Comments for this post

No comments exist yet. Be the first to comment on this post!

» Comment form for this post is here