routine MENUBAR.CTL given FIELD.ID, FORM yielding STATUS
''
'' COPYRIGHT (C) 1993, CACI Products Company.
'' AUTHOR: Steve Bailey
'' DATE: 9-22-93
'' DESCRIPTION:
''     Control routine for the menubar (passed to ACCEPT.F).  This routine is
''     called whenever the user selects ANY menu item no matter where it is on
''     the pullright hierarchy.  The programmer defines the reference names
''     for menuitems in simdraw.  When one of these items is clicked on by 
''     the user, this same reference name appears here as the FIELD.ID.
''     Note that this routine is called once for every parent menu along the
''     path to the selected menu item in a top down fashion.  If the user 
''     selectes the item Ball/Velocity/X/High, then routine will be called
''     4 times with FIELD.ID = "BALL", "BALL.VEL", "BALL.VEL.X", and 
''     "BALL.VEL.X.HIGH" respectively.  The first 3 calls would be ignored by
''     this routine since it isn't interested in menu selections.
''

define FORM as a pointer variable
define FIELD.ID as a text variable
define STATUS as an integer variable

if FIELD.ID eq "MENU"
    let FIELD.ID = DTVAL.A(DFIELD.F("MENU", FORM))
always

select case FIELD.ID
  case "QUIT"                let STATUS = 1
  case "BALL.MASS.HEAVY"     let BALL.MASS = .MASS.HEAVY
  case "BALL.MASS.MEDIUM"    let BALL.MASS = .MASS.MEDIUM
  case "BALL.MASS.LIGHT"     let BALL.MASS = .MASS.LIGHT
  case "BALL.VEL.X.FAST"     let BALL.XVEL = .VELOCITY.FAST
  case "BALL.VEL.X.MEDIUM"   let BALL.XVEL = .VELOCITY.MEDIUM
  case "BALL.VEL.X.SLOW"     let BALL.XVEL = .VELOCITY.SLOW
  case "BALL.VEL.Y.FAST"     let BALL.YVEL = .VELOCITY.FAST
  case "BALL.VEL.Y.MEDIUM"   let BALL.YVEL = .VELOCITY.MEDIUM
  case "BALL.VEL.Y.SLOW"     let BALL.YVEL = .VELOCITY.SLOW
  case "EVRN.GRAVITY.HIGH"   let EVRN.GRAVITY = .GRAVITY.HIGH
  case "EVRN.GRAVITY.MEDIUM" let EVRN.GRAVITY = .GRAVITY.MEDIUM
  case "EVRN.GRAVITY.LOW"    let EVRN.GRAVITY = .GRAVITY.LOW
  case "EVRN.FLOOR.HIGH"     let EVRN.FLOOR = .FLOOR.HIGH
  case "EVRN.FLOOR.MEDIUM"   let EVRN.FLOOR = .FLOOR.MEDIUM
  case "EVRN.FLOOR.LOW"      let EVRN.FLOOR = .FLOOR.LOW
  case "EVRN.AIRRES.HIGH"    let EVRN.AIRRES = .AIRRES.HIGH
  case "EVRN.AIRRES.MEDIUM"  let EVRN.AIRRES = .AIRRES.MEDIUM
  case "EVRN.AIRRES.LOW"     let EVRN.AIRRES = .AIRRES.LOW
  default
endselect

end
