ADC Home > Reference Library > Technical Q&As > Carbon > Human Interface Toolbox >
|
Q: Is there anyway I can have parameters of type typeHIRect instead of type typeQDRectangle in my kEventControlBoundsChanged message handler so that I don't have to convert all the time? A: As a matter of fact, you can, even though it's not been documented yet in the headers. An automatic conversion occurs for the new type typeHIRect introduced in Mac OS X 10.2 (aka Jaguar) so all the Carbon Event message handlers which are getting or setting parameters of type typeQDRectangle (kEventControlGetOptimalBounds, kEventControlGetPartBounds, etc.) can be asked for type typeHIRect instead (and vice versa). If you had the following code:
you can now write instead:
and you don't need to do the conversion between Rect and HIRect yourself. Another automatic conversion occurs as well between the types typeQDPoint and typeHIPoint, and, in addition, if a CFBoolean type is added to an event, a request to receive the data as typeBoolean (instead of typeCFType), will be automatically honored [Apr 03, 2003] |
|