!------------------------------------------------------------------------------!
! Tests for LIST templates
! NOTE:  this is an interactive test and requires operator verification
!        in order to determine test success.
!
!   Author : J. Hallam
!
!------------------------------------------------------------------------------!
startmacro
  fname tmpfile area=test name=listtemplatedata ext=tmp
  fname templateFile area=test name=listtemplate ext=tmp
  pipe on
    panel/setup
    list/id=idlist tmpfile templateFile

    gcontrol label macro "MACRO"
    gcontrol menu main  "Exit with Status = " "PASS,FAIL" /tleft
    set reg.panel.controls.MAIN.itemColors {PASS=GREEN,FAIL=RED}

    gcontrol text info "INSTRUCTIONS" &
      "This test shows that bug 259 has been fixed. Previously formatting was applied to &
       string values that were numbers, which is not always desired. If you wish an ascii &
       value to be formatted, you must use a DISPFORM keyword in your template. Click on the &
       'NUMBER' button below to add a row of numbers; click on the 'STRING' button to add a row of &
       string values. The value of each cell is 10, and should be formatted according to &
       the indicated DISPFORM pattern." 24 17 /title
   gcontrol label options "OPTIONS" AlwaysOpen
   gcontrol menu toadd "Add row =" "NUMBER,STRING" 1 /tleft

  pipe off

endmacro

!******************************************************************************!
procedure processMessage
  if msg.name eqs "MAIN" then
    assert/text="Test List Template" msg.data eqss "PASS"
    pipe stop
  elseif msg.name eqs "TOADD" then
    if msg.data eqs "NUMBER" then
      res myrow {TR01=10,TR02=10,TR03=10,TR04=10,TR05=10,TR06=10}
      set reg.idlist.gs.addRow myrow
      popup xxx FUNC="OK" "You should see a new row with the following values: &
                           10.0,1E1,10E0,1000%,$10.00,10'00'00.00"
    else
      res myrow {TR01="10",TR02="10",TR03="10",TR04="10",TR05="10",TR06="10"}
      set reg.idlist.gs.addRow myrow
      popup xxx FUNC="OK" "You should see a new row with the following values: &
                           10,1E1,10E0,1000%,$10.00,10'00'00.00"
    endif
  endif
return
