Please help - widget position!

zx9r

New Member
Hi all
I have a simple (I think) but very irritating problem.
I am working V9.1D.
I have fame that has a fill-in field defined on it, when the user clicks a button I would like the chamge the fill-in-field:ROW attr of the field. This works fine except the label stays behind in the previosly defined position?
Is there any way I can keep the label "attached" to the widget?
Thanks in advance.
 

jongpau

Member
Move the label to where it is supposed to go after moving the fill-in. The handle of the label is available through FILL-IN-FIELD:SIDE-LABEL-HANDLE.
 

zx9r

New Member
Thanks jonpau, It works!!

I did the below:

DEFINE VARIABLE label-handle AS HANDLE NO-UNDO.
ASSIGN label-handle = fill-1:SIDE-LABEL-HANDLE.
......
ASSIGN label-handle:ROW = 10.
.......

Not too sound ungrateful, but is there not a quicker way to do as I have a load of widgets I need to do this with?

Thanks again.
 

jongpau

Member
Instead of coding it widget by widget, maybe you can:
- Put all the fields you want to move in a separate (child) frame and then just move the whole frame up or down as required
OR
- Write a little code that "walks the widget tree" and moves the fields (and labels) that need to be moved

Walking the widget tree goes something like this (simple example):
Code:
DEFINE VARIABLE hHandle AS HANDLE NO-UNDO.
 
ASSIGN hHandle = FRAME {&FRAME-NAME}:FIRST-CHILD
       hHandle = hHandle:FIRST-CHILD.
DO WHILE VALID-HANDLE(hHandle):
 
  do what you need to do here (check whether the widget needs to be moved and if so move it)
 
  hHandle = hHandle:NEXT-SIBLING.
END.

Good luck!

Paul
 

zx9r

New Member
Thanks Paul got it, and it works really well walking the widget tree:yippee:.

Thanks, Stephen.:toast:
 
Top