/* *************************** Main Block *************************** */
/* Parent the dialog-box to the ACTIVE-WINDOW, if there is no parent. */ IF VALID-HANDLE(ACTIVE-WINDOW) AND FRAME {&FRAME-NAME}:PARENT EQ ? THEN FRAME {&FRAME-NAME}:PARENT = ACTIVE-WINDOW. /* Now enable the interface and wait for the exit condition. */ /* (NOTE: handle ERROR and END-KEY so cleanup code will always fire. */ MAIN-BLOCK: DO ON ERROR UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK: RUN enable_UI. /* Set max-records from open query in enable_UI. */ max-records = NUM-RESULTS("Dialog-Frame"). WAIT-FOR GO OF FRAME {&FRAME-NAME}. END. RUN disable_UI. |
/* ********************** Internal Procedures *********************** */
. . . PROCEDURE enable_UI : /*------------------------------------------------------------------------ Purpose: ENABLE the User Interface Parameters: <none> Notes: Here we display/view/enable the widgets in the user-interface. In addition, OPEN all queries associated with each FRAME and BROWSE. These statements here are based on the "Other Settings" section of the widget Property Sheets. ------------------------------------------------------------------------*/ RUN control_load. {&OPEN-QUERY-Dialog-Frame} GET FIRST Dialog-Frame. DISPLAY iRecordCount WITH FRAME Dialog-Frame. . . . END PROCEDURE. |
/* ********************** Internal Procedures *********************** */
. . . PROCEDURE control_load : /*------------------------------------------------------------------------ Purpose: Load the OCXs Parameters: <none> Notes: Here we load, initialize and make visible the OCXs in the interface. ------------------------------------------------------------------------*/ &IF "{&OPSYS}" = "WIN32":U AND "{&WINDOW-SYSTEM}" NE "TTY":U &THEN DEFINE VARIABLE UIB_S AS LOGICAL NO-UNDO. DEFINE VARIABLE OCXFile AS CHARACTER NO-UNDO. OCXFile = SEARCH( "i-ocx1.wrx":U ). IF OCXFile <> ? THEN DO: ASSIGN chcustSpin = custSpin:COM-HANDLE UIB_S = chcustSpin:LoadControls( OCXFile, "custSpin":U). RUN initialize-controls IN THIS-PROCEDURE NO-ERROR. END. ELSE MESSAGE "The file, i-ocx1.wrx, could not be found." skip "The controls cannot be loaded." VIEW-AS ALERT-BOX TITLE "Controls Not Loaded". &ENDIF END PROCEDURE. |