` Printed Icetips Article

Icetips Article



Par2: Dynamically creating tabs
2000-02-01 -- Leo Goolsby
 
Here is how I am dynamically adding tabs to my window or more properly said,
my SHEET.

First I build a queue of what determines the tabs, I call mine CatagoryQ,
similar to that in SOLODEX.  This queue has 2 fields, Catagory and
FieldEquate.  Upon opening the widow I build the queue and run the following
ROUTINE.

LOOP Q# = 1 TO RECORDS(RoloQ)
GET(RoloQ,Q#)
IF RQ:CATEGORY
    CAT:Category = RQ:CATEGORY
GET(CategoryQ,CAT:Category)
IF ERRORCODE()
    ADD(CategoryQ,+CAT:Category)
END
END
END
!!!The previous code is used to build the CategoryQ
LOOP K = 1 TO RECORDS(CategoryQ)
    GET(CategoryQ,K)
    J = CREATE(0,CREATE:TAB,?SHEET2)
    J{PROP:TEXT} = CAT:Category
    UNHIDE(J)
    CAT:FieldEquate = J
    PUT(CategoryQ)
END
SELECT(?List1,1)

I still need to add the code that will check for exsisting queue records and
so forth so that others can be added without exiting and reentering but that
is the easiest part.  With the 2 fields in CategoryQ I think I should have
everything I need.  I hope so at least.  If anybody has suggestions on
changes I might add please feel free to let me know.



Printed May 5, 2024, 5:11 am
This article has been viewed/printed 35122 times.