WPALETTE-CHOOSE-COLOR (op-code 6)

This operation provides a simple method for getting a color selection from the user. You can use this to simplify the process of constructing your color palette according to your user's desires. When this operation executes, a standard color selection box pops up over your application. This box is similar to the Color Palette portion of the Windows' Control Panel application. It should be familiar to most users.

This box contains a selection of pre-determined colors (called the Basic Colors) that the user can choose from. Windows selects these colors. Typically, there are 48 of them drawn from the entire spectrum (there can be fewer on some systems).

The user can pick one of these by clicking the mouse on it or by using the arrow keys.

Beneath these colors is a set of 16 Custom Colors. Initially, these colors are all white. The user can select the Define Custom Colors option to define new colors. This pulls up a color chart that the user can select from. After selecting a custom color, the user can add it to the set of 16 custom colors by selecting the Add to Custom Colors button. This color is then available for future selection.

The user selects the OK button (or presses <Enter>) to complete selection of the color. The RGB value of the color selected is returned in WPAL-RED, WPAL-GREEN, and WPAL-BLUE.

Alternately, the user can select the Cancel button (or press <escape>). In this case, no color is returned and the value of RESULT is set to WPERR-CANCELLED (see below).

The initial default color selection is black (RGB value 0, 0, 0). You may supply a different default value by moving the desired color into WPAL-RED, WPAL-GREEN, and WPAL-BLUE. You must also set WPAL-FLAGS to WPAL-USE-DEFAULT (value 1). If you do not use this option, then you should set WPAL-FLAGS to zero before calling W$PALETTE.

The color selection box is a standard component of Windows and Windows NT.

Note: In some Windows setups COMMDLG.DLL provides support for the color selection dialog (as well as other standard dialogs). Because ACUCOBOL-GT is used to build applications for use in a variety of nations and languages, Acucorp does not distribute this file. The standard dialogs defined in this DLL contain text that is specific to the local language.