/* * @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: PopupMenu5.dat /main/5 1995/07/13 18:53:17 drk $" */ /* Pause 1 */ /* Test for PIR 2968 */ #) This test looks at the uses of XmNwhichButton and XmNmenuPost. #) A client should appear with two pushbuttons - "Popup with whichButton" and "Popup with menupost". PopupMenus have been associated with the first pushButton via XmNwhichButton. Two different popups should appear when pressing MB1 and MB3. #) PopupMenus have been associated with the second pushButton via XmNmenuPost. Two different popups should appear when pressing MB1 and MB3. (Note: The two popups for the first button should be different from the two popups for the second button). #) Verify that MB1 and MB3 presses in both buttons cause popups to be posted. C) /* Pause 2 */ /* Another test for PIRs 2968 and 2972 */ #) Note that no warnings should appear in the term window. #) The same test occurs; however, XmNmenuPost and XmNwhichButton have been specified at SetValues time. #) Verify that MB1 and MB3 presses in both buttons cause popups to be posted. C) /* Pause 3 */ /* Another test for PIR 2972 */ #) Note that no warnings should appear in the term window. #) A BulletinBoard with a PushButton will appear. An event handler has been set for ButtonPress events on the PushButton and the BulletinBoard. A popupMenu has been created as a child of the BulletinBoard. The event handler will manage the popupMenu if MB3 has been pressed. #) Click MB1 in the pushButton. The push button should press in and out. A message should appear in the term window, saying that "whichButton = 3, handler called for Button 1". #) Click MB3 in the pushButton. A message should appear in the term window, saying that "whichButton = 3, handler called for Button3". A popupMenu should appear. Use MB3 to pop down the popupMenu. #) Now click MB1 and MB3 in the bulletinBoard, but not in the pushButton. Messages should be posted for both button clicks and the popup should be posted with MB3. C) /* Pause 4 */ #) Now whichButton has been set to 3 and there is NO event handler set for ButtonPress events on the Bulletin Board, just an event handler on the pushButton. Therefore, the popupMenuhas been created as a child of the pushButton. #) Click MB1 in the pushButton. The push button should press in and out. A message should appear in the term window, saying that "whichButton = 3, handler called for Button 1". #) Click MB3 in the pushButton. A message should appear in the term window, saying that "whichButton = 3, handler called for Button3". A popupMenu should appear. Use MB3 to pop down the popupMenu. #) Now click MB1 and MB3 in the bulletinBoard, but not in the pushButton. No messages should appear in the term window; no effect should happen from selecting in the bulletinBoard. C) /* Pause 5 */ /* Another test for PIR 2972 */ #) Note that no warnings should appear in the term window. #) MenuPost has been set to "", an event handler has been set on both the bulletinBoard and the PushButton. The popupMenu has been created as a child of the bulletinBoard. #) Click MB1 in the PushButton. The pushButton should go in and out. A message should appear in the term window, "menuPost = 3, handler called for Button 1". #) Click MB3 in the PushButton. The popupMenu should post. A message should appear in the term window, "menuPost = 3, handler called for Button 3". Use MB3 to dismiss the popupMenu. #) The same MB1 and MB3 events should occur when selecting in the bulletinBoard. C) /* Pause 6 */ /* Test for PIR 2967 */ #) MenuPost = Btn3. An event handler has been set on the pushButton only. The popupMenu has been created as a child of the pushButton. #) Select MB1 in the pushButton. The pushButton should go in and out. A message should appear in the term window, "menuPost = 3, handler called for Button 1". #) Select MB3 in the pushButton. The popupMenu should appear. A message should appear in the term window, "menuPost = 3, handler called for Button 3". Use MB3 to dismiss the popupMenu. #) Selecting MB1 and MB3 should have no effect within the BulletinBoard. C) /* Pause 7 */ /* PIR 3432 */ #) MenuPost = Btn3. An event handler has been set on the bulletinBoard only. The popupMenu has been created as a child of the BulletinBoard. Press MB1 in the pushButton. It should go in and out. NO message should appear in the term window. #) Press MB3 in the PushButton. A popupMenu should appear and a message should appear in the term window. #) Pressing MB1 should have no effect in the BulletinBoard, however messages from the event handler should appear in the term window. #) Press MB3 in the BulletinBoard. A popupMenu should be posted. A message should appear in the term window. C) /* Pause 8 */ /* Test for PIR 2972, infamous ATTEMPT TO REMOVE NON-EXISTANT PASSIVE GRAB */ E)