!******************************************************************************!
! Tests the panel borders
!
! @author  J. Hallam
! @version $Id: test_panel_borders.mm,v 1.5 2012/03/26 18:07:16 jwb Exp $
!
!******************************************************************************!
startmacro/theme=gear2
  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)

  pipe on
    set instructions "PANEL borders test.  Select the various options for the borders and watch &
                      for appropriate border changes on the panel.\n\n&
                      Note: Clicking 'LEFT' is disabled, as it rolls up the control panel."

    panel/setup/controls=gc
!!!    shellgui/attach

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

    gcontrol text idtext  "Instructions" "^instructions" 24 10 /title

    gcontrol menu borderChoice "Border Options" ^reg.panel.bordersList "^reg.panel.bordersString" &
          /toggle /chkbox

  pipe off
endmacro

!******************************************************************************!
procedure processMessage m:msg
  !say "Msg ^msg.name = ^msg.data"
  if msg.name EQS "MAIN" then
    assert/text="^reg.main.name: User indicated tests" msg.data eqss "PASS"
    pipe stop
  elseif msg.name EQS "BORDERCHOICE" then
    if msg.data eqs "LEFT" then
      ! do not allow, so that the control panel does not disappear
      set gc.borderChoice.value "+LEFT"
    else 
      set reg.panel.borders gc.borderChoice.value
    endif  
  else
    say "Unhandled message ^msg.name from ^msg.fid"
  endif
return
