!******************************************************************************!
! Test LOOKANDFEEL graphical command
!
! Arguments: None
!
! @bug      147  Move LOOKANDFEEL from UCL to SYS
! @bug      2232 Lookandfeel/GUI - closing windows via X or Window Close exits Shell
! @author:  J. Czechowski / Neon Ngo
!******************************************************************************!
startmacro
  switch INTERACTIVE  interAct     GET DEF=TRUE  SDEF=TRUE  ! for normal interactive test(s)
  switch BASELINE     baseline     GET DEF=FALSE SDEF=TRUE  ! for defects or more obscure test case(s)
  switch COREGRAPHICS coregraphics GET DEF=FALSE SDEF=TRUE  ! for a quick check of graphics - more extreme tests - since 3.8.1

  if interAct OR coreGraphics then
    res oldTheme ENV.THEME

    set instructions "Change the Look And Feel in the popup frame and the sample &
                      buttons and GUI components should change in that frame. &
                      Then close via the Window Close menu or X (it should not &
                      exit your JVM instance)."
    pipe on
      panel/msgid=MAIN/setup/controls=gc
      gcontrol label macro "Test MACRO"
      gcontrol menu  main "Exit with Status =" "PASS,FAIL" TABLE={ItemColors={PASS="GREEN",FAIL="RED"}} /tleft
      gcontrol text  idtext "Instructions" instructions 24 8 /title

      lookandfeel/gui
    pipe off

    %test_lookandfeel_single/interactive=^interAct "Java"
    if baseline then
      %test_lookandfeel_single/interactive=^interAct "CDE/Motif"
      %test_lookandfeel_single/interactive=^interAct "Browser"
      %test_lookandfeel_single/interactive=^interAct "Gear3"
    endif

    %test_lookandfeel_initialization

    ! restore original look and feel
    lookandfeel oldTheme
  endif

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
