!******************************************************************************!
! Test that plot MMB menu renders correctly on popped out plots in full Swing +SwingPopups
!
! @bug      NXM-3213 Graphics Degradation
! @since    3.8.1
! @author:  Jeanette McCall
!******************************************************************************!
startmacro
  switch INTERACTIVE interAct   GET DEF=TRUE  SDEF=TRUE
  switch BASELINE    baseline   GET DEF=FALSE SDEF=TRUE
  switch CREATEFILE  createFile GET DEF=FALSE SDEF=TRUE  ! re-create the test file

  res fftFilename nxm.sys.test.fft_tri_small_dt.tmp


  if createFile then call createFftFile

  set instr "You should see a piped fft of a triangle wave.\n\n&
             1) Popout the raster plot\n&
             2) Bring up a MMB plot menu\n&
             If it renders correctly, select PASS."

  pipe init
    panel/msgid=MAIN/setup/controls=gc
    ! fft of triangle wave with dt of
    noop/wrap/rt ^fftFilename _mypipe

    plot/id=plot1 _mypipe /lps=128    ! piped

    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" "^{instr}" 24 10 /title
  pipe off
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
  endif
return

!******************************************************************************!
! Create the file used in this test case
!******************************************************************************!
procedure createFftFile
  waveform mytriwave.tmp form=cf elem=8k SHAPE=triangle sr=0.00001  RF=300.1e6 VRF=300e6 BW=1e6 start=2.161187381679E9
  fft mytriwave.tmp ^fftFilename nfft=512
return