How to obtain list of objects in a given frame

LBaliao

Member
Please help. How do I obtain the list of objects in a given frame? Say for example, I have a dialog-frame named "Frame-A" and in it are a fill-in named "Fi-One" and a combo-box named "Cbo-One". I want to create a loop if I can get the number of children of "Frame-A" and set some properties programmatically.

TIA.
 
Hi.

You have to do something like this.

DEF VAR L-uno AS INT.
DEF VAR L-dos AS DEC.
DEF VAR L-tres AS LOG.
DEF VAR L-padre AS WIDGET-HANDLE.
DEF VAR L-hijo AS WIDGET-HANDLE.
DEF VAR L-ciclo AS INT.
DEFINE FRAME Marco
L-uno
L-dos
L-tres
WITH ROW 1 CENTERED OVERLAY.

/* first you get the handle to the frame */
L-padre = FRAME Marco:FIRST-CHILD.
/* later you get the handle to the first widget in the frame */
L-hijo = L-padre:FIRST-CHILD.
/* loop through all the widgets in the frame */
REPEAT WHILE VALID-HANDLE(L-hijo):
/* display widget name, format and data-type */
DISPLAY L-hijo:NAME L-hijo:FORMAT L-hijo:DATA-TYPE.
/* get handle for next widget in the frame */
L-hijo = L-hijo:NEXT-SIBLING.
END. /* REPEAT WHILE VALID-HANDLE(L-hijo): */

Hope this helps.
 
I've done some moves to yor code friend in order it works for me... In it does..¡¡¡

Now... I want to change the TAB-ORDER.

Could you change te TAB-ORDER but... Without using directly the variables:

DEF VAR L-uno AS INT.
DEF VAR L-dos AS DEC.
DEF VAR L-tres AS LOG.

This is because I have a Compiled Program that dynamicly I'm creating other fill-in's on it frame... The problem is the fill-in created get the last Tab order... I want the tab-order BEFORE the button.

But I don't have the definition on my frame...

I'm asking some strange really¡¡¡¡

Wel.. I hope you could helpme¡¡¡

Thans in advance.

In I wanted before the button called "OK"...
 
It easy :


DEF VAR hNewField AS HANDLE.

/** CREATE THE FIELD and PUT HANDLE in hNewField **/

hNewField:MOVE-BEFORE-TAB-ITEM(<Your Button>:HANDLE).
 
Back
Top