SelColor

(VTScada-Layer function. Must be called with a leading backslash.)

Description: Sets a color value from a dialog
Returns: Nothing. (The selected color is returned via the second parameter)
Usage: Steady State only.
Function Groups: Graphics
Related to: ColorSelect |PColorSelect |
Format: \SelColor(Label, ColorIndex, Enable, NoTrans, ShowColorIndex, DisplayRoot)
Parameters:  
Label
Required text. Sets the title of the color selection dialog.
ColorIndex
Required text. The selected color value will be returned via this parameter.
Enable
Required Boolean. Must be set to TRUE for the color picker to open. This parameter is set to FALSE by the color picker upon closing. Use this as a signal that the user has chosen a color.
NoTrans
Boolean. Deprecated option - all transparent options are shown.
ShowColorIndex
Optional Boolean. When true, the string value, "<aaRRGGBB>" of the selected color is shown. Defaults to true.
DisplayRoot

Optional object value.

For example, to make the dialog appear on a monitor than the one holding the window that contains the caller of SelColor (or if the caller of SelColor is not running inside a window), you can pass an object into DisplayRoot to specify the monitor that the dialog should appear on. You would pass in an object running in a window on the desired monitor. Thus, to make the dialog appear on the same window as a pop-up page, you would pass in the popup page object.

Comments:

Displays the standard VTScada color-picker dialog.

Example:

ColorSelect [
  \SelColor(GetPhrase("SelectColorLabel"), Color, Open, TRUE, TRUE, Session);

  If !Open;
  [
    IfThen(Color != OldColor,
      UserSelectedColor = Color;
    );
    Slay();
  ]
]