Vicon Shogun banner

Description

Creates a group box user control on the user window that is specified by windowID.

A group box is a form user control with a visual component. A group box is usually used to demarcate groups of controls. As it is a form, it can also manage the layout of those controls. For information on how to use the layout features of a form, see createForm.

The control is initially placed in the top-left corner of the user window, and must be placed by using the -pos option, or by using the setControlPos command.

The command returns the control ID of the user control, which should be saved for later operations on the control.

Functional area

User Window

Command syntax

Syntax

createGroupBox parentWindowID [-hidden] [-text string] [-pos integer array] [-form integer]

Arguments

NameTypeRequiredComments
windowIdintyesID of user window to place the control on.

Flags

NameFlag argumentsArgument typeExclusive toComments
hidden0Specifies that the control should be hidden initially. Call showControl to subsequently make it visible. The default is for it to be visible.
text1stringThe text that gets displayed with the control. The default is no text.
pos1integer arrayA four-element int array representing a rectangle, which specifies the initial size/position of the form relative to the top left corner of the user window. The element order is Left, Top, Right, and Bottom. The default is a group box 200 units high by 200 units wide.
form1integerControl ID of the form user control which will dynamically position this control.

Return value

integer

Examples

// Create a group box user control.
int $windowId;
int $groupId;
int $topForm;
int $controlId;

// First create a user window to place the Control on
$windowId = `createWindow "MyWindow"`;

// Get the top level form
$topForm = `getTopLevelForm $windowId`;

// Create the group box, adding it as a child of the
// top level form.
$groupId = `createGroupBox $windowId -form $topForm-text "Group Box"`;
setControlAnchor $groupId "top" "top" 0;
setControlAnchor $groupId "left" "left" 0;
setControlAnchor $groupId "right" "right" 0;

// Now create a Text Box, and anchor it so that the text box spans
// the length of the group box
$controlId = `createTextBox $windowId -text "Text Box" -form $groupId`;
// Anchor it
setControlAnchor $controlId "top" "top" 20;
setControlAnchor $controlId "left" "left" 20;
setControlAnchor $controlId "right" "right" 20;
// Now, call layoutForm, which will do the managing of the controls
// under the form
layoutForm $topForm;

Additional information

Related commands