Archive for February, 2009

Delphi Compiling All Delphi Sources When a User Project is Compiled

Wednesday, February 25th, 2009

Strange things just seem to happen to me.  I was experimenting with dynamically loaded run time packages and I wanted to include patched versions of some of Delphi’s units in my run time package.  So, I removed vcl.dcp from the Requires list and added the various Delphi units that I needed to the Contains list for the package.  Everything worked just the way I wanted.  My run time package used all of the Delphi run time units except for vcl.bpl.  Unfortunately, from this point on, every time I tried to compile one of my other projects, Delphi insisted on compiling all of the Delphi units in addition to my own.  Turns out, sometime during my attempts to force patched versions of the Delphi source to be used by my run time package, ($BDS)\source\win32\vcl got added to the IDE’s library path.  Once I removed that from the libaray path, everything went back to normal.  Weird!!

Scaling Between Large and Small Fonts

Wednesday, February 11th, 2009

I recently needed to be certain that my Delphi application would work the same whether the user selected ‘Normal” or ‘Large’ fonts in their Windows display properties.  I read the documentation and it appeared as though is should all work reasonably well  as long as the form’s Scaled property were True.  So, I set the property to True, changed my system to large fonts and let ‘er rip.  Guess what, it didn’t work.  The form’s caption and menus changed, but the controls that I placed on the form did not.  What the heck??

Much debugging and gooling later, I discover that there are two places in the Display Properties dialogue where you can select Normal or Large Fonts.  If you use the most obvious place, namely the Appearance tab, only form titles, menus and certain system dialogues change.  If you use the Advanced dialogue on the Settings page everything changes.


Why there would be two settings for the same thing that give different results I can’t imagine.

Creating a Form Wizard - Part 2

Tuesday, February 10th, 2009

In the last article, I described a way to make a TForm (or TFrame) descendant and register it with Delphi as a custom module.  This is all well and good, but forms and frames don’t appear in the tool box like other Delphi components.  They appear in the repository.  So, how to make the custom form or frame appear in the repository as though it were a native Delphi component?

The answer lies in the Open Tools API (OTA).  You need to create a Form Wizard using this poorly documented interface to Delphi’s IDE.  The coding itself is not particularly difficult but finding up to date documentation for the OTA is next to impossible.  Here is what I have been able to find out after a lot of googling.