! Tests a panel with /TSETUP
!
! @author  JJ Bauer
!******************************************************************************!
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE
  switch BASELINE    baseline GET DEF=FALSE SDEF=TRUE

  call setDatDir

  set inst "You should see a plot of apenny."

  if interAct then
    pipe on
      panel/msgid=MAIN/controls=gc
      plot ^{datDir}.apenny.prm

      gcontrol label macro "MACRO"
      gcontrol menu main "Exit with Status = " "PASS,FAIL" /tleft
        set gc.main.itemColors {PASS=GREEN,FAIL=RED}
        gcontrol text idtext "Instructions" "^inst" 24 20 /title

    pipe off
  endif

endmacro

!******************************************************************************!
procedure processMessage
  if msg.name EQS "MAIN" then
    assert/text="^reg.main.name: User indicated tests" msg.data eqss "PASS"
    pipe stop
  endif
return

!******************************************************************************!
! Set the dat directory
!******************************************************************************!
procedure setDatDir
  invoke nxmMajor env.nmversion.subString(0,1)
  invoke major java.lang.Integer.valueOf(nxmMajor)
  if major GE 4 then
    invoke s:datDir           nxm.sys.test.DatLocator.getDatDirLocation()
    invoke s:datDirSlash      nxm.sys.test.DatLocator.getDatDirSlashLocation()
    invoke z:sysDatFull       nxm.sys.test.DatLocator.sysDatFull()
    invoke z:sysTestDatExists nxm.sys.test.DatLocator.sysTestDatExists()
  else
    set s:datDir           "nxm.sys.dat"
    set s:datDirSlash      "nxm/sys/dat"
    set z:sysDatFull       true
    set z:sysTestDatExists false
  endif
return
