home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / e / EasyGUI_v33b2.lha / Src / EasyGUI / testkey.e < prev    next >
Text File  |  1997-02-12  |  3KB  |  84 lines

  1. -> testkey.e - shows use of keyboard short-cuts
  2. MODULE 'tools/easygui',
  3.        'exec/lists', 'exec/nodes',
  4.        'graphics/text',
  5.        'amigalib/lists'
  6.  
  7. CONST MAXLEN=20
  8.  
  9. DEF gad, disabled=TRUE
  10.  
  11. PROC main()
  12.   DEF s[MAXLEN]:STRING, list:lh, choices
  13.   newList(list)
  14.   AddTail(list, [0,0,0,0,'Item']:ln)
  15.   AddTail(list, [0,0,0,0,'Item-2']:ln)
  16.   AddTail(list, [0,0,0,0,'Item-3']:ln)
  17.   AddTail(list, [0,0,0,0,'Item-4']:ln)
  18.   AddTail(list, [0,0,0,0,'Item-5']:ln)
  19.   AddTail(list, [0,0,0,0,'Item-6']:ln)
  20.   choices:=['Zero','One','Two',NIL]
  21.   StrCopy(s,'Hello')
  22.   easyguiA('Press Some Keys!',
  23.           [COLS,
  24.              [EQROWS,
  25.                 [CYCLE,{cycle},'_Cycle:',choices,1,0,"c"],
  26.                 [STR,{password},'S_tring:',s,MAXLEN,5,FALSE,0,"t"],
  27.                 [BAR],
  28.                 -> Show new CHECK and MX alignments
  29.                 [CHECK,{check},'C_heck:',TRUE,TRUE,0,"h"],
  30.                 [MX,{mx},'_MX:',choices,TRUE,0,0,"m"],
  31.                 [BAR],
  32.                 -> Show new CHECK and MX right text
  33.                 [CHECK,{check2},'Ch_eck2 (Right)',TRUE,FALSE,0,"e"],
  34.                 [MX,{mx2},'M_X2 (Right)',choices,FALSE,0,0,"x"]
  35.              ],
  36.              [BAR],
  37.              [ROWS,
  38.                 -> Show new LISTV label and show selected
  39.                 [LISTV,{listv},'_List:',8,5,list,FALSE,1,0,0,"l",0],
  40.                 [SLIDE,{slide},'_Slide:',FALSE,1,8,3,3,'',0,"s"],
  41. ->                [SCROLL,{slide},FALSE,80,10,3,3,0,"i"],
  42.                 -> Show new PALETTE current field, min size and show selected
  43.                 [PALETTE,{palette},'_Palette:',3,5,2,2,0,"p"],
  44.                 gad:=[SBUTTON,{button},'_blockwin()',0,"b",0,disabled],
  45.                 [SBUTTON,{disable},'_disable()',0,"d"]
  46.              ]
  47.           ])
  48. ENDPROC
  49.  
  50. PROC button(gh) HANDLE
  51.   blockwin(gh)
  52.   easyguiA('New GUI',
  53.           [ROWS,
  54.              [TEXT,'Old GUI blocked',NIL,TRUE,15],
  55.              [BUTTON,0,'_Unblock',0,"u"]
  56.           ])
  57. EXCEPT DO
  58.   unblockwin(gh)
  59.   ReThrow()
  60. ENDPROC
  61.  
  62. PROC disable(gh)
  63.   disabled:=disabled=FALSE
  64.   setdisabled(gh,gad,disabled)
  65. ENDPROC
  66.  
  67. PROC slide(info,val) IS    PrintF('Slide has moved to \d\n', val)
  68.  
  69. PROC cycle(info,val) IS    PrintF('Cycle choice is now \d\n', val)
  70.  
  71. PROC check(info,val) IS    PrintF('Check is now \s\n',
  72.                                  IF val THEN 'TRUE' ELSE 'FALSE')
  73. PROC check2(info,val) IS   PrintF('Check2 is now \s\n',
  74.                                   IF val THEN 'TRUE' ELSE 'FALSE')
  75.  
  76. PROC mx(info,val) IS       PrintF('MX choice is now \d\n', val)
  77. PROC mx2(info,val) IS      PrintF('MX2 choice is now \d\n', val)
  78.  
  79. PROC password(info,val) IS PrintF('Password is now "\s"\n', val)
  80.  
  81. PROC palette(info,val) IS  PrintF('Palette pen is now \d\n', val)
  82.  
  83. PROC listv(info,val) IS    PrintF('List selection moved to \d\n', val)
  84.