CAPL Script

SetControlVisibility

Syntax

void SetControlVisibility(char[] panel, char[] control, long visible);

Function

Sets the visibility of panel elements. The panel is accessed by its individual panel name that is entered in thePanel Designer/Panel Editor.

Parameters

panel Panel name, restricted to 128 characters."" – references allloaded panelsIf you open a panel the first time, the panel is loaded.
If you close the panel, it remains loaded.

control

Name of the control, restricted to 128 characters.You can only activate/deactivate the control with its name. In the property dialog of the control it's name is assigned/displayed. If you want to use the name of a symbol (signal or environment/system variable) you have to ensure that the control hasnoname instead of the individual control's name. The name of the environment variable, system variable or signal could be specified as following. The form for signals is: "Signal:".The form for environment variables is: "EnvVar:".The form for system variables is: "SysVar:". The name space must not be used.

visible

Sets if the panel element should be visible or not. visible = 1 => Panel element is visiblevisible = 0 => Panel element is not visible

Return Values

// Set the visibility for a specific control of a panelSetControlVisibility("motor", "PedalPos", 1); // All controls of the panel are set to not visibleSetControlVisibility("motor", "", 0); // All controls of all panels are set to visibleSetControlVisibility("", "", 1);

SetControlBackColor | SetControlProperty | SetControlColors | SetDefaultControlColors