|
Packit |
b099d7 |
/* $TOG: UTMPrim1.dat /main/5 1999/11/18 16:45:00 jff $ */
|
|
Packit |
b099d7 |
/*
|
|
Packit |
b099d7 |
* Motif
|
|
Packit |
b099d7 |
*
|
|
Packit |
b099d7 |
* Copyright (c) 1987-2012, The Open Group. All rights reserved.
|
|
Packit |
b099d7 |
*
|
|
Packit |
b099d7 |
* These libraries and programs are free software; you can
|
|
Packit |
b099d7 |
* redistribute them and/or modify them under the terms of the GNU
|
|
Packit |
b099d7 |
* Lesser General Public License as published by the Free Software
|
|
Packit |
b099d7 |
* Foundation; either version 2 of the License, or (at your option)
|
|
Packit |
b099d7 |
* any later version.
|
|
Packit |
b099d7 |
*
|
|
Packit |
b099d7 |
* These libraries and programs are distributed in the hope that
|
|
Packit |
b099d7 |
* they will be useful, but WITHOUT ANY WARRANTY; without even the
|
|
Packit |
b099d7 |
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
Packit |
b099d7 |
* PURPOSE. See the GNU Lesser General Public License for more
|
|
Packit |
b099d7 |
* details.
|
|
Packit |
b099d7 |
*
|
|
Packit |
b099d7 |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit |
b099d7 |
* License along with these librararies and programs; if not, write
|
|
Packit |
b099d7 |
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
|
|
Packit |
b099d7 |
* Floor, Boston, MA 02110-1301 USA
|
|
Packit |
b099d7 |
*/
|
|
Packit |
b099d7 |
/*
|
|
Packit |
b099d7 |
* HISTORY
|
|
Packit |
b099d7 |
*/
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
@) Testing primary selection transfer from TextField.
|
|
Packit |
b099d7 |
#) Double-click BSelect in the TextField widget to select a word.
|
|
Packit |
b099d7 |
<Ctrl> Bselect at a location disjoint from the primary selection.
|
|
Packit |
b099d7 |
Single click BTransfer to paste the current selection at the
|
|
Packit |
b099d7 |
insertion cursor.
|
|
Packit |
b099d7 |
One message should be printed indicating that XmNdestinationCallback
|
|
Packit |
b099d7 |
was called for the TextField widget.
|
|
Packit |
b099d7 |
At least one message should be printed indicating that the
|
|
Packit |
b099d7 |
XmNconvertCallback was called for the TextField widget.
|
|
Packit |
b099d7 |
!)
|
|
Packit |
b099d7 |
XmNdestinationCallback called for TextField widget.
|
|
Packit |
b099d7 |
selection = PRIMARY
|
|
Packit |
b099d7 |
operation = XmCOPY
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
XmNconvertCallback called for TextField widget.
|
|
Packit |
b099d7 |
selection = PRIMARY
|
|
Packit |
b099d7 |
conversion target = TEXT
|
|
Packit |
b099d7 |
#) Make a selection in the TextField widget again. Single Click BTransfer
|
|
Packit |
b099d7 |
in the Text widget in order to paste the current selection into
|
|
Packit |
b099d7 |
the Text widget.
|
|
Packit |
b099d7 |
One message should be written to the terminal indicating
|
|
Packit |
b099d7 |
that the XmNdestinationCallback was called for the Text widget.
|
|
Packit |
b099d7 |
At least one message should be printed indicating that the
|
|
Packit |
b099d7 |
XmNconvertCallback was called for the TextField widget.
|
|
Packit |
b099d7 |
!)
|
|
Packit |
b099d7 |
XmNdestinationCallback called for Text widget.
|
|
Packit |
b099d7 |
selection = PRIMARY
|
|
Packit |
b099d7 |
operation = XmCOPY
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
XmNconvertCallback called for TextField widget.
|
|
Packit |
b099d7 |
selection = PRIMARY
|
|
Packit |
b099d7 |
conversion target = TEXT
|
|
Packit |
b099d7 |
C)
|
|
Packit |
b099d7 |
@) Testing primary selection transfer from Text.
|
|
Packit |
b099d7 |
#) Double-click MB1 in the Text widget to select a word. <Ctrl> Bselect at
|
|
Packit |
b099d7 |
a location disjoint from the primary selection. Single click BTransfer
|
|
Packit |
b099d7 |
to paste the current selection at the insertion cursor.
|
|
Packit |
b099d7 |
One message should be printed indicating that
|
|
Packit |
b099d7 |
XmNdestinationCallback was called for the Text widget (selection = PRIMARY,
|
|
Packit |
b099d7 |
operation = XmCOPY).
|
|
Packit |
b099d7 |
At least one message should be printed indicating that the
|
|
Packit |
b099d7 |
XmNconvertCallback was called for the Text widget (selection = PRIMARY,
|
|
Packit |
b099d7 |
conversion target = TEXT).
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#) Make a selection in the Text widget again. Single Click BTransfer in
|
|
Packit |
b099d7 |
the TextField widget in order to paste the current selection into
|
|
Packit |
b099d7 |
the TextField widget. One message should be written to the terminal indicating
|
|
Packit |
b099d7 |
that the XmNdestinationCallback was called for the TextField widget
|
|
Packit |
b099d7 |
(selection = PRIMARY, operation = XmCOPY).
|
|
Packit |
b099d7 |
At least one message should be printed indicating that the
|
|
Packit |
b099d7 |
XmNconvertCallback was called for the Text widget (selection = PRIMARY,
|
|
Packit |
b099d7 |
conversion target = TEXT).
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
C)
|
|
Packit |
b099d7 |
@) The following panel tests the *CopyLink and *PasteLink functions
|
|
Packit |
b099d7 |
within each of the text widgets.
|
|
Packit |
b099d7 |
@) Check that each time you call the *CopyLink function, the convert
|
|
Packit |
b099d7 |
Callback is called 3 times with the following arguments:
|
|
Packit |
b099d7 |
!)
|
|
Packit |
b099d7 |
selection = CLIPBOARD
|
|
Packit |
b099d7 |
conversion target = _MOTIF_CLIPBOARD_TARGETS
|
|
Packit |
b099d7 |
parm = XmLINK
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
selection = CLIPBOARD
|
|
Packit |
b099d7 |
conversion target = MY_LINK_TARGET
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
selection = CLIPBOARD
|
|
Packit |
b099d7 |
conversion target = _MOTIF_DEFERRED_CLIPBOARD_TARGETS
|
|
Packit |
b099d7 |
parm = XmLINK
|
|
Packit |
b099d7 |
@) Check that each time you call the *PasteLink function, the destination
|
|
Packit |
b099d7 |
callback is called 1 time with the following arguments:
|
|
Packit |
b099d7 |
!)
|
|
Packit |
b099d7 |
selection = CLIPBOARD
|
|
Packit |
b099d7 |
operation = XmLINK
|
|
Packit |
b099d7 |
#) Make a selection in the TextField widget.
|
|
Packit |
b099d7 |
Press MB3 in the TextField widget to popup the \"TextField Functions\"
|
|
Packit |
b099d7 |
menu. Select XmTextFieldCopyLink from the menu to call this function
|
|
Packit |
b099d7 |
with the primary selection. The TextField convert Callback is called.
|
|
Packit |
b099d7 |
<Ctrl> Bselect at a location disjoint from the primary selection.
|
|
Packit |
b099d7 |
Press MB3 in the TextField widget to popup
|
|
Packit |
b099d7 |
the \"TextField Functions\" menu again.
|
|
Packit |
b099d7 |
Select XmTextFieldPasteLink from the menu to paste the link information
|
|
Packit |
b099d7 |
at the cursor position.
|
|
Packit |
b099d7 |
The TextField destination Callback is called, resulting in the paste of
|
|
Packit |
b099d7 |
the \"<TextField Link>\" string.
|
|
Packit |
b099d7 |
#) Make a selection in the Text widget.
|
|
Packit |
b099d7 |
Press MB3 in the Text widget to popup the \"Text Functions\" menu.
|
|
Packit |
b099d7 |
Select XmTextCopyLink from the menu to call this function
|
|
Packit |
b099d7 |
with the primary selection. The Text convert Callback is called.
|
|
Packit |
b099d7 |
<Ctrl> Bselect at a location disjoint from the primary selection.
|
|
Packit |
b099d7 |
Press MB3 in the Text widget to popup the
|
|
Packit |
b099d7 |
\"Text Functions\" menu again.
|
|
Packit |
b099d7 |
Select XmTextPasteLink from the menu to paste the link information
|
|
Packit |
b099d7 |
at the cursor position.
|
|
Packit |
b099d7 |
The Text destination Callback is called, resulting in the paste of
|
|
Packit |
b099d7 |
the \"<Text Link>\" string.
|
|
Packit |
b099d7 |
C)
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
@) The following panel tests the *CopyLink and *PasteLink functions
|
|
Packit |
b099d7 |
between each of the text widgets.
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#) Make a selection in the TextField widget.
|
|
Packit |
b099d7 |
Press MB3 in the TextField widget to popup the \"TextField Functions\"
|
|
Packit |
b099d7 |
menu. Select XmTextFieldCopyLink from the menu to call this function
|
|
Packit |
b099d7 |
with the primary selection. The TextField convert Callback is called.
|
|
Packit |
b099d7 |
Click BSelect in the Text widget.
|
|
Packit |
b099d7 |
Press MB3 in the Text widget to popup the \"Text Functions\" menu.
|
|
Packit |
b099d7 |
Select XmTextPasteLink from the menu to paste the link information
|
|
Packit |
b099d7 |
from the TextField widget at the cursor position in the Text widget.
|
|
Packit |
b099d7 |
The Text destination Callback is called, resulting in the paste of
|
|
Packit |
b099d7 |
the \"<TextField Link>\" string.
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
C)
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#) Select something in any of the Text widgets.
|
|
Packit |
b099d7 |
Then test the link_primary action in TextField and Text
|
|
Packit |
b099d7 |
widgets, by clicking "Ctrl <Key> l".
|
|
Packit |
b099d7 |
#) Verify that the destination callback is called for the widget where you
|
|
Packit |
b099d7 |
invoke the action, with the following arguments:
|
|
Packit |
b099d7 |
!)
|
|
Packit |
b099d7 |
selection = PRIMARY
|
|
Packit |
b099d7 |
operation = XmLINK
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#) Verify that the convert callback is called for the widget where the
|
|
Packit |
b099d7 |
selection was done, with the following arguments:
|
|
Packit |
b099d7 |
!)
|
|
Packit |
b099d7 |
selection = PRIMARY
|
|
Packit |
b099d7 |
conversion target = MY_LINK_TARGET
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
C)
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
@) Testing secondary selection transfer.
|
|
Packit |
b099d7 |
#) Click MB1 in the Text widget where you want your selection to be
|
|
Packit |
b099d7 |
copied.
|
|
Packit |
b099d7 |
#) Pressing <Alt> Btransfer and moving in the TextField, do a secondary
|
|
Packit |
b099d7 |
selection. The text becomes underlined. Release Btransfer.
|
|
Packit |
b099d7 |
#) The secondary selection is copied into the Text widget.
|
|
Packit |
b099d7 |
#) One message should be printed indicating that XmNdestinationCallback
|
|
Packit |
b099d7 |
was called for the Text widget.
|
|
Packit |
b099d7 |
At least one message should be printed indicating that the
|
|
Packit |
b099d7 |
XmNconvertCallback was called for the TextField widget.
|
|
Packit |
b099d7 |
!)
|
|
Packit |
b099d7 |
XmNdestinationCallback called for Text widget.
|
|
Packit |
b099d7 |
selection = SECONDARY
|
|
Packit |
b099d7 |
operation = XmCOPY
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
XmNconvertCallback called for TextField widget.
|
|
Packit |
b099d7 |
selection = SECONDARY
|
|
Packit |
b099d7 |
conversion target = STRING
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#) Do the same for all the different combinations. Verify each time
|
|
Packit |
b099d7 |
that the destinationCallback and the convertCallback are called for
|
|
Packit |
b099d7 |
the right widget, with the right parameter.
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
C)
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#) Double-click BSelect on a word in the TextField widget. <Ctrl> BTransfer
|
|
Packit |
b099d7 |
should make the selection a drag source.
|
|
Packit |
b099d7 |
Verify that a message is printed indicating that XmNconvertCallback has
|
|
Packit |
b099d7 |
been called for the TextField widget.
|
|
Packit |
b099d7 |
!)
|
|
Packit |
b099d7 |
XmNconvertCallback called for TextField widget.
|
|
Packit |
b099d7 |
selection = _MOTIF_DROP
|
|
Packit |
b099d7 |
conversion target = _MOTIF_EXPORT_TARGETS
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#) Again double-click BSelect on a word in the TextField widget. Simultaneously
|
|
Packit |
b099d7 |
press <Ctrl> BTransfer and drag the selection over to the Text widget
|
|
Packit |
b099d7 |
and drop it.
|
|
Packit |
b099d7 |
Verify that a message is written to the terminal indicating that the
|
|
Packit |
b099d7 |
XmNdestinationCallback has been called for the Text widget and that the
|
|
Packit |
b099d7 |
XmNconvertCallback has been called for the TextField widget.
|
|
Packit |
b099d7 |
!)
|
|
Packit |
b099d7 |
XmNdestinationCallback called for Text widget.
|
|
Packit |
b099d7 |
selection = _MOTIF_DROP
|
|
Packit |
b099d7 |
operation = XmCOPY
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
XmNconvertCallback called for TextField widget.
|
|
Packit |
b099d7 |
selection = _MOTIF_DROP
|
|
Packit |
b099d7 |
conversion target = STRING
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
C)
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#) Check the convertCallback of the List widget for each of the
|
|
Packit |
b099d7 |
selection policy values. Make a selection in the List widget.
|
|
Packit |
b099d7 |
Press MB2 on the List widget selection and drag the selection
|
|
Packit |
b099d7 |
to one of the Text widgets. Verify that the XmNconvertCallback
|
|
Packit |
b099d7 |
was called for the List widget and the XmNdestinationCallback
|
|
Packit |
b099d7 |
is called for the appropriate text widget.
|
|
Packit |
b099d7 |
!)
|
|
Packit |
b099d7 |
XmNconvertCallback called for List widget.
|
|
Packit |
b099d7 |
selection = _MOTIF_DROP
|
|
Packit |
b099d7 |
conversion target = _MOTIF_EXPORT_TARGETS
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
XmNdestinationCallback called for TextField widget.
|
|
Packit |
b099d7 |
selection = _MOTIF_DROP
|
|
Packit |
b099d7 |
operation = XmCOPY
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
C)
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
@) The following panel tests other primitive widgets as drag sources.
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#) Single-click MB2 on the PushButton widget labelled \"Click Here\".
|
|
Packit |
b099d7 |
A message should be written to the terminal indicating that the
|
|
Packit |
b099d7 |
XmNconvertCallback has been called for the PushButton widget.
|
|
Packit |
b099d7 |
!)
|
|
Packit |
b099d7 |
XmNconvertCallback called for PushButton widget.
|
|
Packit |
b099d7 |
selection = _MOTIF_DROP
|
|
Packit |
b099d7 |
conversion target = _MOTIF_EXPORT_TARGETS
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#) Single-click MB2 on the ToggleButton widget labelled \"Select This\".
|
|
Packit |
b099d7 |
A message should be written to the terminal indicating that the
|
|
Packit |
b099d7 |
XmNconvertCallback has been called for the ToggleButton widget.
|
|
Packit |
b099d7 |
!)
|
|
Packit |
b099d7 |
XmNconvertCallback called for ToggleButton widget.
|
|
Packit |
b099d7 |
selection = _MOTIF_DROP
|
|
Packit |
b099d7 |
conversion target = _MOTIF_EXPORT_TARGETS
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#) Single-click MB2 on the label widget named \"Label\".
|
|
Packit |
b099d7 |
A message should be written to the terminal indicating that the
|
|
Packit |
b099d7 |
XmNconvertCallback has been called for the Label widget.
|
|
Packit |
b099d7 |
!)
|
|
Packit |
b099d7 |
XmNconvertCallback called for Label widget.
|
|
Packit |
b099d7 |
selection = _MOTIF_DROP
|
|
Packit |
b099d7 |
conversion target = _MOTIF_EXPORT_TARGETS
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#) Single-click MB2 on the value displayed above the Scale widget.
|
|
Packit |
b099d7 |
A message should be written to the terminal indicating that the
|
|
Packit |
b099d7 |
XmNconvertCallback has been called for the Scale widget.
|
|
Packit |
b099d7 |
!)
|
|
Packit |
b099d7 |
XmNconvertCallback called for Scale widget.
|
|
Packit |
b099d7 |
selection = _MOTIF_DROP
|
|
Packit |
b099d7 |
conversion target = _MOTIF_EXPORT_TARGETS
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
C)
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
E)
|
|
Packit |
b099d7 |
|