Skip over navigation

Colour Pop-up Menu Component

Pop-up menu to component display a colour palette

Mothballed

Version 1.2
Released 2008-08-17
Platforms Win32
Framework IDE
Compatibilty Delphi 4 & later

Mothballed

Development of Colour Pop-up Menu Component is frozen.

This component was originally written back in 2001 when I needed a simple colour menu component for an app I was writing. That was in the pre-XP, pre-themes days. The component has never been updated to adopt the "modern" (XP & later) look and feel, so now it looks rather dated.

I have no further need for the component and it would be quite a lot of work to make it themes-aware. Given that there are much better colour menu components out there, it just doesn't seem worth the effort. So I've decided to abandon the project.

If you want to take on maintenance please go ahead. The download section below provides everything you need.

There is no support available for Colour Pop-up Menu Component. Please do not report any bugs or request new features.

Overview

The colour menu component, TPJColourPopupMenu, is an open source non-visual component that descends from TPopupMenu. It implements a pop-up menu that gives access to the 16 basic Windows colours. The menu can be displayed over one, two, four or eight columns. It can also be displayed in one of the four following styles:

  • Text only – the menu displays just the name of each colour.
  • Text and colour – the menu displays the colour name along with a small bitmap illustrating the colour.
  • Colour only – colour swatches are displayed without any text (like a palette).
  • Owner draw – the user provides code that draws the menu items.

The colour names are in English. However, it is easy to provide names in other languages or use Delphi colour identifiers etc. This is done by handling one of the component's events. The accompanying demo program shows how to do this.

Here are three examples of how the menu can appear:

Colour only

(4 columns)

Screenshot of TPJColourPopupMenu text only example

Text and Colour

(2 columns)

Screenshot of TPJColourPopupMenu colour only example

Text only

(2 columns)

Screenshot of TPJColourPopupMenu text and colour example

Included with the component in the download are:

  • A demo project showing how to use the component.

  • Two property editors required by the component – one to prevent editing of the Items property and the other to limit the SelectedColour property to 16 basic colours.

  • A component editor (accessed from a mouse menu when the component is selected) that gives easy access to all the component's main properties. Here is a screenshot of the component editor:

    Screenshot of colour menu component editor

  • A legacy WinHelp help file that can only be integrated with the IDE in Delphi 7 and earlier. This article explains how to do it.

    WinHelp is an optional download for Windows Vista through to Windows 8.1 and can't be installed at all on Windows 10 and later.

Get The Code

The Colour Pop-up Menu Component source code is archived in the ddab-archive/cmenu repository on GitHub. The read-me file of that project explains how to get source code and the final release.

Installation

Information about how to install the component can be found in Docs/ReadMe.htm in the archived Git repository.

License

The Colour Pop-up Menu Component is open source. It is copyright © 2001-2008 by Peter Johnson. The source code is made available under the terms of the Mozilla Public License v1.1. All relevant trademarks are acknowledged.