GreBoxBoundary: Difference between revisions
Created page with "GreBoxBoundary draws a rectangular box with one corner at the current (X,Y) position and the opposite corner at the specified (X,Y) position. The current (X,Y) position does n..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
GreBoxBoundary draws a rectangular box with one corner at the current (X,Y) position and the opposite corner at the specified (X,Y) position. The current (X,Y) position does not change. | GreBoxBoundary draws a rectangular box with one corner at the current (X,Y) position and the opposite corner at the specified (X,Y) position. The current (X,Y) position does not change. | ||
This function can be hooked by the presentation driver. | This function can be hooked by the presentation driver. | ||
;Simulation support: This function is simulated by a handling routine in the graphics engine. | ;Simulation support: This function is simulated by a handling routine in the graphics engine. | ||
==Syntax== | ==Syntax== | ||
GreBoxBoundary(hdc, pBox, pInstance, lFunction) | GreBoxBoundary(hdc, pBox, pInstance, lFunction) | ||
==Parameters== | ==Parameters== | ||
;hdc (HDC) - input | ;hdc (HDC) - input:Device context handle. | ||
:Device context handle. | ;pBox (PPOINTL) - input:Pointer to a [[BOXDATA]] structure. | ||
;pInstance (PVOID) - input:Pointer to instance data. | |||
;pBox (PPOINTL) - input | ;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreBoxBoundary. | ||
:Pointer to a BOXDATA structure | |||
;pInstance (PVOID) - input | |||
:Pointer to instance data. | |||
;lFunction (ULONG) - input | |||
:High-order WORD=flags; low-order WORD=NGreBoxBoundary. | |||
==Return Code== | ==Return Code== | ||
;rc (LONG) - returns | ;rc (LONG) - returns:On completion, this function returns an integer (cHits) indicating, where appropriate, whether correlation hits were detected. | ||
:On completion, this function returns an integer (cHits) indicating, where appropriate, whether correlation hits were detected. | ::GPI_OK: Successful | ||
::GPI_HITS: Successful with correlate hit (returned by display drivers when the correlate flag is ON and a hit is detected) | |||
: | ::GPI_ERROR: Error | ||
:Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include: | |||
: | :*PMERR_BASE_ERROR | ||
:*PMERR_BITMAP_NOT_SELECTED | |||
: | :*PMERR_COORDINATE_OVERFLOW | ||
:*PMERR_DEV_FUNC_NOT_INSTALLED | |||
:*PMERR_HDC_BUSY | |||
:Possible Errors Detected: | :*PMERR_INV_BOX_ROUNDING_PARM | ||
:*PMERR_BASE_ERROR | :*PMERR_INV_COLOR_DATA | ||
:*PMERR_BITMAP_NOT_SELECTED | :*PMERR_INV_COLOR_INDEX | ||
:*PMERR_COORDINATE_OVERFLOW | :*PMERR_INV_COORD_SPACE | ||
:*PMERR_DEV_FUNC_NOT_INSTALLED | :*PMERR_INV_HDC | ||
:*PMERR_HDC_BUSY | :*PMERR_INV_IN_AREA | ||
:*PMERR_INV_BOX_ROUNDING_PARM | :*PMERR_INV_IN_PATH | ||
:*PMERR_INV_COLOR_DATA | :*PMERR_INV_LENGTH_OR_COUNT | ||
:*PMERR_INV_COLOR_INDEX | :*PMERR_INV_NESTED_FIGURES | ||
:*PMERR_INV_COORD_SPACE | :*PMERR_INV_PICK_APERTURE_POSN | ||
:*PMERR_INV_HDC | :*PMERR_INV_RECT | ||
:*PMERR_INV_IN_AREA | :*PMERR_NOT_IN_PATH | ||
:*PMERR_INV_IN_PATH | :*PMERR_PATH_LIMIT_EXCEEDED | ||
:*PMERR_INV_LENGTH_OR_COUNT | :*PMERR_PATH_UNKNOWN | ||
:*PMERR_INV_NESTED_FIGURES | :Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation. | ||
:*PMERR_INV_PICK_APERTURE_POSN | |||
:*PMERR_INV_RECT | |||
:*PMERR_NOT_IN_PATH | |||
:*PMERR_PATH_LIMIT_EXCEEDED | |||
:*PMERR_PATH_UNKNOWN | |||
:Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation. | |||
==Remarks== | ==Remarks== | ||
The sides of the box (before transformation) are parallel to the X-axis and the Y-axis. The corners of the box can be rounded by means of quarter ellipses of the specified diameters. When the value of either diameter is 0, no rounding occurs. When the value of either diameter exceeds the length of the corresponding side, that length is used as the diameter instead. When the value of the diameters are equal to the value of the sides, the corners are rounded with a quarter circle. If the current position is (x0, y0), the box is drawn from the current position in a counterclockwise direction. | The sides of the box (before transformation) are parallel to the X-axis and the Y-axis. The corners of the box can be rounded by means of quarter ellipses of the specified diameters. When the value of either diameter is 0, no rounding occurs. When the value of either diameter exceeds the length of the corresponding side, that length is used as the diameter instead. When the value of the diameters are equal to the value of the sides, the corners are rounded with a quarter circle. If the current position is (x0, y0), the box is drawn from the current position in a counterclockwise direction. | ||
When correlating, the handling routine records a hit when the pick aperture intersects the boundary. | When correlating, the handling routine records a hit when the pick aperture intersects the boundary. | ||
==Sample Code== | ==Sample Code== |
Latest revision as of 02:34, 24 March 2020
GreBoxBoundary draws a rectangular box with one corner at the current (X,Y) position and the opposite corner at the specified (X,Y) position. The current (X,Y) position does not change.
This function can be hooked by the presentation driver.
- Simulation support
- This function is simulated by a handling routine in the graphics engine.
Syntax
GreBoxBoundary(hdc, pBox, pInstance, lFunction)
Parameters
- hdc (HDC) - input
- Device context handle.
- pBox (PPOINTL) - input
- Pointer to a BOXDATA structure.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGreBoxBoundary.
Return Code
- rc (LONG) - returns
- On completion, this function returns an integer (cHits) indicating, where appropriate, whether correlation hits were detected.
- GPI_OK: Successful
- GPI_HITS: Successful with correlate hit (returned by display drivers when the correlate flag is ON and a hit is detected)
- GPI_ERROR: Error
- Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:
- PMERR_BASE_ERROR
- PMERR_BITMAP_NOT_SELECTED
- PMERR_COORDINATE_OVERFLOW
- PMERR_DEV_FUNC_NOT_INSTALLED
- PMERR_HDC_BUSY
- PMERR_INV_BOX_ROUNDING_PARM
- PMERR_INV_COLOR_DATA
- PMERR_INV_COLOR_INDEX
- PMERR_INV_COORD_SPACE
- PMERR_INV_HDC
- PMERR_INV_IN_AREA
- PMERR_INV_IN_PATH
- PMERR_INV_LENGTH_OR_COUNT
- PMERR_INV_NESTED_FIGURES
- PMERR_INV_PICK_APERTURE_POSN
- PMERR_INV_RECT
- PMERR_NOT_IN_PATH
- PMERR_PATH_LIMIT_EXCEEDED
- PMERR_PATH_UNKNOWN
- Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.
Remarks
The sides of the box (before transformation) are parallel to the X-axis and the Y-axis. The corners of the box can be rounded by means of quarter ellipses of the specified diameters. When the value of either diameter is 0, no rounding occurs. When the value of either diameter exceeds the length of the corresponding side, that length is used as the diameter instead. When the value of the diameters are equal to the value of the sides, the corners are rounded with a quarter circle. If the current position is (x0, y0), the box is drawn from the current position in a counterclockwise direction.
When correlating, the handling routine records a hit when the pick aperture intersects the boundary.
Sample Code
#define INCL_GRE_ARCS #include <os2.h> HDC hdc; /* Device context handle. */ PPOINTL pBox; /* Pointer to a BOXDATA structure: */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; /* High-order WORD=flags; low-order WORD=NGreBoxBoundary. */ LONG rc; rc = GreBoxBoundary(hdc, pBox, pInstance, lFunction);