home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1995 September / Image.iso / visualob / install / samples / employee / button.pr_ / button.pr
Encoding:
Text File  |  1994-08-18  |  868 b   |  38 lines

  1. FUNCTION Button()
  2.     LOCAL TheScreen, OldColor, TheChoice := 0, wB1, wB2, wB3, wB4
  3.  
  4.     TheScreen := Win_Open(19, 1, 22, 42, ' Select ')
  5.     Msg('Select a menu option')
  6.  
  7.     OldColor := Menu_Color()
  8.  
  9.     wB1 := CRTAddButton(ADD_MODE, "Add",    20,  3, 2, 8)
  10.     wB2 := CRTAddButton(CHANGE_MODE, "Change", 20, 13, 2, 8)
  11.     wB3 := CRTAddButton(DELETE_MODE, "Delete", 20, 23, 2, 8)
  12.     wB4 := CRTAddButton(EXIT_MODE, "Exit",   20, 33, 2, 8)
  13.  
  14.     DO WHILE TheChoice <> ADD_MODE .AND. TheChoice <> CHANGE_MODE .AND.  ;
  15.                   TheChoice <> DELETE_MODE .AND. TheChoice <> EXIT_MODE .AND.  ;
  16.                       TheChoice <> K_ESC
  17.         TheChoice := InKey(0)
  18.     ENDDO
  19.  
  20.     CRTRemoveButton(wB1)
  21.     CRTRemoveButton(wB2)
  22.     CRTRemoveButton(wB3)
  23.     CRTRemoveButton(wB4)
  24.  
  25.     SetColor(OldColor)
  26.     Win_Close(TheScreen)
  27.     
  28.     IF TheChoice = K_ESC
  29.         RETURN 0
  30.     ELSE
  31.         RETURN TheChoice
  32.     ENDIF
  33.  
  34.  
  35.  
  36.  
  37.  
  38.