Page 228 Table of Contents Index Page 230
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E



CHAPTER 23. PRESENTATION TYPES

None of define-presentation-to-command-translator's arguments is evaluated.

=> define-presentation-action name (from-type to-type command-table &key gesture tester doc-
umentation pointer-documentation menu priority) arglist
&body body [Macro]
define-presentation-action is similar to define-presentation-translator, except that
the body of the action is not intended to return a value, but should instead side-effect some sort
of application state.

A presentation action does not satisfy a request for input the way an ordinary translator does.
Instead, an action is something that happens while waiting for input. After the action has been
executed, the program continues to wait for the same input that it was waiting for prior to
executing the action.

The other arguments to define-presentation-action are the same as for define-presentation-
translator
. Note that the tester for presentation actions is always assumed to be definitive.

None of define-presentation-action's arguments is evaluated.

=> define-drag-and-drop-translator name (from-type to-type destination-type command-table
&key gesture tester documentation pointer-documentation menu priority feedback highlighting)
arglist &body body
[Macro]
Defines a "drag and drop" (or "direct manipulation") translator named name that translates
from objects of type from-type to objects of type to-type when a "from presentation" is "picked
up", "dragged" over, and "dropped" on to a "to presentation" having type destination-type.
from-type, to-type, and destination-type are presentation type specifiers, but must not include
any presentation type options. from-type, to-type and destination-type may be presentation type
abbreviations.

The interaction style used by these translators is that a user points to a "from presentation"
with the pointer, picks it up by pressing a pointer button matching gesture, drags the "from pre-
sentation" to a "to presentation" by moving the pointer, and then drops the "from presentation"
onto the "to presentation". The dropping might be accomplished by either releasing the pointer
button or clicking again, depending on the frame manager. When the pointer button is released,
the translator whose destination-type matches the presentation type of the "to presentation" is
chosen. For example, dragging a file to the TrashCan on a Macintosh could be implemented by
a drag and drop translator.

While the pointer is being dragged, the function specified by feedback is invoked to provide
feedback to the user. The function is called with eight arguments: the application frame object,
the "from presentation", the stream, the initial x and y positions of the pointer, the current x
and y positions of the pointer, and a feedback state (either :highlight to draw feedback, or
:unhighlight to erase it). The feedback function is called to draw some feedback the first time
pointer moves, and is then called twice each time the pointer moves thereafter (once to erase
the previous feedback, and then to draw the new feedback). It is called a final time to erase the
last feedback when the pointer button is released. feedback defaults to frame-drag-and-drop-


Page 228 Table of Contents Index Page 230
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E