home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / e / EasyGUI_v33b2.lha / Src / EasyGUI / calendar_test.e < prev    next >
Text File  |  1997-02-10  |  853b  |  39 lines

  1. MODULE 'tools/EasyGUI', 'tools/exceptions',
  2.        'utility/date',
  3.        'plugins/calendar'
  4.  
  5. DEF title
  6.  
  7. PROC main() HANDLE
  8.   DEF c=NIL:PTR TO calendar
  9.   NEW c.calendar([0,0,0,25,12,1996,0]:clockdata,TRUE)
  10.   easyguiA('BOOPSI in EasyGUI!',
  11.     [ROWS,
  12.       title:=[TEXT,'Calendar: December 1996',NIL,TRUE,5],
  13.       [PLUGIN,{calendaraction},c],
  14.       [EQCOLS,
  15.         [BUTTON,{reset},'Set to October',c],
  16.         [BUTTON,{toggle_enabled},'Toggle Enabled',c]
  17.       ]
  18.     ])
  19. EXCEPT DO
  20.   END c
  21.   report_exception()
  22. ENDPROC
  23.  
  24. PROC calendaraction(i,c:PTR TO calendar)
  25.   WriteF('You picked day \d\n', c.date.mday)
  26. ENDPROC
  27.  
  28. PROC reset(c:PTR TO calendar,gh)
  29.   IF c.date.month<>10
  30.     c.date.month:=10
  31.     c.setdate()
  32.     settext(gh,title,'Calendar: October 1996')
  33.   ENDIF
  34. ENDPROC
  35.  
  36. PROC toggle_enabled(c:PTR TO calendar,i)
  37.   c.setdisabled(c.disabled=FALSE)
  38. ENDPROC
  39.