version 2003
PA_GetAreaRect (params) PA_Rect
Parameter | Type | Description | |
params | PA_PluginParameters | Parameters received in PluginMain | |
Function result | PA_Rect | Rectangle of the area, in local coordinates |
Description
The routine PA_GetAreaRect returns the local coordinates of the area in the host form.
params is the PA_PluginParameters the plug-in received in its PluginMain routine.
The plug-in usually calls this function when it needs to draw the area or when the eAE_Scroll event is received. This routine is essential for drawing in the area; it returns a rectangle expressed in local coordinates to the window that owns the area.
NOTE FOR WINDOWS USERS
The RECT structure uses long as coordinates since a PA_Rect uses short (like a regular Rect MacOS structure). If the rectangle is used in Windows API's routine, you should convert it (see example below)
Example
Get an area rectangle and convert it to a Windows RECT structure.
void DoSomethingWithTheAreaRect(PA_PluginParameters params) { RECT wRect; ConvertPA_RectToRect( PA_GEtAreaRect(params), &wRect); /* . . . OK, the RECT structure is OK now, we can use it (DrawText ie) . . . */ } void ConvertPA_RectToRect(PA_Rect source, RECT *dest) { if(dest) { dest->top = source.fTop; dest->left = source.fLeft; dest->bottom = source.fBottom; dest->right = source.fRight; } }
See Also
Create and use an external area, PA_GetAreaEvent, PA_GetAreaName.
Error Handling
PA_GetLastError keeps the last error that occurred before calling the routine.