OlDetermineMouseAction(3W) UNIX System V OlDetermineMouseAction(3W)
Dynamic Settings
NAME
OlDetermineMouseAction
SYNOPSIS
#include <OpenLook.h>
#include <Dynamic.h>
...
extern ButtonAction OlDetermineMouseAction(w, event)
Widget w;
XEvent * event;
DESCRIPTION
The OlDetermineMouseAction function is used to determine the kind of
mouse gesture that is being attempted: MOUSE_CLICK, MOUSE_MULTI_CLICK, or
MOUSE_MOVE. This function is normally called immediately upon receipt of
a mouse button press event. It uses the current settings for
mouseDampingFactor and multiClickTimeout to determine the kind of gesture
being made.
SEE ALSO
OlDragAndDrop(3W), OlGrabDragPointer(3W), OlUngrabDragPointer(3W)
NOTE
This function performs an active pointer grab. This grab is released for
the CLICK type actions but not for MOUSE_MOVE. It is the responsibility
of the caller to ungrab the pointer if the action is MOUSE_MOVE.
EXAMPLE
static void ButtonConsumeCB (w, client_data, call_data)
widget w;
XtPointer client_data;
XtPointer call_data;
{
Window drop_window;
Position x;
Position y;
OlVirtualEvent ve;
ve = (OlVirtualEvent) call_data
switch (ve -> virtual_name)
{
case OL_SELECT:~
switch(OlDetermineMouseAction(widget, event))
10/89 Page 1
OlDetermineMouseAction(3W) UNIX System V OlDetermineMouseAction(3W)
{
{
case MOUSE_MOVE:~
OlGrabDragPointer(widget, OlGetMoveCursor(XtScreen(widget),
None);
OlDragAndDrop(widget, &drop_window, &x, &y);
DropOn(widget, drop_window, x, y, ....);
OlUngrabDragPointer(widget);
break;
case MOUSE_CLICK:~
ClickSelect(widget, ....);
break;
case MOUSE_MULTI_CLICK:~
MultiClickSelect(widget, ....);
break;
default:~
Panic(widget, ....);
break;
}
break;
default:~
OlReplayBtnEvent(widget, NULL, event);
break;
}
}
Page 2 10/89