"Fancy Shortcuts" for Delphi 10.1 Berlin



Open sourced freeware Delphi IDE extension.
Latest Version: 1.3 (10 October 2016)
Copyright © 2016 Angus Johnson

Features:

  1. Quick Searching: Ctrl+Alt+Up and Ctrl+Alt+Down navigates to previous and following occurrences of the word under the cursor (with extended highlighting)
  2. Procedure/Function navigation dialog: Ctrl+Alt+L. For larger units this dialog is much more responsive than the edit controls in the Navigation bar.
  3. Bookmark Editing: Ctrl+Shift+F5, so you no longer have to gab your mouse.
  4. Toggle the Refactor window: Ctrl+Alt+H
  5. ANSI Chart: Ctrl+Shift+A to popup.
  6. CALC.exe: Ctrl+Shift+C. Calc at your fingertips whenever you need it.
  7. Rescale forms and all contained controls: Ctrl+Alt+Z (when viewing forms in Text View)
  8. IDE Font adjustment: Essential if you're making the IDE DpiAware (see below).

Keyboard shortcuts are fully customizable to your own key strokes and compound key assignments are also supported (eg 'Shift+Ctrl+W+W').

Screen Shots:




  


Download:


fancyshortcuts.zip

Install instructions:

  1. Unzip package into your preferred folder and open FancyShortcuts.dproj in the IDE.
  2. Compile
  3. Right click on FancyShortcut.bpl in Project Manager and select 'Install'.

Notes:


This IDE Extension has only been tested in Delphi 10.1 Berlin.
It may work "as is" with earlier versions of Delphi too or it may work with minor modifications (depending on the age of the compiler).

If you don't like anything, it's very easy to uninstall and it's completely open source so of course you can tweak it to your own needs too. Enjoy :).

Changes since version 1.1:

Making the Delphi IDE DpiAware: Background


The Delphi "integrated development environment" (IDE) is severely affected by blurry fonts whenever the Windows Operating System applies font scaling significantly above 100%.



As computer screens improve and pixel densities continue to rise, fonts that are based on a 'normal' resolution of 96dpi will appear smaller on screens with relatively high pixel densities. Because of this, PCs with higher pixel density screens commonly apply font scaling (by a fixed percentage specified in Windows Setup).

This font scaling can be achieved in one of two ways: for applications that aren't "DPI aware" (like Delphi's IDE), the OS stretches the application content onto the screen; alternatively, applications can do their own font (and image) scaling internally. While the first approach is simpler for application developers, stretching causes blurring of the application content, and this becomes quite pronounced with higher degrees of scaling. With the latter approach, application developers adjust font sizes before the text is drawn onto the screen, and this preserves perfect text clarity.

On my Microsoft Surface Pro 3 laptop with a relatively high resolution screen, the recommended font scaling is 150% (see below). At that degree of scaling, text in the Delphi IDE is unacceptably blurry (as you can see in the image above). If I lower this setting back to 100% (ie no scaling), while text clarity is restored, text in the Windows shell (menus, Explorer etc) and in most applications becomes too small to read,



This blurring can easily be avoided by making applications "DPI-aware". DPI-aware applications handle font scaling internally and, since OS doesn't need to stretch the window content, font (and image) clarity is preserved. Why Embarcadero still hasn't made the Delphi IDE DPI-aware is a mystery.

Making the Delphi IDE "DPI Aware": Essentials


These are the steps to do this (and they're easily reversed if you aren't happy with the changes):
  1. Add a simple manifest file into the Delphi 10.1 'bin' folder: bds.exe.manifest
    This is a small (2KB) XML text file that's a very minor modification of the manifest resource found in bds.exe. Only 2 lines have been changed.
  2. Force the OS to prefer external manifest files if they're present.
    Do this by opening regedit.exe and navigating to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide
    Once there, add a new DWORD key: "PreferExternalManifest" and set its value to 1.
    (There's more information about this here.)
You'll need to log out and log back in again to Windows for this to take effect, but that takes care of the essentials.

Of course there are side effects in doing this, apart from regaining crystal clear text. All text in the IDE will be smaller, and this requires some further adjustments ...

Making the Delphi IDE DpiAware: Final Tweaks


  1. The 'Welcome Page' layout needs adjusting. This is easily done with a few simple changes in the styles.css file found in the 'Welcomepage\css' folder where Delphi has been installed. Here's a replacement styles.css file.
  2. The Editor font can be adjusted in 'Tools | Options | Editor Options | Display'.
    Change the font size setting there to 12 (or something similar).
  3. Other changes to the IDE - internal adjustments to font sizes etc - need to be made with an 'IDE extension'. Fancy Shortcuts (see above) makes this easy by adjusting IDE font sizes, and it can even rescale forms.

There will remain a few minor cosmetic annoyances, but these generally aren't worth bothering with.