Livecode Wiki
Register
(added example)
Tags: Visual edit apiedit
(more syntax examples)
Tag: sourceedit
Line 1: Line 1:
 
Aids the manipulation of layers. Syntax:
 
Aids the manipulation of layers. Syntax:
relayer <nowiki><control></nowiki> to {front | back} of <nowiki><owner></nowiki>
+
relayer control {before | after} layer index
  +
  +
relayer control {before | after} controlTarget
  +
  +
relayer control {before | after} owner
  +
 
relayer control to {before | after} of layer index
  +
  +
relayer control to {before | after} of control target
  +
  +
relayer control to {before | after} of owner
   
relayer <control> after|before <control2>
 
 
Examples:
 
Examples:
 
relayer button "b1" after button "b2" -- bring button b1 to front
 
relayer button "b1" after button "b2" -- bring button b1 to front

Revision as of 16:14, 29 December 2016

Aids the manipulation of layers. Syntax:

relayer control {before | after} layer index
relayer control {before | after} controlTarget
relayer control {before | after} owner
relayer control to {before | after} of layer index
relayer control to {before | after} of control target
relayer control to {before | after} of owner

Examples:

relayer button "b1" after button "b2" -- bring button b1 to front
relayer button "b1" to back of card "testCard" -- send button b1 to the back of card testCard

Use the relayer command to aid the manipulation of layers.

Use the relayer command move a control relative to a target in a number of ways. The relayer command can only be used within a card. Attempts to relayer controls from one card or another stack would throw an exception.

When using "before" the owner of the control becomes the owner of the target and is inserted before the target. The layer of the control becomes the layer of the target and the target and all subsequent controls shift up one. When using "after" the owner of the control becomes the owner of the target and is inserted after the target. The layer of the control becomes one greater than the layer of the last child of the target and all subsequent controls sift one up. When using "front" the owner of the control becomes the owner of the target and is inserted after the last child of the target (only valid if target is a container). When using "back" the owner of the control becomes the owner of the target and is inserted before the first child of the target (only valid if target is a container).

Parameters:

  • control: The target control is the given control.
  • layer: The target control is the control with layer index.
  • index:
  • target:
  • owner:The target control is the owner of the control.

See also: number (function),mouseControl (function),tabGroupBehavior (property),relayerGroupedControls (property),layer (property),