!******************************************************************************!
! Tests interrupt a command
! Arguments: None
! @bug: NXM-2626 - Unable to CTRL+C from loop
! Author:  PDM
!******************************************************************************!
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE  ! for normal interactive test(s)

  if interAct then

    set popupTheme "JAVA"
    set waitItemColors {ITEM1=PURPLE,ITEM2=DARKGREEN}
    set mainItemColors {PASS=GREEN,FAIL=RED}
    set myInstructions "'Exit with Status' menu should have PASS in ^{mainItemColors.PASS} and FAIL in ^{mainItemColors.FAIL}.\n&
                        In a new console open an nm shell.\n&
                        Type the below into your nm shell.\n&
                          nM>home test\n&
                          nM>%ctrlc_piped_child\n&
                        Use CTRL+C to exit the primitive. It should exit to the nm shell."
    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 mainItemColors
        gcontrol TEXT idtext INSTRUCTIONS "^myInstructions" 24 20 /title


    pipe off
  endif

endmacro

!******************************************************************************!
procedure processMessage m:msg

  if msg.name eqs "MAIN"
    assert/text="^reg.main.name: user indicated" msg.data eqs "PASS"
    pipe stop

  elseif msg.name eqs "SHOWWAIT"  then
    gcontrol/wait/msg=f/wtheme=^popupTheme menu waitMenu "MENU/WAIT" "ITEM1,ITEM2" TABLE={ITEMCOLORS=^waitItemColors}

  else
    warning "^reg.main.name: Unhandled message name: ^msg.name from fid: ^msg.fid data: ^msg.data"
  endif

return
