!**************************************************************************************************!
! Tests rendering of DATALIST /BIN  and /HEX
!
! @issue   NXM-4037 DATALIST hex and binary formatting incorrect
! @author  Jeanette McCall
! @since   NeXtMidas 4.1.3
!**************************************************************************************************!
startmacro/themes=gear4
  switch INTERACTIVE  interAct     GET DEF=TRUE SDEF=TRUE  ! for normal interactive test(s)
  switch COREGRAPHICS coregraphics GET DEF=FALSE SDEF=TRUE  ! for a quick check of graphics - more extreme tests - since 3.8.1

  res datalistFile ram:test_datalist_format

  if interAct OR coreGraphics then
    waveform datalistFile FORM=CI ELEM=256 SHAPE=SINE AMP=512

    pipe on
      panel/msgid=MAIN/id=panel/tsetup=nxm.sys.test.test_datalist_bin_hex_format_setup.tbl/controls=gc

      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" "Expected in shellgui:\n\n&
           Data fills over 75% of row\n\n&
           Last row starts with element:\n   &
             DATALIST/HEX (top): 50\n   &
             DATALIST/BIN (bottom): 30" 24 7 /title

      shellgui/id=idshellgui/attach
      DATALIST/hex/bg datalistFile NELEM=55
      DATALIST/bin/bg datalistFile NELEM=32

    pipe off
  endif

endmacro

!******************************************************************************!
procedure processMessage m:msg
  if msg.name EQS "MAIN" then
  res reg
    invoke ,, idshellgui.close()
    pause 0.1
    assert/text="^reg.main.name: User indicated tests" msg.data eqss "PASS"
    pipe stop
  else
    say "Unhandled message name: ^msg.name from fid: ^msg.fid data: ^msg.data"
  endif
return
