!------------------------------------------------------------------------------!
! Tests for GLine
!
!   Author : J. Bauer
!   Version: $Id: test_gcontrol_line.mm,v 1.2 2011/10/03 19:07:08 jwb Exp $
!------------------------------------------------------------------------------!

startmacro

  pipe on
    panel/controls=gc/setup
    gcontrol label  macro   "MACRO"
      gcontrol menu MAIN "Exit with Status = " "PASS,FAIL" /tleft
      set gc.MAIN.itemColors {PASS=GREEN,FAIL=RED}
      res instructions "You should see a GREEN line amongst the widgets, and a RED line across the control panel below &
           the other widgets. Adjust the values for the color, thickness, percentage, and position &
           and ensure the changes are reflected in the RED line."
      gcontrol text idtext "Instructions" "^instructions" 24 8 /title
    
    gcontrol lval thickness "Thickness" 10 1 100 1 /slider /tleft
    gcontrol lval percent "Percent" 100 0 100 1 /slider /tleft
    gcontrol line line2 "SomeWorthlessText" "GREEN" 5 ,, "CENTER"
    gcontrol/nc=3 button position "Line Position" "LEFT,RIGHT,CENTER" "CENTER"
    gcontrol/nc=3 button color "Line Color" "GREEN,RED,BLUE,WHITE,PURPLE,YELLOW" "GREEN"
    gcontrol line line1 "SomeWorthlessText" "RED" 5  ,, "CENTER"
    
  pipe off

endmacro

procedure processMessage m:msg
  if msg.name EQS "MAIN" then
    assert/text="^reg.main.name: user indicated" msg.data eqs "PASS"
    pipe stop
  elseif msg.name EQS "THICKNESS" then
    set gc.line1.thickness msg.data
  elseif msg.name EQS "PERCENT" then
    set gc.line1.percent msg.data
  elseif msg.name EQS "POSITION" then
    set gc.line1.linePos msg.data
  elseif msg.name EQS "COLOR" then
    set gc.line1.color msg.data
  endif

return
