Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

None

Return value

void

Examples

Code Block
languagetext
// Anchor two controls two each other, and to the form top-level

...


int $windowId; 

...

int $staticId, $textId;

...


int $formId;

...



// First create a User Window to place the Controls on

...


$windowId = `createWindow "MyWindow"`;

...



// Get the top-level form ID

...


$formId = `getTopLevelForm $windowId`;

...



// Create a label User Control, and add it to the form

...


$staticId = `createStaticBox $windowId -text "Name" -form $formId`;

...



// Create a Text Box Control in the window. Also add it to the

...


// top-level form.

...


$textId = `createTextBox $windowId -form $formId`;

...



// Attach the Static User Control to the top and to the left

...


// of the top-level form

...


setControlAnchor $staticId "left" "left" 0;

...


setControlAnchor $staticId "top" "top" 0;

...



// Make the Text Box User Control stretch from the right side

...


// of the Static Box, to the right side of the User Window

...


setControlAnchor $textId "top" "top" 0 -target $staticId;

...


setControlAnchor $textId "left" "right" 5 -target $staticId;

...


setControlAnchor $textId "right" "right" 0;

...



// Issue the call to lay out the top level form. We only

...


// need to do this once

...


layoutForm $formId;

Additional information

Related commands

...