        PROGRAM tdialog
        IMPLICIT none
        INCLUDE 'gemconst'

        INTEGER*4 my_form, x, y, w, h, ret
        INTEGER*4 cancel, okbutt, etnumber

        INTEGER*4 AESret, form_do, form_alert, objc_create, objc_item

        CALL appl_init
        IF (AESret .ne. -1) THEN
          my_form = objc_create(10, 10, 10, 30, 20)
          cancel = objc_item(my_form, 0, G_BUTTON,
     -                       EXIT .OR. DEFAULT .OR. SELECTABLE, 0,
     -                       20, 15, 8, 1, 0, 0)
          CALL objc_newtext(my_form, cancel, 'Cancel'//char(0))
          okbutt = objc_item(my_form, 0, G_BUTTON,
     -                       EXIT .OR. SELECTABLE, 0,
     -                       10, 15, 8, 1, 0, 0)
          CALL objc_newtext(my_form, okbutt, 'Ok'//char(0))
          etnumber = objc_item(my_form, 0, G_FTEXT, EDITABLE, 0, 
     -                      3, 10, 20, 1, 0, $0180)
          CALL objc_tedinfo(my_form, etnumber, '12'//char(0),
     -                      'Enter number _____'//char(0),
     -                      '99999'//char(0), 3, 0)
          CALL form_center(my_form, x, y, w, h)
          CALL form_dial(fmd_start, 0, 0, 0, 0, x, y, w, h)
          CALL objc_draw(my_form, 0, 2, x, y, w, h)
          ret = form_do(my_form, etnumber)
          CALL form_dial(fmd_finish, 0, 0, 0, 0, x, y, w, h)
          IF (ret .eq. okbutt) THEN
            ret = form_alert(1,'[1][OK][OK]'//char(0)) 
          ELSE IF (ret .eq. cancel) THEN
            ret = form_alert(1,'[1][CANCEL][CANCEL]'//char(0))
          ELSE
            ret = form_alert(1,'[1][??????][???????]'//char(0))
          END IF
        CALL appl_exit
      END IF
      END
    
