version 2003
PA_GetClick (params; x; y)
Parameter | Type | Description | |
params | PA_PluginParameters | Parameters received in PluginMain | |
x | short* | Horizontal click position | |
y | short* | Vertical click position |
Description
The routine PA_GetClick returns the horizontal and vertical coordinates of the mouse click (expressed in local coordinates, referring to the owning window) in shorts pointed to by x and y.
params is the PA_PluginParameters the plug-in received in its PluginMain routine.
This routine must be called when PA_GetAreaEvent returns eAE_MouseDown or eAE_MouseUp. Otherwise, it sets *x and *y to 0 and PA_GetLastError returns eER_BadEventCall.
Example
Do something different if the user clicks in the upper/lower area.
// we assume PA_GetAreaEvent has returned aAE_MouseDown void DispatchTheClick(PA_PluginParameters params) { PA_AreaRect r = PA_GetAreaRect(params); short x, y; PA_GetClick(params, &x, &y); if( y < = (r.fBottom - r.fTop)/2 ) DoClickInUpZone(params); else DoClickInLowZone(params); }
See Also
Create and use an external area, PA_GetKey.
Error Handling
Use PA_GetLastError to see if an error occurred (eER_BadEventCall)