Skip over navigation

Welcome to the all new DelphiDabbler website.

I hope you like it.

There are going to be bugs. Please report any you find on the website's issues page (GitHub account required). Thanks.

Click the close button and you won't see this message again.

Colour Pop-up Menu Component

Pop-up menu to component display a colour palette

Mothballed

Version 1.2
Released 17 Aug 2008
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.

Get The Code

The source code of Colour Pop-up Menu Component is archived on Google Drive in two forms:

  • The source code: cmenu.zip.

    Source code of the final release of the component. Download this file if you simply want to install and use the component.

  • Subversion repository dump: cmenu-dev.zip.

    Complete development source tree for the final (v1.2) release of the component. Download this file if you want to develop the component further. Contains all the files required to modify and rebuild the component and the help file along with additional documentation.

Installation

Information about how to install the component can be found in the ReadMe.htm file included in the download zip file.

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.