Gadget |
This is the gadget to drag. |
LeftEdge |
There is a bounding box you define that the gadget can move
within. This defines the left edge of that, relative to the left
hand edge of the window. If you wish the left edge of the
bounding box to be unlimited, specify a large negative number,
like -1000. |
TopEdge |
This defines the top edge of that bounding box, relative to the
top of the window. If you wish the top edge of the bounding box
to be unlimited, specify a large negative number, like1000. |
RightEdge |
This defines the right edge of the bounding box, relative to the
left edge of the window. If you wish the right edge of the
bounding box to be unlimited, specify a large number, like 1000. |
BottomEdge |
This defines the bottom edge of the bounding box, relative to w
the top of the window. If you wish the bottom of the bounding
box to be unlimited, specify a large number, like .... you
guess. |
Flags |
There are several flags you can set that govern the behavior of
the drag gadget.
- DRAG_INWINDOW
This indicates that the gadget can only be drawn
within the RastPort of the window. If clear, it
will be drawn directly into the screen's bitmap,
so it will travel over other windows, including
overlapping ones. A WorkBench file gadget would
have this flag cleared so it could drag anywhere
in the screen.
- DRAG_MOVEGADGET
If you want the gadget to stay in its new
position, set this flag. The gadget's LeftEdge and
TopEdge value will be adjusted at the end of the
drag. Otherwise, it springs back to the original
position and you are left with the knowledge of
where the icon was dragged to.
- DRAG_OUTLINE
If this flag is set, all parts of the gadget image
that are color pen 0 are transparent. So, rather
than a , rectangular box moving over the picture,
you have an outlined shape.
|
XPos,YPos |
This is the current window coordinate of the
gadget. You can read this after a move to find out
where the user dragged the gadget. And, your
UpdateRoutine (see below) can use this. |
UpdateRoutine |
You can provide a routine that is called every
time the gadget moves a pixel. For example, you
might wish to dynamically display the coordinates
of the gadget as it travels in your window title
bar. This routine is passed two parameters:
- Window
A pointer to your window.
- Draglnfo
A pointer to the DragInfo structure. From this,
you can get the current coordinates, the gadget,
and any other important information.
|