(System Library)
Description: Color Selection Tool. This module draws a color selection button and its accompanying display area.
Returns: Nothing
Usage: Steady State
Format: \System\ColorSelect(X1, Y1, X2, Y2, Color [, BtnLabel, BtnOnLeft, Standard, VertAlign, FocusID, OpenDialog, NoTrans])
Parameters: X1 { numeric } { required } { no default: }
Any numeric expression giving the X coordinate on the screen of one side of the button or color display area.
Y1 { numeric } { required } { no default: }
Any numeric expression giving the Y coordinate on the screen of either the top or bottom of the button and color display area.
X2 { numeric } { required } { no default: }
Any numeric expression giving the X coordinate on the screen of the side of the button or color display area opposite to X1.
Y2 { numeric } { required } { no default: }
Any numeric expression giving the Y coordinate on the screen of the top or bottom of the button and color display area, whichever is the opposite to Y1.
Color { numeric } { required } { no default: }
The variable whose value is set to the index of the chosen color.
BtnLabel { text } { optional } { no default: }
An optional parameter that is any text expression to be used as a label on the color selection button.
BtnOnLeft { Boolean } { optional } { default: true }
An optional parameter that is any logical expression; if true (non-0) the button will appear to the left of the color display area, if false (0) it will be to the right. The default value is true.
Standard { Boolean } { optional } { default: true }
An optional parameter that is any logical expression; if true (non-0) the button and color display area will be standard system size, if false (0) they will be sized to fit their boundaries and VertAlign will be ignored. The default value is true.
VertAlign { numeric } { optional } { default: 0 }
An optional parameter that is any numeric expression that sets the vertical alignment of the button and display area according to one of the following options:
|
Value |
Vertical Alignment |
|
0 |
Top |
|
1 |
Center |
|
2 |
Bottom |
If Standard is true, this parameter is ignored. The default value is 0, top alignment.
FocusID { numeric } { optional } { default: 1 }
An optional parameter that is any numeric expression for the focus number of the button. If this value is 0, the current value of Color will still be displayed, but it will not be able to be set because the button will appear grayed out. The default value is 1.
OpenDialog { Boolean } { optional } { default: true }
An optional parameter that is any logical expression; if true (non-0) the dialog will be open; if false (0), it will be closed. The default is true.
NoTrans { Boolean } { optional } { no default: }
An optional parameter that enables you to turn off the transparent color option. If NoTrans is set to true (1), then the transparent color option will be turned off. If NoTrans is set to false (0), then the transparent color option will be turned on. (The transparent color option is set within the color selection dialog using the "Transparent" (or "Transparent Brush" or "Transparent Pen") checkbox.)
Comments: This module is a member of the System Library, and must therefore be prefaced by \System\, as shown in the "Format" section. If the application you are developing is a script application, the System variable must be declared in APPMOD.SRC and need not be prefaced by a backslash in the function call.
If the button and display area are set to be standard size, the button size will remain a constant size (101 x 31 pixels) regardless of the boundaries of the defined area, but the display area will vary between a minimum (square) size to a maximum length equal to the length of the button, depending on the size of the bounding area. Once the maximum display area size has been reached, the button and area will be fully justified to cover the entire width of the defined area (the vertical alignment will be set by the value of VertAlign).
For any optional parameter that is to be set, all optional parameters preceding the desired one must be present, although they may be invalid.
Examples:
System\ColorSelect(10, 300, 210, 200 { Location of btn/display },
MyColor { Variable storing color },
"Set Pipe Color" { Button label },
1 { Button on left },
1 { Standard sizing },
1 { Center btn/display },
3 { Focus ID of button });
See Also: