Attach to Window Border (attach)
The Attach to Window Border (Attach) widget property attaches the widget (or area frame) to one or more form window borders or split bars at runtime. This allows the element to be resized or moved when the window is resized or a split bar moved.
"
attach=
{left
}
{,
right
} {,
top
}
{,
bottom
} {,
hmove
}
{,
hsize
} {,
vmove
}
{,
vsize
}"
Values
Select the desired combination of options for attaching the widget to the form borders or split bars.
Value | Description |
---|---|
Left
|
Attach to the left window border or nearest vertical split bar to the left of the widget. In a right-to-left application, the attachment is reversed. |
Right
|
Attach to the right window border or
nearest vertical split bar to the right of the widget. Has precedence over Hsize .
In a right-to-left application, the attachment is reversed. |
Top
|
Attach to the top window border or nearest horizontal split bar above the widget. |
Bottom
|
Attach to the bottom window border or
nearest horizontal split bar below the widget. Has precedence over Vsize . |
Hmove
|
Link the widget to the right window border or nearest vertical split bar to the right of the widget. The widget remains the same size but moves with the right window border when you resize the window, or it moves with the split bar when you move that. |
Hsize
|
Link the widget to the right window border
or nearest vertical split bar to the right of the widget. The widget remains the same size until
you resize the window, or move the split bar. The right edge of the widget keeps its painted
distance from the border while it changes in size horizontally. Has precedence over
Hmove . |
Vmove
|
Link the widget to the bottom window border or nearest horizontal split bar below the widget. The widget remains the same size but moves with the bottom window border when you resize the window, or moves with the split bar when you move that. |
Vsize
|
Link the widget to the bottom window
border or nearest horizontal split bar to the bottom of the widget. The widget remains the same
size until you resize the window, or move the split bar. Then the bottom edge of the widget keeps
its painted distance from the border while it changes in size vertically. Has precedence over
Vmove . |
Usage
Dynamic? | Yes |
Supported in Grid? | Yes for Grid, No for other widgets |
Dependencies: | None |
Description
The Attach to Window Border makes it possible to react to changes in the form layout caused by resizing the form window or moving split bars. You can choose to have the widget itself resized or to move it with the window border or split bar.
By default (from the installed .ini file), a widget is not attached to any edges of a form or form window border or split bar.
When specifying the property using
$fieldproperties in ProcScript or in usys.ini, the order of
values is not relevant (for example, BOTTOM,RIGHT
and
RIGHT,BOTTOM
are equivalent).
By default, there is a margin used when attaching to a border. You can control this margin by setting the AttachMargin property. For more information, see Attach Margin (AttachMargin).
When applications are run as right-to-left (RTL), the Left
and Right
attachment is mirrored. Thus, if the Attach to Window Border(Attach) property is set to Right, the widget, entity, or area frame is attached to the left in an RTL application. To prevent this from happening, you can set RtlAttachMirroring initialization setting to false
. For more information, see RtlAttachMirroring.
Window Resizing
If you attach a widget to a window border or split bar and the user resizes the form at run time, Uniface automatically resizes the widget so that it is aligned with the window border. This also happens when you change the size of the window in ProcScript using $windowproperties.
If the window is resized to be larger than its painted size, the widget is attached to the window border. If it is resized to be smaller that its painted size, form scrollbars are displayed and the widget is attached to the form edge.
Depending on the values specified, objects drawn between the widget and the selected edge may not be displayed at run time.
Attached Entities
Using the Attach property for non-contiguous occurrences (such as an inner entity in an outer entity with multiple occurrences) can have unexpected effects at runtime.
For example, assume you have repeating occurrences
of ENTITY_A, and ENTITY_A contains an occurrence of ENTITY_B. All the occurrences of ENTITY_B are
non-contiguous. If ENTITY_B has the properties, Attach=top
and
BackColor=blue
, each occurrence of Entity_B will be attached to
the top of the form.
Attached Frames
For area frames, you can specify this property on the basis of frame names in the [areaframes] section of the .ini. It is not possible to set this property in the Uniface IDE. For more information, see [areaframes].
Using in ProcScript
You can use $properties or $fieldproperties to set or get the property and its value. For more information, see $properties and $fieldproperties.
$properties(FLD1) = "attach=right,bottom"
vProps = $fieldproperties(FLD1, "attach")
Applies To
Field-level widgets:
- ucheckbox (CheckBox)
- ucolorbox (ColorBox)
- ucolorlist (ColorList)
- ucombobox (Combo Box)
- CommandButton
- DropTarget
- udropdownlist (DropDownList)
- EditBox
- ucontainer (FormContainer)
- egrid (Grid)
- uhtml (HTML Widget)
- ulistbox (ListBox )
- umap (Map)
- umeter (Meter)
- (umonthcalendar) MonthCalendar
- uOcxContainer (OcxContainer)
- uOleContainer (OleContainer)
- uoutputbox (OutputBox)
- upicture (Picture)
- uradiogroup (RadioGroup)
- urtfeditbox (RichEditBox)
- uslider (Slider)
- uspinbutton (SpinButton)
- utab (Tab)
- utabex (TabEx)
- utree (Tree)