Units Conversion with Delphi's Data Aware Components

Published: 10:06 PM GMT+12, Monday, 26 June 2006 under: technology pbpower
component  borland  delphi  units  conversion  plugin 

Whilst tidying up for the move this weekend I came across a CD-ROM containing some old screen shots of one of the projects I was working on at $employer using Borland Delphi.

Steamfield Manager

The original (paradox for DOS) applications at $employer had an extensive units conversion system which allowed you to view pretty much any column in the database in any combination of measurement imaginable. Translating this to work in the Delphi environment was quite fun, and Delphi made it surprisingly easy.

If I recall correctly, the core components in I came up with were the TUnitQuery and TUnitTable components - descending from the normal TQuery and TTable components the system overrode the getText/setText methods of each TField so that the conversion's were fed automatically to any data-aware component.

In addition to these two, a TUnitPopupMenu and TDBUnitPopupMenu was created which simply reported/set a specific type of unit with the data-aware version automatically sourcing/updating its details to the linked TUnitQuery/TUnitTable (with all relevant fields automatically updating throughout the display instantly). Several property inspectors were made available to extend the IDE's designer with unit aware configuration settings, with each choice being persisted to the users registry.

I quite enjoyed writing funky component libraries like this, especially the property inspector's, it was amazing to see how easily one could enhance their IDE with specific in-house value-add functionality. I guess this is what drives me to keep writing plugins for IntelliJ IDEA these days, and as much as I miss mucking around with visual components like these, I don't really miss the pascal (or the win32 api) that much...

Comments (1)

hey Mark how are things? SFM looks quite a bit different these days however a good proportion of the classes you mention are still present. You may be interested to know $employer recently sold said software to a US company...

left by aaron . Thursday, 29 June 2006 8:07 AM
Add Comment