/* $TOG: UTMtransfer.dat /main/5 1999/11/18 16:45:12 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
*/
#) This is the UTMtransfer test.
#) You must see a UTMtransfer window on your screen and a UTMPrim1 window.
#) If you don't see an UTMPrim1 window, please run:
!)
"UTMPrim1 -u -n&"
C)
#) The following panels test the transfer of the primary selection.
#) When you select an object with a primary selection, and then transfer it
(copying it) in an other widget, the following actions should occur:
!)
1. The convertCallback of the widget owning the primary
selection is called multiple times with the selection
field set to PRIMARY and different conversion target
that this widget supports as a source of data.
2. The destinationCallback of the widget receiving
the transfer is called with the selection field
set to PRIMARY and the operation field set to XmCOPY.
#) In our test, the destination widget is the drawing area (red square) in the
UTMtransfer window.
C)
#) Select the "Amazing" word in the TextField widget of the UTMPrim1 window.
#) Pulldown the "Edit" menu of the UTMtransfer window and select
"Paste (copy)".
#) The list of targets supported by the TextField widget appears in the list
of the UTMtransfer window.
!)
TIMESTAMP
FOREGROUND
BACKGROUND
COLORMAP
CLASS
NAME
CLIENT_WINDOW
_MOTIF_RENDER_TABLE
_MOTIF_ENCODING_REGISTRY
COMPOUND_TEXT
TEXT
STRING
#) You should see in your term window the calls to the TextField
convertCallback, and the call to the drawing area destinationCallback.
#) You can play in the UTMtransfer window, by selecting a target type in the
list. When selected, the "Target" name, "Target Value" and target "Type"
are updated in the "Target Values" panel.
C)
#) Select the "scream" word in the Text widget of the UTMPrim1 window.
#) As the primary selection change, you will notice in your term window,
2 TextField widget convertCallback calls, because this widget just lost
the focus and the primary selection:
!)
XmNconvertCallback called for TextField widget.
selection = _MOTIF_DESTINATION
conversion target = _MOTIF_LOSE_SELECTION
XmNconvertCallback called for TextField widget.
selection = PRIMARY
conversion target = _MOTIF_LOSE_SELECTION
#) Pulldown the "Edit" menu of the UTMtransfer window and select
"Paste (copy)".
#) The list of targets supported by the Text widget appears in the list
of the UTMtransfer window.
!)
TIMESTAMP
FOREGROUND
BACKGROUND
COLORMAP
CLASS
NAME
CLIENT_WINDOW
_MOTIF_RENDER_TABLE
_MOTIF_ENCODING_REGISTRY
COMPOUND_TEXT
TEXT
STRING
#) You should see in your term window the calls to the Text
convertCallback, and the call to the drawing area destinationCallback.
#) You can play in the UTMtransfer window, by selecting a target type in the
list. When selected, the "Target" name, "Target Value" and target "Type"
are updated in the "Target Values" panel.
C)
#) The following panels test the transfer (move) of the primary selection.
#) When you select an object with a primary selection, and then transfer it
(moving it) to an other widget, the following actions should occur:
!)
1. The convertCallback of the widget owning the primary
selection is called multiple times with the
selection field set to PRIMARY and different
conversion target that this widget supports as
a source of data.
2. The destinationCallback of the widget receiving
the transfer is called with the selection field
set to PRIMARY and the operation field set to XmMOVE.
3. When the transfer is completed, a delete request
is sent to the owner of the primary selection.
That is the convertCallback is called with the
selection field set to PRIMARY and the conversion
target set to DELETE.
#) In our test, the destination widget is the drawing area (red square) in the
UTMtransfer window.
C)
#) Select the "Amazing" word in the TextField widget of the UTMPrim1 window.
#) Pulldown the "Edit" menu of the UTMtransfer window and select
"Paste (move)".
#) The list of targets supported by the TextField widget appears in the list
of the UTMtransfer window.
#) You should see in your term window the calls to the TextField
convertCallback, the call to the drawing area destinationCallback, and
the call to the TextField convertCallback with the DELETE conversion
target.
#) Notice that the "Amazing" word has been cut from the TextField widget.
#) You can play in the UTMtransfer window, by selecting a target type in the
list. When selected, the "Target" name, "Target Value" and target "Type"
are updated in the "Target Values" panel.
C)
#) Select the "scream" word in the Text widget of the UTMPrim1 window.
#) Pulldown the "Edit" menu of the UTMtransfer window and select
"Paste (move)".
#) The list of targets supported by the Text widget appears in the list
of the UTMtransfer window.
#) You should see in your term window the calls to the Text
convertCallback, the call to the drawing area destinationCallback, and
the call to the Text convertCallback with the DELETE conversion
target.
#) Notice that the "scream" word has been cut from the TextField widget.
#) You can play in the UTMtransfer window, by selecting a target type in the
list. When selected, the "Target" name, "Target Value" and target "Type"
are updated in the "Target Values" panel.
C)
#) Select the "Flavors" word in the TextField widget of the UTMPrim1 window.
#) Press Btn2 and start dragging. Drop it in the drawing area of the
UTMtransfer window.
#) The list of targets supported by the TextField widget appears in the list
of the UTMtransfer window.
#) You should see in your term window the calls to the TextField
convertCallback with _MOTIF_EXPORT_TARGETS, then the individual conversion
target calls, and the drawing area destinationCallback, with the
following parameters:
!)
selection = _MOTIF_DROP
operation = XmMOVE
C)
#) Select the "ice" word in the Text widget of the UTMPrim1 window.
#) Press Btn2 and start dragging. Drop it in the drawing area of the
UTMtransfer window.
#) The list of targets supported by the Text widget appears in the list
of the UTMtransfer window.
#) You should see in your term window the calls to the Text
convertCallback with _MOTIF_EXPORT_TARGETS, then the individual conversion
target calls, and the drawing area destinationCallback, with the
following parameters:
!)
selection = _MOTIF_DROP
operation = XmMOVE
C)
#) Select the "Maple Walnut" item in the List widget of the UTMPrim1 window.
#) Press Btn2 and start dragging. Drop it in the drawing area of the
UTMtransfer window.
#) The list of targets supported by the List widget appears in the list
of the UTMtransfer window.
!)
TIMESTAMP
FOREGROUND
BACKGROUND
COLORMAP
CLASS
NAME
CLIENT_WINDOW
_MOTIF_RENDER_TABLE
_MOTIF_ENCODING_REGISTRY
_MOTIF_COMPOUND_STRING
COMPOUND_TEXT
TEXT
STRING
#) You should see in your term window the calls to the List
convertCallback with _MOTIF_EXPORT_TARGETS, then the individual conversion
target calls, and the drawing area destinationCallback, with the
following parameters:
!)
selection = _MOTIF_DROP
operation = XmCOPY
C)
#) Press Btn2 on the PushButton widget and start dragging.
Drop it in the drawing area of the UTMtransfer window.
#) The list of targets supported by the PushButton widget appears in the list
of the UTMtransfer window.
!)
TIMESTAMP
FOREGROUND
BACKGROUND
COLORMAP
CLASS
NAME
CLIENT_WINDOW
_MOTIF_RENDER_TABLE
_MOTIF_ENCODING_REGISTRY
_MOTIF_COMPOUND_STRING
COMPOUND_TEXT
TEXT
STRING
#) You should see in your term window the calls to the PushButton
convertCallback with _MOTIF_EXPORT_TARGETS, then the individual conversion
target calls, and the drawing area destinationCallback, with the
following parameters:
!)
selection = _MOTIF_DROP
operation = XmCOPY
#) You should obtain the same result with the ToggleButton and the Label.
C)
#) Press Btn2 on the label value of the Scale widget and start dragging.
Drop it in the drawing area of the UTMtransfer window.
#) The list of targets supported by the Scale widget appears in the list
of the UTMtransfer window.
!)
TIMESTAMP
FOREGROUND
BACKGROUND
COLORMAP
CLASS
NAME
CLIENT_WINDOW
_MOTIF_RENDER_TABLE
_MOTIF_ENCODING_REGISTRY
COMPOUND_TEXT
STRING
#) You should see in your term window the calls to the Scale
convertCallback with _MOTIF_EXPORT_TARGETS, then the individual conversion
target calls, and the drawing area destinationCallback, with the
following parameters:
!)
selection = _MOTIF_DROP
operation = XmCOPY
C)
#) Before exiting press the QuitButton in UTMPrim1.
E)