!******************************************************************************!
! Test using a generic 'bean' to make widgets
!
! Arguments: None
!
! @bug      2351 Add "BEAN" Gcontrol option
! @author:  J Bauer / C Simmons
! @version: $Id: test_gcontrol_bean.mm,v 1.4 2012/06/27 11:46:45 jwb Exp $
!******************************************************************************!
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE  ! for normal interactive test(s)
  switch BASELINE    baseline GET DEF=FALSE SDEF=TRUE  ! for defects or more obscure test case(s)

  if interAct then
    set mycolor "blue"
    set instructions "You should see a ^mycolor GLine widget below made using a 'BEAN' type"

    pipe on
      panel/msgid=MAIN/setup/controls=gc
      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 bean myBean "A Bean" P1=nxm.sys.libg.GLine TABLE={color=mycolor}
      
      call checkBeanVals
    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
  else
    say "Unhandled message name: ^msg.name from fid: ^msg.fid data: ^msg.data"
  endif
return

!******************************************************************************!
! Check the values set for the Bean
procedure checkBeanVals
  ! This procedure added in 3.1.3 for Bug 2615
  
  set beanName gc.myBean.name
  set beanTitle gc.myBean.title
  
  assert/text="^reg.main.name: BEAN vals check: " beanName eqs "MYBEAN" AND beanTitle eqs "A Bean"

return
