Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PROGRESS UIB/APPBuilder APIs

Status
Not open for further replies.

samsoysa

IS-IT--Management
Sep 18, 2001
17
AU
I want to creat widgets at runtime and save the window using PROGRESS appbuider or User Interface Buider. Pleas give me some hints and places to get help.

Thaks,

Samantha
 
You can only do this using 4gl code and its impossible to have your dynamic widgets visible in design mode.

This example will create a dynamic button:

Create an empty (smart) window or use an existing window.
Create a new procedure in the section editor.
Add the following code:

DEFINE VARIABLE hn AS WIDGET-HANDLE NO-UNDO.

CREATE BUTTON hn
ASSIGN X = 10
Y = 10
WIDTH-PIXELS = 100
HEIGHT-PIXELS = 20
LABEL = "button"
VISIBLE = TRUE
FRAME = FRAME {&FRAME-NAME}:HANDLE
TRIGGERS:
ON CHOOSE PERSISTENT RUN VALUE ('doSomething') IN THIS-PROCEDURE.
END TRIGGERS.

ASSIGN hn:SENSITIVE = TRUE.

Create an override of the 'createObjects' procedure (smartwindow) and add a 'run' of the created procedure behind the 'RUN SUPER' statement, or place this code in the main-block behind the 'enable-ui' statement (simple window).

Add a procedure 'doSomething' which contains the actual trigger code.

Although this button isn't really dynamic, you can make all 'hardcoded' stuff in here variable- of parameterbased. And by using an array or temp-table construction for your handles you can add as many buttons or other widgets as you wish.

Remember that when using dynamic widgets you have to free the object if you're done with it. When your window runs persistent all the time and new objects are generated and removed you have to use the
DELETE WIDGET <handle> to remove them!


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top