! Macro - Graphics Lab
!
! Author: George P. Burdell
!
startmacro
  pipe on
    panel/controls=gc
    
    gcontrol button   state "" "Stop" /tleft
    gcontrol calendar date
    gcontrol lval     year  "Year:  " 2000 2000 2100 1
    gcontrol lval     month "Month: " 01   01   12   1
    gcontrol lval     day   "Day:   " 01   01   31   1
    
  pipe off
endmacro


procedure processMessage m:msg
  say "Got message name=^msg.name info=^msg.info data=^msg.data"

  if msg.name eqs "STATE" and msg.data eqs "STOP" then
    pipe stop

  elseif msg.name eqs "DATE" then
    sedit msg.data gc.year.value  ELEM 1 ":"
    sedit msg.data gc.month.value ELEM 2 ":"
    sedit msg.data gc.day.value   ELEM 3 ":"
    
  elseif msg.name eqs "YEAR"  or &
         msg.name eqs "MONTH" or &
         msg.name eqs "DAY"   then

    invoke ,, gc.date.setDate(^{gc.year.value},^{gc.month.value},^{gc.day.value})

  else
    say "Unhandled message name=^msg.name info=^msg.info data=^msg.data"
  endif
return
