!******************************************************************************!
! Tests for the MENU type of GCONTROL
!
! @bug 1708 GCONTROL BUTTON should still show with invalid ROLLUP flag
! @author  Unknown, J. Czechowski IV
!******************************************************************************!
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE  ! for normal interactive test(s)

  if interAct then
    pipe on
      panel/msgid=MAIN/setup/controls=gc

      gcontrol label  macro "MACRO"

      gcontrol menu main "Exit with Status = " "PASS,FAIL" /tleft
      set gc.main.itemcolors {PASS=GREEN,FAIL=RED}

      gcontrol/title TEXT instructions INSTRUCTIONS &
             "You should see 3 button groups.\n\n&
             Click on 'ButtonB should be default' to show the middle group." 48 6

      gcontrol/nc=3 button gcOpen        "ButtonA should be default" "ButtonA,ButtonB,ButtonC" "ButtonA"
      gcontrol line
      gcontrol/nc=3 button gcClosed      "ButtonB should be default" "ButtonA,ButtonB,ButtonC" "ButtonB" /Rollup
      gcontrol line
      gcontrol/nc=3 button gcAlwaysOpen  "ButtonC should be default" "ButtonA,ButtonB,ButtonC" "ButtonC" 

    pipe off
  endif
endmacro

!******************************************************************************!
procedure processMessage m:msg
  if msg.name eqs "MAIN"
    assert/text="^reg.main.name: user indicated" msg.data eqs "PASS"
    pipe stop
  else
    ! do nothing
    !say "Unhandled message name: ^msg.name from fid: ^msg.fid data: ^msg.data"
  endif
return
