!------------------------------------------------------------------------------!
! Test the re-painting of Symbols (BUG 1738).
!
! Author:  J. Bauer
!------------------------------------------------------------------------------!
startmacro

  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE

  call setDatDir

  set instructions &
      "1) Should see a plot of the cities file with no map\n\n&
       2) MMB Menu -> select LAYERS -> unselect CITIES box\n\n&
       3) The Symbols should disappear.\n\n&
       **************************************\n&
       Note: Prior to BUG 1738 fix you often needed &
       to force a refresh (e.g. resize the window) for them to be removed."

  if interAct then
    invoke symbolList nxm.sys.libg.Symbol.symbolList
    pipe init

    panel/msgid=MAIN/setup/controls=gc
    plot/id=idplot/READOUT="+OnAxis" ^{datDir}.cities.prm

    gcontrol label mainLabel "Main"
      gcontrol menu main "Exit with Status = " "PASS,FAIL" /tleft
      set gc.main.itemColors {PASS=GREEN,FAIL=RED}
    gcontrol text idtext "Instructions" "^instructions" 24 14 /title

    pipe off

  endif

endmacro

!******************************************************************************!
procedure processMessage m:msg
  if msg.name eqs "MAIN" then
    assert/text="Plot dRangeUnit tests" msg.data eqss "PASS"
    pipe stop

  else
    ! do nothing
    say "^reg.main.name: Unhandled message name: ^msg.name from fid: ^msg.fid data: ^msg.data"
  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
