!**************************************************************************************************!
! author : pquan
!
! purpose: test DVAL GCONTROLS for right justified / aligned flag
!**************************************************************************************************!
startmacro
  set L:failedTests 0
  switch INTERACTIVE interAct GET DEF=TRUE

  if interAct then
    set instructions "Verify that the (+) & (-) DVAL, FVAL, LVAL, and TVAL values below are right justified.
    pipe on

    panel/msgid=MAIN/setup/controls=gc
      gcontrol text  idtext "Instructions" instructions 5 3 /title
      gcontrol label  MACRO "MACRO"
      gcontrol menu main "Exit with Status = " "PASS,FAIL" "PASS" /tleft
      set gc.main.itemcolors {PASS=GREEN,FAIL=RED}
      set defneg -1.5e9
      set def 1.5e9
      set min -10e9
      set max 10e9
      set inc 1e6

      gcontrol DVAL valFormatMult6    "(+) RIGHT JUSTIFIED DVAL"    DEF=def    MIN=min MAX=max INC=inc /RIGHTJUSTIFY
      gcontrol DVAL valFormatMultM    "(-) RIGHT JUSTIFIED DVAL"    DEF=defneg MIN=min MAX=max INC=inc /RIGHTJUSTIFY
      gcontrol FVAL valFormatMult6    "(+) RIGHT JUSTIFIED FVAL"    DEF=def    MIN=min MAX=max INC=inc /RIGHTJUSTIFY
      gcontrol FVAL valFormatMultM    "(-) RIGHT JUSTIFIED FVAL"    DEF=defneg MIN=min MAX=max INC=inc /RIGHTJUSTIFY
      gcontrol LVAL valFormatMult6    "(+) RIGHT JUSTIFIED LVAL"    DEF=def    MIN=min MAX=max INC=inc /RIGHTJUSTIFY
      gcontrol LVAL valFormatMultM    "(-) RIGHT JUSTIFIED LVAL"    DEF=defneg MIN=min MAX=max INC=inc /RIGHTJUSTIFY
      gcontrol TVAL valFormatMult6    "(+) RIGHT JUSTIFIED TVAL"    DEF=def    MIN=min MAX=max INC=inc /RIGHTJUSTIFY
      gcontrol TVAL valFormatMultM    "(-) RIGHT JUSTIFIED TVAL"    DEF=defneg MIN=min MAX=max INC=inc /RIGHTJUSTIFY
    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

!******************************************************************************!
! If an unexpected exception is caught, mark test as failed, unless it is expected
!******************************************************************************!
procedure processException m:emsg
  if expectedException REXISTS then
    assert/text="^reg.main.name: Expected ERROR starts with: ^{expectedException}" expectedException EQSS emsg.data.message
    remove expectedException
  else
    assert/text="^reg.main.name: Caught unexpected exception ^{emsg.data}" "FALSE" isTrue
    if "Trace" SUBS ENV.DEBUG then invoke ,, emsg.data.printStackTrace()
  endif
return
