DFS Color Button

Delphi legacy code modernization
Corrections brought in CBtnForm, ColorAEd, DFSClrBn by Valient Newman to make the component meet the requirements of Delphi 2, 2009 and higher, where WinTypes, WinProcs units are absent.
Checked in Delphi 7 and Delphi 2007, 2009
Updated 15 dec 2025

TdfsColorButton v2.62

A Windows 95 and NT 4 style color selection button, which displays a palette of 20 color for fast selection and a button to bring up the color dialog.

This component can be freely used and distributed in commercial and private environments.

The component DFS Color Button is available in My Github Repository



credits to :
Bradley D. Stowers The author of All Delphi Free Stuff ("DFS")
Copyright 1996, Brad Stowers. All Rights Reserved.

If WinTypes and WinProcs units are absent in Delphi

Alias to the project: WinProcs=Windows WinTypes=Windows
WinTypes and WinProcs units are absent in Delphi 2 and higher.

WinTypes.pas and WinProcs.pas are units from Windows 3.1x., they come from Turbo Pascal and Delphi 1.
In Win9x and later they were replaced with Windows.pas.


First solution to add an alias to the project: WinProcs=Windows, and WinTypes=Windows.
Delphi admits some aliases. For example, aliases for backwards compatibility from WinProcs and WinTypes to Windows.
The full string with conditional compilation directives may be sush as WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;

Second solution is to use in code conditional compilation directives for various Delphi versions.

{$IF CompilerVersion >= 9.0} // Delphi 2 and higher Windows, {$ELSE} WinTypes, WinProcs, {$IFEND}
Remaking old components for Delphi
Переделывая старые компоненты для Delphi

Delphi 2007 and Delphi 2009+ difference in string types. Migration

CodeGear Delphi 2007

This is not a divine revelation, but simply semblance of my personal reference.

In Delphi 2007AnsiString was the default string type used for general-purpose string manipulation.
This means variables declared simply as string were compiled as AnsiString. This changed in Delphi 2009+, where string became an alias for UnicodeString.

AnsiString in Delphi 2007:
  • In Delphi 2007 Char was an 8-bit (1-byte) AnsiChar, while in Delphi 2009+, it became a 16-bit WideChar (UTF-16) by default.
  • Encoding: The interpretation of these bytes depends on the operating system's current active code page (e.g., Windows-1252, or specific locales like code page 936 for simplified Chinese).
  • Length: AnsiString was dynamically allocated and limited only by available memory, unlike the older ShortString that was limited to 255 characters.
The primary distinction in Delphi 2009 and later is the shift to Unicode.
  • Char now represents a 16-bit character, enabling full Unicode support. Char becomes WideChar
  • string is an alias for UnicodeString (UTF-16, 2 bytes per character).
  • AnsiString still exists but is used primarily for backward compatibility or interfacing with non-Unicode systems/APIs.
When moving from Delphi 2007 to Delphi 2009 (or later):
  • AnsiString to UnicodeString: String changes, leading to potential data loss if ANSI data is assigned directly to Unicode strings.
  • Explicit Casts: Use PAnsiChar(myWideString), AnsiString(myUnicodeString) and similar, where needed, and be aware of character mapping.
  • Migration Required: Code using Char, PChar needed updates, especially with assignments between ANSI and Unicode types.
  • If a 1-byte buffer is in need, use RawByteString instead of string or Char. RawByteString is AnsiString with no code page set by default (AnsiString($ffff)).
(e.g., #128 isn't the Euro sign in Unicode).
Delphi and Unicode, Marco Cantù, December 2008

Python uses a short circuit technique

Python logo
It turns out that Python uses a short circuit technique as soon as the final result is determined.

Delphi/Object Pascal is in 8th position on tiobe.com TOP10 list of programming languages for November 2025

The TIOBE Programming Community index is an indicator of the popularity of programming languages. The index is updated once a month. The ratings are based on the number of skilled engineers world-wide, courses and third party vendors. Popular web sites Google, Amazon, Wikipedia, Bing and more than 20 others are used to calculate the ratings. It is important to note that the TIOBE index is not about the best programming language or the language in which most lines of code have been written. The index can be used to check whether your programming skills are still up to date or to make a strategic decision about what programming language should be adopted when starting to build a new software system.
Delphi/Object Pascal is in the 8th position on the tiobe.com TOP10 list of programming languages for November 2025

TIOBE index