Entry To First Widget In Frame

emnu

Member
hi,

With next code i want to make entry to the first widget of a frame/

DEF VAR vh AS WIDGET-HANDLE NO-UNDO.
DEF VAR cWidget AS CHAR NO-UNDO.

vh = FRAME {&FRAME-NAME}:HANDLE.

vh = vh:FIRST-CHILD. /* field-group */
vh = vh:FIRST-CHILD. /* first widget in field-group*/

ok-lus:
REPEAT:
IF LOOKUP(vh:TYPE,"{&WIDGET-TYPES}") > 0 THEN DO:
APPLY "ENTRY":U TO vh:NAME IN FRAME {&FRAME-NAME}.
LEAVE ok-lus.
END.
vh=vh:NEXT-SIBLING. /* volgend widget */
IF NOT VALID-HANDLE(vh) THEN LEAVE ok-lus.
END.

So, i walk the widget tree, if valid widget (fill-in, editor ...)
then i want to apply entry to this widget, using the NAME
attribute on the WIDGET-HANDLE;
But an error occurs "Can not understand after ... "

Any clue ?



Thanx.

Emmanuel Nuyttens
C&C NV
Oudenaarde BELGIUM
 

jongpau

Member
Also you can use the FIRST-TAB-ITEM attribute of the frame to find the first widget in the tab order of the frame. This is more logical than the first child , which may not be correct at all times.

HTH
 
What about just:

APPLY "ENTRY" TO FRAME {&FRAME-NAME}.

This will place focus into the first widget in the frame that is able to accept focus.
 
Top