Consultor Eletrônico



Kbase P6343: How to move a side-label widget with its parent widget?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   18/12/2007
Status: Verified

GOAL:

How to move a side-label widget with its parent widget?

GOAL:

How to update and align a side-label dynamically?

GOAL:


How to synchronize the positions of a FILL-IN and its label when the FILL-IN is moved?

FACT(s) (Environment):

Progress 8.x
Progress 9.x
OpenEdge 10.x
All Supported Operating Systems
OpenEdge Category: Language (4GL/ABL)

FIX:

A side-label is not part of a widget. It is a seperate widget itself, and widgets such as FILL-INs have a SIDE-LABEL-HANDLE attribute that associates a side-label widget with them. As they are seperate widgets they will need to be repositioned seperately as well.

The example below shows how to change the label dynamically, and how to reposition it in such a way that its new size and position is taken into account:

DEFINE VARIABLE hLabel AS HANDLE NO-UNDO.

ASSIGN hLabel = MyFillIn:SIDE-LABEL-HANDLE
MyFillIn:X = 150
MyFillIn:Y = 150.

IF VALID-HANDLE(hLabel) THEN
ASSIGN hLabel:SCREEN-VALUE = "Testing:"
hLabel:WIDTH-PIXELS = FONT-TABLE:GET-TEXT-WIDTH-PIXELS(hLabel:SCREEN-VALUE,hLabel:FONT)
hLabel:Y = MyFillIn:Y
hLabel:X = MyFillIn:X - hLabel:WIDTH-PIXELS - 4.