!******************************************************************************!
! Tests scrolling and wrapping on a SHELLGUI (handled by MJText) 
!
! Since NeXtMidas 3.5.3 for Bug 2872 and Bug 2887
!
! Author:  Jeanette McCall
!******************************************************************************!
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE

  if interAct then
    pipe on
      panel/msgid=MAIN/setup/controls=gc
      gcontrol label macro "MACRO"
      gcontrol menu main "Exit with Status = " "PASS,FAIL" /tleft
      set gc.main.itemColors {PASS=GREEN,FAIL=RED}

      set instructions "In the SHELLGUI terminal on the right,\n &
            1)  type expl plot at the input prompt \n       &
                nM> expl plot \n &
            2)  notice the bottom line of the explain file that is displayed \n &
            3)  SPACE to get next page of data \n &
            4)  Verify that what was the bottom line (of the explain file)\n     &
                is now the top line displayed\n &
            5)  Q to quit out of the explain \n &
            6)  At the prompt type the erroneous command "plo" (and ENTER) \n       &
                nM> plo \n &
            7)  The ERROR message should wrap properly \n &
            8)  type a couple characters at the input prompt line WITHOUT the ENTER\n       &
                nM> my input \n &
            9)  Try highlighting a word on the input line and then double click\n     &
                to select the whole input line\n &
            10) Try highlighting the whole wrapped ERROR line by double clicking it\n &
            11) Click on a word in the first row of text and other rows\n&   
            If the scroll works as it should and the highlights work as they should, then click PASS \n &
          "
      gcontrol text idtext  "Instructions" "^instructions" 25 22 /title

      shellgui/id=idshellgui
    pipe off
  endif

endmacro

!******************************************************************************!
! process messages for interactive tests
!******************************************************************************!
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 "^reg.main.name: Unhandled message name: ^msg.name from fid: ^msg.fid data: ^msg.data"
  endif
return
