ChildDragSegment Event
The ChildDragSegment event is triggered for a composite field when a child field, set to a bias of FB_DRAGSEGMENT, receives a DragSegment event.
This event has the following syntax:
on childdragsegment [compositefieldname]
compositefieldname is optional if you specify the event in a field script for a composite field, or if the composite field is the frame's top form.
The following attributes of the FrameExec class can be used in the ChildClick event block:
TriggerField
Specifies the field with a bias setting of FB_DRAGSEGMENT that was under the cursor at the start of the drag
OriginatorField
Specifies the composite field specified in the initial on childdragsegment statement
Xstart
Specifies the x coordinate of the start of the line drag, relative to TriggerField
Ystart
Specifies the y coordinate of the start of the line drag, relative to TriggerField
Xend
Specifies the x coordinate of the end of the line drag, relative to TriggerField
Yend
Specifies the y coordinate of the end of the line drag, relative to TriggerField.
All coordinates are in 1000ths of an inch and are relative to the upper left corner of the field that received the DragSegment event.
Use the CurFrame system variable to access these attributes. For more information about this variable, see
FrameExec Class (see
FrameExec Class).
Usage: The ChildDragSegment event is defined for all composite fields, including the special subform that is the frame's top form. If you specify this event in the frame script without a composite field name, the ChildDragSegment event is triggered when a DragSegment event occurs on any field in the frame that is set to a bias of FB_DRAGSEGMENT.
The ChildDragSegment event can be used to detect all DragSegment events for child fields while new SegmentShape objects are being created on the form. It is useful in graphics applications that create and move new fields on the form.
When a ChildDragSegment event occurs, OpenROAD sets the TriggerField attribute to the field that was under the starting point of the segment (if the field is set to a bias of FB_DRAGSEGMENT). If fields overlap or if you want to detect a DragSegment on a composite field, ignoring whether the drag started on a child field or on the composite field's background, you can do the following:
• Set the bias of all the child fields to FB_VISIBLE.
• Set the bias of the composite field to FB_DRAGSEGMENT.
• Then use the DragSegment event block for the composite field.
The XStart and YStart attributes always represent the start of the drag that the user made. The XEnd and YEnd attributes represent the end of the drag. Because a user can drag a segment from right to left or bottom to top, and the more common left to right or top to bottom, you cannot assume that XStart and YStart represent the upper left coordinate of the line.
You can specify a DragSegment event block for a field and a ChildDragSegment event block for one or more of the enclosing composite fields for the field. OpenROAD then executes the blocks from the innermost to the outermost fields as described in
Event Block Execution (see
Event Block Execution).
More information: