Blob Blame History Raw
/* $TOG: UTMPrim1.dat /main/5 1999/11/18 16:45:00 jff $ */
 /*
 * Motif
 *
 * Copyright (c) 1987-2012, The Open Group. All rights reserved.
 *
 * These libraries and programs are free software; you can
 * redistribute them and/or modify them under the terms of the GNU
 * Lesser General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * These libraries and programs are distributed in the hope that
 * they will be useful, but WITHOUT ANY WARRANTY; without even the
 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE. See the GNU Lesser General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with these librararies and programs; if not, write
 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
 * Floor, Boston, MA 02110-1301 USA
 */
/*
 * HISTORY
 */

@) Testing primary selection transfer from TextField.
#) Double-click BSelect in the TextField widget to select a word.
<Ctrl> 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. <Ctrl> 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.
<Ctrl> 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 \"<TextField Link>\" 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.
<Ctrl> 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 \"<Text Link>\" 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 \"<TextField Link>\" string.

C)

#) Select something in any of the Text widgets.
Then test the link_primary action in TextField and Text
widgets, by clicking  "Ctrl <Key> 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 <Alt> 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. <Ctrl> 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 <Ctrl> 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)