!******************************************************************************!
! Test a macro with a list2 launched from another macro with no file specified
! and a template with the columns for the data that it should contain.
!
! Arguments: None
!
! @bug      2396
! @author:  J Bauer
! @version: $Id: test_list2_submacro_sub.mm,v 1.2 2011/06/02 17:31:15 ntn Exp $
!******************************************************************************!
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE  ! for normal interactive test(s)

if interAct then
  set sr 1e5
  set instructions "You should see a list2 with three columns (A,B,C) and one row"

  pipe init
    panel/setup/controls=gc/msgid=main
      gcontrol label macro "Test MACRO"
      gcontrol menu  main "Exit with Status =" "PASS,FAIL" TABLE={ItemColors={PASS="GREEN",FAIL="RED"}} /tleft
      gcontrol text  idtext "Instructions" instructions 24 8 /title

      gcontrol button addRow "" "Add Row"

      list2/msgid=main/id=idlist template={A={WIDTH=8},B={WIDTH=8},C={WIDTH=8}}
      set reg.idlist.addRow {A=7,B=8,C=9}

  pipe off
endif

endmacro

!******************************************************************************!
! Main process message for this macro. Should be right after the ENDMACRO.
procedure processMessage m:msg
  if msg.name eqs "MAIN" then
    assert/text="^reg.main.name: User indicated tests" msg.data eqss "PASS"
    pipe stop

  elseif msg.name eqs "ADDROW" then
    set reg.idlist.addRow {A=10,B=11,C=12}

  endif

return
