home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lb091.zip / IMITATE.BAS < prev    next >
BASIC Source File  |  1994-03-12  |  1KB  |  72 lines

  1.  
  2.     'demonstrates imitation radiobuttons, using checkboxes
  3.  
  4.     'don't open a main window, please
  5.     nomainwin
  6.  
  7.     WindowWidth = 270
  8.     WindowHeight = 200
  9.  
  10.     statictext #cfg, "Confirm File Operations:", 20, 20, 200, 20
  11.     checkbox #cfg.always, "Always", [alwaysConfirm], [setAlways], 40, 45, 130, 20
  12.     checkbox #cfg.whenReplacing, "When Replacing", [whenReplacingConfirm], [setWhenReplacing], 40, 70, 130, 20
  13.     checkbox #cfg.never, "Never", [neverConfirm], [setNever], 40, 95, 130, 20
  14.     button #cfg, " &OK ", [cfgOk], UL, 20, 125
  15.     open "Action Confirmation - Setup" for dialog as #cfg
  16.     print #cfg, "trapclose [cfgOk]"
  17.  
  18. [inputLoop]
  19.     input h$
  20.     goto [inputLoop]
  21.  
  22.  
  23. [alwaysConfirm]
  24.  
  25.     print #cfg.whenReplacing, "reset"
  26.     print #cfg.never, "reset"
  27.     confrm$ = "always"
  28.     goto [inputLoop]
  29.  
  30. [setAlways]
  31.  
  32.     print #cfg.always, "set"
  33.     goto [inputLoop]
  34.  
  35.  
  36. [whenReplacingConfirm]
  37.  
  38.     
  39.     print #cfg.always, "reset"
  40.     print #cfg.never, "reset"
  41.     confrm$ = "whenReplacing"
  42.     goto [inputLoop]
  43.  
  44. [setWhenReplacing]
  45.  
  46.     print #cfg.whenReplacing, "set"
  47.     goto [inputLoop]
  48.  
  49.  
  50. [neverConfirm]
  51.  
  52.     print #cfg.whenReplacing, "reset"
  53.     print #cfg.always, "reset"
  54.     confrm$ = "never"
  55.     goto [inputLoop]
  56.  
  57. [setNever]
  58.  
  59.     print #cfg.never, "set"
  60.     goto [inputLoop]
  61.  
  62.  
  63.  
  64. [cfgOk]
  65.  
  66.     confirm "Save this configuration?"; answer$
  67.     'perform some sort of save for config here
  68.  
  69.     close #cfg
  70.  
  71.     end
  72.