/ HALion Developer Resource / HALion Macro Page / Controls /

Drag Group

(Since HALion 7.0)


On this page:


Description

The Drag Group control allows you to implement drag operations. You can drag a simple text information or excecute more complex script functions. As a drop target you can use either the Drop control, or an external target. The graphical representation of the dragged object includes a snapshot of all controls that exists inside the Drag Group.

Properties

PopertyDescription
NameThe name of the element. This name will be displayed in the GUI Tree.
ScopeAllows you to define which part of the Program Tree is affected by the controls inside the Group.
Drag InfoThe Drag Info can be used as follows:
  • It can be a string that will be send to the target.
  • It can be a UI variable that will be read at drag time.
  • It can also be modified at drag time by the script callback onDropGetInfo by returning another string.
Position/SizePosition X, Position Y, Width, Height: Position and size of the element in pixels. Position X/Y defines the position of the upper left corner.
AttachDefines how an element behaves when its parent element is resized. You can set the following parameters:
  • Left: If the parent element is resized, the element remains attached to left edge, with the specified ratio.
  • Right: If the parent element is resized, the element moves relatively to the right edge, with the specified ratio.
  • Top: If the parent element is resized, the element remains attached to top edge, with the specified ratio.
  • Bottom: If the parent element is resized, the element moves relatively to the bottom edge, with the specified ratio.
  • Left + Right: If the parent element is resized, the element is resized horizontally relatively to the left and right edges, with the specified ratio.
TooltipText that appears as a tooltip when the mouse hovers over the element.

Drag Group Callbacks

onDropGetInfo

onDropGetInfo(viewname, draginfo)

Description

Callback for the source of the drag operation when the operation starts. The text in draginfo is taken from the Drag Info property of the control.

Arguments

ArgumentDescriptionValue Type
viewnameThe name of the dragging view.string
draginfoThe text specified by the Drag Info property.string

Return Values

The function can return a table with the following keys:

Return ValueDescriptionValue Type
copySet this to true if copying is allowed, false if not.boolean
moveSet this to true if moving is allowed, false if not.boolean
infoThe draginfo argument of the subsequent callbacks is determined by this return value. By default, 'info' returns the string specified by the Drag Info property. By modifying the 'info' return value you can control the response of the subsequent callbacks.string
filesA table with file paths for evaluation by external software when the drop operation is executed there.table with file paths as strings

onDropInsert

onDropInsert(viewname, draginfo, copy)

Description

Callback for the target of the drag operation when the drop is executed.

Arguments

ArgumentDescriptionValue Type
viewnameThe name of the targeted view.string
draginfoThis string is specified by the 'info' return value of the onDropGetInfo callback when the drag operation starts.string
copyIndicates if the drag is a copy operation.string

onDropDone

onDropDone(viewname, draginfo, copy)

Description

This callback is called when the drop operation is complete.

Arguments

ArgumentDescriptionValue Type
viewnameThe name of the source view.string
draginfoThis string is specified by the 'info' return value of the onDropGetInfo callback when the drag operation starts.string
copyIndicates if the drag is a copy operation.string