dzlib

Over the years I have been building and extending a utility library. After I had to abandon (and rewrite)  it a few times because I switched to another job and my then ex-employer claimed ownership of the code, I put it under the MPL. The result is now called dzlib (dz = dummzeuch) and is available from the dzlib + buildtools sourceforge page.

Of course, it has grown over the years and there are many features that are now superseeded by later Delphi versions. Also, it’s not as well structured as I would like it to be, but still, it might be interesting for others. Also, for now, I continuously expand and improve it, because I and my colleagues use it in our daily work (and my employer is aware that it is MPL).

Some highlights:

  •  w_dzDialog is a multi purpose dialog modelled on the message box but more flexible. It allows to show exceptions with call stack (using JclDebug for that) and is always centered on the owner form rather than the screen.
  • u_dzDefaultMain and friends are for extracting command line parameters and generating a generic help dialog for it
  • u_dzClassUtils and u_dzVclUtils provide various TXxxx_Yyyy functions that extend the functionality of base classes and controls, like
    • TStrings_DeleteStrings
    • TStrings_GetObjectIndex
    • TStrings_Same
    • TStrings_SameText
    • TIniFile_TryReadFloat
    • ….
    • TGrid_Resize
    • TGrid_SetNonfixedRowCount
    • TStringGrid_AddColumn
    • TStringGrid_DeleteRow
    • TStringGrid_InsertRow
    • TStringGrid_AppendRow
    • TMemo_DeleteTopLines
    • TMemo_GetCursorPos
    • TMemo_SetCursorPos
    • TMemo_ScrollToEnd
    • TPageControl_AddTabSheet
    • TForm_CenterOn
    • TForm_ActivateDropFiles
    • TApplication_GetExePath
    • TApplication_HasVersionInfo
  • InputValidator (in u_dzInputValidator) which (for now) provides some input validation functions for TEdit and TComboBox controls. Like
    • Check if input is an integer or double
    • Check if input is between given limits
  • u_dzBeep for playing a sequence of beeps in a separate thread so the main program does not stop while doing this
  • u_dzNamedThread providing a descendant of TThread that allows to set a name to be displayed in the debugger window
  • u_NullableXxx which provides enhanced records which can have the additional value “invalid”:
    • TNullableSingle/Double/Extended
    • TNullableDate/DateTime/Time
    • TNullableInteger/Int64
  • u_dzDllLoader/ResourceDllLoader allow to access DLLs functions in a object oriented manner, the latter provides loading a DLL from the program’s resources rather than from disk (which is a hack, so beware that it might not work on the latest and greatest Windows version)
  • u_dzTranslator/Ado/BDE/JVCL/ReportBuilder/FastReport are units for adding internationalization based on GnuGetText and registering some classes/properties to be ignored
  • u_dzVersionInfo provides some objects around file version information (requires JclFileUtils and JclResources)
  • u_dzWinApi, u_dzShellApiUtils provide additional functions regarding the Windows, Shell APIs
  • u_dzFileUtils, u_dzStringUtils provide utility functions for files and strings
  • u_dzStringPool allows to minimize memory usage for strings if you are using lots of duplicate strings

There is much more.

Most of the library has German, French and English translations of the messages and exceptions (German and English is complete, French isn’t any more), using GnuGetText (or rather u_dzTranslator).

There are <summary> … </summary> type comments in English for most of its classes and functions.

Some of it is probably still compatible with Delphi 6 and 7, most will work with Delphi 2007 (which is the version I use most) and some very small parts require later versions (tested with Delphi XE2).