!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Test for setting gcontrol options inline using 'TABLE='
!
! @author  J. Bauer
! @version $Id: test_gcontrol_table.mm,v 1.1 2008/09/19 18:35:58 jwb Exp $
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE

  set instr "Different SET commands from GMenu / GWidget used through the 'TABLE=' format. &
             The word 'PASS' should be GREEN, the word 'FAIL' should be 'RED', &
             The 'Single Row' choices should display both choices on a single &
             row and the title ('Single Row?') should be diplayed on each side &
             of the choices. &
             The prompt should have a title of 'NEW TITLE', text of &
             'This is the text you should see' and should have a Box &
             around the text."
  set t:setItemColors {ITEMCOLORS={PASS=GREEN,FAIL=RED}}
  set t:setOneRow {FLAGS="+OneRow|+TRight"}
  set t:setWidgetOptions {VALUE="This is the text you should see", &
                  FLAGS="+INLINE|+VBOX|-NOMSG", &
                  TITLE="NEW TITLE" }
  if interAct then
    pipe init 
      panel/setup/controls=gc
    
      gcontrol label macro  "MACRO" 
        gcontrol/tleft menu  MAIN   "Exit with Status = " "PASS,FAIL" table=^setItemColors
        gcontrol/tleft prompt  deuce   "Table Edit" "SHOULD NOT SEE THIS TEXT" table=^setWidgetOptions
        gcontrol/tleft menu2  MAIN   "Single Row?" "One,Two" table=^setOneRow
        gcontrol text  idtext "Instructions" "^instr" 12 12 /title
        ! set gc.MAIN.itemColors {PASS=GREEN,FAIL=RED}
     
    pipe off

  endif
endmacro

procedure processMessage m:msg
  !say "Got message name=^msg.name info=^msg.info data=^msg.data fid=^msg.fid"
  if msg.name EQS "MAIN" then
    assert/text="^reg.main.name: Menu Table" "PASS" SUBS msg.data
    pipe stop
  else
    !say "^reg.main.name: Unhandled message name=^msg.name info=^msg.info data=^msg.data"
  endif
return
