Palettes

palette = integer

Applicable to:
Windows; buttons; button groups; graphics; listboxes; menus; OLE controls; static text; tables; textboxes, textbox groups

A window’s palette provides a collection of pens and properties to be used in the display of data, labels and graphics.

The palette names are defined in the include file $SCULPTOR/include/sculptor.h. See Palette names for a list of the values available. Each palette name defines a number - this is the palette’s number in Sections 11 (Palette Defaults) and 12 (Palette Pens) in the terminal parameter file.

Palettes 1-8 are only applicable to colour terminals. On monochrome terminals, only two backgrounds are provided; palettes 1 to 7 are identical and define a standard background, while palette 8 is a reverse background.

IMPORTANT NOTE

From Sculptor 5 onwards, the recommended method of defining colours is to use Colours wherever available. Palettes and pens are still required for backward compatibility.

If colours are defined, they take precedence over palette and pen definitions. For example, a label_fgc clause takes precedence over a label_pen clause. The exception to this is the caption_pen clause, which is set at window control level and therefore takes precedence over caption_bgc | caption_fgc, which are window-level clauses. See Captions.


NOTES

  • It is not normally necessary to specify a palette. If the palette clause is omitted, the current desktop defaults are used.


EXAMPLE

palette = PAL_DROP_MENU
palette = PAL_CYAN_WINDOW
palette = 5

Default palette

Under Windows, the default palette is that which has been chosen or designed by the user in the Windows Control Panel (Display) as the Windows palette. Frequently this is also the palette required for Sculptor application windows, in which case it is not necessary to specify a palette. The default palette for all window controls is the parent window palette.

The default palette is used whenever the palette = clause is omitted, or if palette 0 (zero) is specified.

Omitting a pen clause (e.g. label_pen =), or setting the pen to 0, causes the default colours in the active palette to be used, regardless of whether that is a Windows palette or a Sculptor palette.


Window control palettes

Controls within a window may specify their own palette, or may use a palette specified at group level. If the palette = clause is absent or the palette is set to 0, they use the parent window palette, which defines sensible styles and pens to be used for all window control types. It is unnecessary to specify a palette at window control level unless the defaults are to be overridden.

A pen may be specified for a graphic; the parent window palette is always used.


Editing or creating palettes

A set of palettes for all window types and background colours is provided with the Sculptor system, and any of these may be specified as an alternative to the Windows default. These palettes may themselves be modified by editing the terminal parameter file. For example, the colour of button label text, or of the window title, may be changed. When the parameter file is recompiled, all the changes are immediately reflected in all windows using that palette. This enables uniformity of appearance to be maintained throughout a windowing system.

User-defined palettes may also be created, beginning at number 51.


RELATED TOPICS

Property clauses

Pens

Palette names

Terminal parameter files