/* 
 *  @OPENGROUP_COPYRIGHT@
 *  COPYRIGHT NOTICE
 *  Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
 *  Copyright (c) 1996, 1997, 1998, 1999, 2000 The Open Group
 *  ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
 *  the full copyright text.
 *  
 *  This software is subject to an open license. It may only be
 *  used on, with or for operating systems which are themselves open
 *  source systems. You must contact The Open Group for a license
 *  allowing distribution and sublicensing of this software on, with,
 *  or for operating systems which are not Open Source programs.
 *  
 *  See http://www.opengroup.org/openmotif/license for full
 *  details of the license agreement. Any use, reproduction, or
 *  distribution of the program constitutes recipient's acceptance of
 *  this agreement.
 *  
 *  EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
 *  PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
 *  WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
 *  OR FITNESS FOR A PARTICULAR PURPOSE
 *  
 *  EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
 *  NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
 *  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 *  DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED
 *  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 *  ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
 *  EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
 *  POSSIBILITY OF SUCH DAMAGES.
*/ 
/* 
 * HISTORY
*/ 
/*
static char rcsid[] = "$XConsortium: SharedTearM1b.dat /main/5 1995/07/13 18:38:54 drk $"
*/
@)     SHARED TEAR OFF MENU TEST  run with -tt1 command line argument

#) Two client windows will appear, each containing a menubar, option menu,
   popup menu and an array of pushbuttons to change menu item sensitivity.
!)
#) A message should appear, specifying the tear off control.  It
   should verify that the tear off control's parent is the pane passed
   to XmGetTearOffControl().
!)

#) A number of warnings should have been issued - something like,
   "Tear off enabled on a shared menupane: allowed but not recommended"
!)

#) There should be no 'String" to 'TearOffModel' type converter warnings.

C)


@)     TESTING SHARED TEAR OFF SENSITIVITY

#) Use any tear off method to tear off MenuBar [Colors] submenu from either 
   window.
!)
#) Select the [Change Red Sensitivity] button in the same window.
   Menu item, [Red], in the tear off menupane should change to INsensitive.
!)
#) In (one of) the other window(s), select the [Change Green Sensitivity] 
   button.
   Menu item [Green]'s sensitivity in the tear off menupane should NOT change.
!)
#) In the original "same" window, post the MenuBar [Colors] submenu by 
   selecting with Button1.  
!)
#)  Note that menu item [Red] is INsensitive and [Green] is sensitive.
   KeyPress <R> should have no affect.
   KeyPress <G> should activate menu item [Green] via its mnemonic.

#) In the original "same" window, post the Popup Menu with Button3Press.  
   Post the cascading pane [To More Colors] submenu.  
!)
#)   Note that menu item [Red] is INsensitive and [Green] is sensitive.
   KeyPress <R> should have no affect.
   KeyPress <G> should activate menu item [Green] via its mnemonic.

C)

#) In "(one of) the other window(s)", post the MenuBar [Colors] submenu by
   selecting with Button1.  
!)
#)   Note that menu item [Red] is sensitive and [Green] is INsensitive.
   KeyPress <G> should have no affect.
   KeyPress <R> should activate menu item [Red] via its mnemonic.
!)
#) In the same "(one of) the other window(s)", post the Popup Menu by 
   selecting with Button3.  
   Post the cascading pane [To More Colors] submenu.  
!)
#)  Note that menu item [Red] is sensitive and [Green] is INsensitive.
   KeyPress <G> should have no affect.
   KeyPress <R> should activate menu item [Red] via its mnemonic.

C)

#) In the same "(one of) the other window(s)", use any tear off method to 
   tear off MenuBar [Colors] submenu.
   The old tear off menu should dismiss.
   Note that menu item [Red] is sensitive and [Green] is INsensitive.
!)
#) Make sure that the tear off menu has the focus.
   KeyPress <G> should have no affect.
!)
#) KeyPress <R> should activate menu item [Red] via its mnemonic.
   An activate callback message should be reported to the term window.
!)
#) Select [Red] by traversing to it and KeyPressing <Return> or <Space>.
!)
#) Select [Red] with Button1Press.

C)

#) Post and use any tear off method to tear the Popup Menu from either window
!)
#) Select the [Change Pink Sensitivity] button in the same window.
   Menu item, [Pink], in the tear off menupane should change to INsensitive.
!)
#) In (one of) the other window(s), select the [Change Baby Blue Sensitivity] 
   button.
   Menu item [Baby Blue]'s sensitivity in the tear off menupane should NOT 
   change.
!)
#) In the original "same" window, post the Popup Menu by selecting with 
   Button3.  
!)
#)   Note that menu item [Pink] is INsensitive and [Baby Blue] is sensitive.
   KeyPress <P> should have no affect.
   KeyPress <B> should activate menu item [Baby Blue] via its mnemonic.

C)

#) In the same "(one of) the other window(s)", post the Popup Menu by 
   selecting with Button3.  
   Note that menu item [Pink] is sensitive and [Baby Blue] is INsensitive.
!)
#)   KeyPress <B> should have no affect.
   KeyPress <P> should activate menu item [Pink] via its mnemonic.
   In the popup tear off, [Pink] should still be INsensitive and [Baby Blue]
   should be sensitive.
!)
#) In the same "(one of) the other window(s)", post the Popup Menu by 
   selecting with Button3.  
!)
#) Use any tear off method to tear off the Popup Menu.
   Note that menu item [Pink] is sensitive and [Baby Blue] is INsensitive.

C)

#) Button1Press [RESET MENUS] in each window.
!)
C)

@)     TESTING SHARED TEAR OFF ACCELERATORS

#) Use any tear off method to tear off MenuBar [Colors] submenu from either
   window.
!)
#) Make sure that the tear off menu has the focus.
!)
#) Press <Ctrl-R>.  [Red] should ACTIVATE and report postFromWidget = mb;
Toplevel Shell = (same window).
!)
#) Press <Ctrl-G>.  [Green] should ACTIVATE and report postFromWidget = mb;
Toplevel Shell = (same window).
!)
#) Press <Ctrl-l>.  [Blue] should VALUE_CHANGED and report value and tracked
value = 1; postFromWidget = mb; Toplevel Shell = (same window).
!)
#) Press <Ctrl-Y>.  [Yellow] should VALUE_CHANGED and report value and tracked
value = 1; postFromWidget = mb; Toplevel Shell = (same window).

C)

#) Move the focus to the original "same" window.
!)
#) Press <Ctrl-R>.  [Red] should ACTIVATE and report postFromWidget = mw;
Toplevel Shell = (same window).
!)
#) Press <Ctrl-G>.  [Green] should ACTIVATE and report postFromWidget = mw;
Toplevel Shell = (same window).
!)
#) Press <Ctrl-l>.  [Blue] should VALUE_CHANGED and report value and tracked
value = 0; postFromWidget = mw; Toplevel Shell = (same window).  In the
tear off, [Blue] should change state.
!)
#) Press <Ctrl-Y>.  [Yellow] should VALUE_CHANGED and report value and tracked
value = 0; postFromWidget = mw; Toplevel Shell = (same window).  In the
tear off, [Yellow] should change state.

C)

#) Move the focus to the "other" window.
!)
#) Press <Ctrl-R>.  [Red] should ACTIVATE and report postFromWidget = mw;
Toplevel Shell = (other window).
!)
#) Press <Ctrl-G>.  [Green] should ACTIVATE and report postFromWidget = mw;
Toplevel Shell = (other window).
!)
#) Press <Ctrl-l>.  [Blue] should VALUE_CHANGED and report value and tracked
value = 1; postFromWidget = mw; Toplevel Shell = (other window).  The tear
off should not change.
!)
#) Press <Ctrl-Y>.  [Yellow] should VALUE_CHANGED and report value and tracked
value = 1; postFromWidget = mw; Toplevel Shell = (same window).  The tear
off should not change.

C)

#) Make sure the focus is in the "other" window.
!)
#) Press <Ctrl-l>.  [Blue] should VALUE_CHANGED and report value = 1; tracked
value = 0; postFromWidget = mw; Toplevel Shell = (other window).  The tear
off should not change.
!)
#) Move the focus to the original "same" window.
!)
#) Press <Ctrl-l>.  [Blue] should VALUE_CHANGED and report value and tracked
value = 1; postFromWidget = mw; Toplevel Shell = (same window).  The tear
off should reflect the change.
!)
#) Move the focus back to the "other" window.
!)
#) Press <Ctrl-l>.  [Blue] should VALUE_CHANGED and report value = 0; tracked
value = 1; postFromWidget = mw; Toplevel Shell = (other window).  The tear
off should not change.

C)

#) Make sure the focus is in the "other" window.
!)
#) Press <Ctrl-Y>.  [Yellow] should VALUE_CHANGED and report value = 1; tracked
value = 0; postFromWidget = mw; Toplevel Shell = (other window).  The tear
off should not change.
!)
#) Move the focus to the original "same" window
!)
#) Press <Ctrl-Y>.  [Yellow] should VALUE_CHANGED and report value and tracked
value = 1; postFromWidget = mw; Toplevel Shell = (same window).  The tear
off should reflect the change.
!)
#) Move the focus back to the "other" window.
!)
#) Press <Ctrl-Y>.  [Yellow] should VALUE_CHANGED and report value = 0; tracked
value = 1; postFromWidget = mw; Toplevel Shell = (other window).  The tear
off should not change.

C)

#) Select the [Change Red Sensitivity] button in the original "same" window.
   Menu item, [Red], in the tear off menupane should change to INsensitive.
!)
#) Select the [Change Blue Sensitivity] button in the original "same" window.
   Menu item, [Blue], in the tear off menupane should change to INsensitive.
!)
#) In the "other" window, select the [Change Green Sensitivity] button.
   Menu item [Green]'s sensitivity in the tear off menupane should NOT change.
!)
#) In the "other" window, select the [Change Yellow Sensitivity] button.
   Menu item [Yellow]'s sensitivity in the tear off menupane should NOT change.
!)
#) Move the focus to the original "same" window.
!)
#) Make sure that the tear off menu has the focus.
   KeyPress <Ctrl-R> should have no affect.
   KeyPress <Ctrl-l> should have no affect.
!)
#) Press <Ctrl-G>.  [Green] should ACTIVATE and report postFromWidget = mb;
   Toplevel Shell = (same window).
!)
#) Press <Ctrl-Y>.  [Yellow] should VALUE_CHANGED and report 
   postFromWidget = mb; Toplevel Shell = (same window).

C)

#) Move the focus to the original "same" window.
!)
#) Press <Ctrl-R>.  [Red] should "ignore activate" and report 
   postFromWidget = mw; Toplevel Shell = (same window).
!)
#) Press <Ctrl-G>.  [Green] should ACTIVATE and report postFromWidget = mw;
   Toplevel Shell = (same window).
!)
#) Press <Ctrl-l>.  [Blue] should "ignore value_changed" and report 
   postFromWidget = mw; Toplevel Shell = (same window).
!)
#) Press <Ctrl-Y>.  [Yellow] should VALUE_CHANGED and report 
   postFromWidget = mw; Toplevel Shell = (same window).

C)

#) Move the focus to the "other" window.
!)
#) Press <Ctrl-R>.  [Red] should ACTIVATE and report postFromWidget = mw;
   Toplevel Shell = (other window).
!)
#) Press <Ctrl-G>.  [Green] should "ignore activate" and report 
   postFromWidget = mw; Toplevel Shell = (other window).
!)
#) Press <Ctrl-l>.  [Blue] should VALUE_CHANGED and report 
   postFromWidget = mw; Toplevel Shell = (other window).
!)
#) Press <Ctrl-Y>.  [Yellow] should "ignore value_changed" and report 
   postFromWidget = mw; Toplevel Shell = (other window).

C)

#) In original "same" window, post the MenuBar [Colors] submenu with 
   Button1Click.
   KeyPress <Ctrl-R> should have no affect.
   KeyPress <Ctrl-l> should have no affect.
   The menu should remain posted.
!)
#) Press <Ctrl-G>.  [Green] should ACTIVATE and report postFromWidget = mb;
   Toplevel Shell = (same window).  The menu should unpost.
!)
#) In original "same" window, repost the MenuBar [Colors] submenu with 
   Button1Click.
!)
#) Press <Ctrl-Y>.  [Yellow] should VALUE_CHANGED and report 
   postFromWidget = mb; Toplevel Shell = (same window).  The tear off's
   [Yellow] toggle button should change state.  The menu should unpost.

C)

#) In "other" window, post the MenuBar [Colors] submenu with 
   Button1Click.
   KeyPress <Ctrl-G> should have no affect.
   KeyPress <Ctrl-Y> should have no affect.
   The menu should remain posted.
!)
#) Press <Ctrl-R>.  [Red] should ACTIVATE and report postFromWidget = mb;
   Toplevel Shell = (other window).  The menu should unpost.
!)
#) In "other" window, repost the MenuBar [Colors] submenu with 
   Button1Click.
!)
#) Press <Ctrl-l>.  [Blue] should VALUE_CHANGED and report 
   postFromWidget = mb; Toplevel Shell = (other window).  The tear off
   should not change.  The menu should unpost.

C)

#) Button1Press [RESET MENUS] in each window.
!)

C)

@)     TESTING TEAR OFF CASCADING SUBMENUS AND HIGHLIGHTING

#) Use any tear off method to tear off MenuBar [Colors] submenu from either
   window.
!)
#) In the tear off, Btn1Press [More Colors] to post a cascading submenu.
!)
#) Button1Release on [Black] to select and activate.  An activate callback
   message should be reported to the term window.  The submenu should unpost.
!)
#) Restore focus to the tear off.  [More Colors] should highlight.
!)
#) Button1Click on [Still More Colors] to post a cascading submenu.
!)
#) KeyPress <e> to select and activate [Grey] via its mnemonic.  The submenu
   should unpost.
!)
#) Restore focus to the tear off.  [Still More Colors] should highlight.
!)
#) Repost MenuBar [Colors] from either window.  Red should be highlighted.
 KeyPress <Escape> to unpost the MenuBar.
!)
#) Restore focus to the tear off.  [Still More Colors] should be highlighted.

C)

#) Use any tear off method to tear off the Popup Menu from either window.
!)
#) Make sure that the Popup tear off has the focus.
!)
#) KeyPress <M> to post [To More Colors]'s cascading submenu.
!)
#) KeyPress <Escape> to unpost the cascading submenu.
!)
#) Restore focus to the [Colors] tear off.  [Still More Colors] should 
   be highlighted.

C)

#) In the tear off, Btn1Press on [Green] (and hold).  The cursor should change 
   to the menu cursor.  Moving in and out of [Green] should arm and disarm it.
!)
#) Button1Release on [Green] to activate it.  [Green] should remain
   highlighted.  The cursor should return to normal.
C)

E)

#) This is a Motif 1.2 test only.
C)

E)




