Back

DragGadget()




    USAGE

    void DragGadget(Window, DragInfo)

    FUNCTION

    This lets you take a normal Intuition BOOLGADGET style Gadget and drag it to a new location. The Gadget must be rendered with Intuition Image structure, because it is the Image that will be dragged.

    There are several options to dragging the Gadget:

    Before calling DragGadget the first time, you must initialise a DragInfo structure.

    The fields that need to be set in the DragInfo structure are:

    Gadget This is a pointer to the Gadget you wish to drag.
    LeftEdge This is the left edge of the bounding box that describes the region this Gadget can move within.
    TopEdge This is the top edge of the bounding box that describes the region this Gadget can move within.
    RightEdge This is the right edge of the bounding box that describes the region this Gadget can move within.
    BottomEdge This is the bottom edge of the bounding box that describes the region this Gadget can move within.
    Flags There are several flags you can set to influence the behavior of the Drag Gadget.
    DRAG_INWINDOW indicates you wish to have the Gadget displayed only within the rastport of your window.
    DRAG_OUTLINE indicates you'd the pen 0 color in the Gadget Image to be transparent.
    DRAG_MOVEGADGET indicates that you'd like the Gadget to stay where the user moves it. Be careful. If the bounding box is outside the window, the user can move the Gadget out of the window, too.
    And then it's somewhat hard to get back.
    XPos, YPos These coordinates indicate where the Gadget is now in the window. You need not set these, but you may need to read them at some point.
    UpdateRoutine You can supply a function that is called every time the Gadget moves. This function is passed two parameters: The window and the DragInfo structure (which, in turn, points to the Gadget). If you don't need to supply a routine, set this to NULL. Such a routine is particulary useful if you need to provide some sort of real time update while the Gadget moves.

    INPUTS

    Window = Pointer to the window this Gadget belongs to.
    DragInfo = Initialised DragInfo structure.

    RESULT

    none (void)