/* $TOG: UTMPrim1.dat /main/5 1999/11/18 16:45:00 jff $ */ /* * @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 */ @) Testing primary selection transfer from TextField. #) Double-click BSelect in the TextField widget to select a word. Bselect at a location disjoint from the primary selection. Single click BTransfer to paste the current selection at the insertion cursor. One message should be printed indicating that XmNdestinationCallback was called for the TextField widget. At least one message should be printed indicating that the XmNconvertCallback was called for the TextField widget. !) XmNdestinationCallback called for TextField widget. selection = PRIMARY operation = XmCOPY XmNconvertCallback called for TextField widget. selection = PRIMARY conversion target = TEXT #) Make a selection in the TextField widget again. Single Click BTransfer in the Text widget in order to paste the current selection into the Text widget. One message should be written to the terminal indicating that the XmNdestinationCallback was called for the Text widget. At least one message should be printed indicating that the XmNconvertCallback was called for the TextField widget. !) XmNdestinationCallback called for Text widget. selection = PRIMARY operation = XmCOPY XmNconvertCallback called for TextField widget. selection = PRIMARY conversion target = TEXT C) @) Testing primary selection transfer from Text. #) Double-click MB1 in the Text widget to select a word. Bselect at a location disjoint from the primary selection. Single click BTransfer to paste the current selection at the insertion cursor. One message should be printed indicating that XmNdestinationCallback was called for the Text widget (selection = PRIMARY, operation = XmCOPY). At least one message should be printed indicating that the XmNconvertCallback was called for the Text widget (selection = PRIMARY, conversion target = TEXT). #) Make a selection in the Text widget again. Single Click BTransfer in the TextField widget in order to paste the current selection into the TextField widget. One message should be written to the terminal indicating that the XmNdestinationCallback was called for the TextField widget (selection = PRIMARY, operation = XmCOPY). At least one message should be printed indicating that the XmNconvertCallback was called for the Text widget (selection = PRIMARY, conversion target = TEXT). C) @) The following panel tests the *CopyLink and *PasteLink functions within each of the text widgets. @) Check that each time you call the *CopyLink function, the convert Callback is called 3 times with the following arguments: !) selection = CLIPBOARD conversion target = _MOTIF_CLIPBOARD_TARGETS parm = XmLINK selection = CLIPBOARD conversion target = MY_LINK_TARGET selection = CLIPBOARD conversion target = _MOTIF_DEFERRED_CLIPBOARD_TARGETS parm = XmLINK @) Check that each time you call the *PasteLink function, the destination callback is called 1 time with the following arguments: !) selection = CLIPBOARD operation = XmLINK #) Make a selection in the TextField widget. Press MB3 in the TextField widget to popup the \"TextField Functions\" menu. Select XmTextFieldCopyLink from the menu to call this function with the primary selection. The TextField convert Callback is called. Bselect at a location disjoint from the primary selection. Press MB3 in the TextField widget to popup the \"TextField Functions\" menu again. Select XmTextFieldPasteLink from the menu to paste the link information at the cursor position. The TextField destination Callback is called, resulting in the paste of the \"\" string. #) Make a selection in the Text widget. Press MB3 in the Text widget to popup the \"Text Functions\" menu. Select XmTextCopyLink from the menu to call this function with the primary selection. The Text convert Callback is called. Bselect at a location disjoint from the primary selection. Press MB3 in the Text widget to popup the \"Text Functions\" menu again. Select XmTextPasteLink from the menu to paste the link information at the cursor position. The Text destination Callback is called, resulting in the paste of the \"\" string. C) @) The following panel tests the *CopyLink and *PasteLink functions between each of the text widgets. #) Make a selection in the TextField widget. Press MB3 in the TextField widget to popup the \"TextField Functions\" menu. Select XmTextFieldCopyLink from the menu to call this function with the primary selection. The TextField convert Callback is called. Click BSelect in the Text widget. Press MB3 in the Text widget to popup the \"Text Functions\" menu. Select XmTextPasteLink from the menu to paste the link information from the TextField widget at the cursor position in the Text widget. The Text destination Callback is called, resulting in the paste of the \"\" string. C) #) Select something in any of the Text widgets. Then test the link_primary action in TextField and Text widgets, by clicking "Ctrl l". #) Verify that the destination callback is called for the widget where you invoke the action, with the following arguments: !) selection = PRIMARY operation = XmLINK #) Verify that the convert callback is called for the widget where the selection was done, with the following arguments: !) selection = PRIMARY conversion target = MY_LINK_TARGET C) @) Testing secondary selection transfer. #) Click MB1 in the Text widget where you want your selection to be copied. #) Pressing Btransfer and moving in the TextField, do a secondary selection. The text becomes underlined. Release Btransfer. #) The secondary selection is copied into the Text widget. #) One message should be printed indicating that XmNdestinationCallback was called for the Text widget. At least one message should be printed indicating that the XmNconvertCallback was called for the TextField widget. !) XmNdestinationCallback called for Text widget. selection = SECONDARY operation = XmCOPY XmNconvertCallback called for TextField widget. selection = SECONDARY conversion target = STRING #) Do the same for all the different combinations. Verify each time that the destinationCallback and the convertCallback are called for the right widget, with the right parameter. C) #) Double-click BSelect on a word in the TextField widget. BTransfer should make the selection a drag source. Verify that a message is printed indicating that XmNconvertCallback has been called for the TextField widget. !) XmNconvertCallback called for TextField widget. selection = _MOTIF_DROP conversion target = _MOTIF_EXPORT_TARGETS #) Again double-click BSelect on a word in the TextField widget. Simultaneously press BTransfer and drag the selection over to the Text widget and drop it. Verify that a message is written to the terminal indicating that the XmNdestinationCallback has been called for the Text widget and that the XmNconvertCallback has been called for the TextField widget. !) XmNdestinationCallback called for Text widget. selection = _MOTIF_DROP operation = XmCOPY XmNconvertCallback called for TextField widget. selection = _MOTIF_DROP conversion target = STRING C) #) Check the convertCallback of the List widget for each of the selection policy values. Make a selection in the List widget. Press MB2 on the List widget selection and drag the selection to one of the Text widgets. Verify that the XmNconvertCallback was called for the List widget and the XmNdestinationCallback is called for the appropriate text widget. !) XmNconvertCallback called for List widget. selection = _MOTIF_DROP conversion target = _MOTIF_EXPORT_TARGETS XmNdestinationCallback called for TextField widget. selection = _MOTIF_DROP operation = XmCOPY C) @) The following panel tests other primitive widgets as drag sources. #) Single-click MB2 on the PushButton widget labelled \"Click Here\". A message should be written to the terminal indicating that the XmNconvertCallback has been called for the PushButton widget. !) XmNconvertCallback called for PushButton widget. selection = _MOTIF_DROP conversion target = _MOTIF_EXPORT_TARGETS #) Single-click MB2 on the ToggleButton widget labelled \"Select This\". A message should be written to the terminal indicating that the XmNconvertCallback has been called for the ToggleButton widget. !) XmNconvertCallback called for ToggleButton widget. selection = _MOTIF_DROP conversion target = _MOTIF_EXPORT_TARGETS #) Single-click MB2 on the label widget named \"Label\". A message should be written to the terminal indicating that the XmNconvertCallback has been called for the Label widget. !) XmNconvertCallback called for Label widget. selection = _MOTIF_DROP conversion target = _MOTIF_EXPORT_TARGETS #) Single-click MB2 on the value displayed above the Scale widget. A message should be written to the terminal indicating that the XmNconvertCallback has been called for the Scale widget. !) XmNconvertCallback called for Scale widget. selection = _MOTIF_DROP conversion target = _MOTIF_EXPORT_TARGETS C) E)