| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
What I still don't get is at least what parameters do I have to "return" using SetEventParameter function to position the palette. From the name of the parameter, if kEventParamTextInputSendTextOffset is the one I need at minimum, how do I set the QD coordinates in typeLongInteger? You insert into the event any xxxReplyzzz parameters that are "required" (if the offset is valid) such as: kEventParamTextInputReplyPoint and insert any "optional" xxxReplyzzz parameters you desire, such as: kEventParamTextInputReplyFMFont (or kEventParamTextInputReplyFont with FMFontFamily/FOND) kEventParamTextInputReplyPointSize kEventParamTextInputReplyLineHeight kEventParamTextInputReplyLineAscent kEventParamTextInputReplyTextAngle Pseudocode: long sendOffset; status = GetEventParameter( inEvent, kEventParamTextInputSendTextOffset, typeLongInteger, NULL, sizeof(offset), NULL, &sendOffset ); if (fHaveInlineSession) { offset = fInlineSession.begin + sendOffset // offset is relative to beginning of inline session if (sendOffset < 0 || sendOffset >= fInlineSession.length) status = errOffsetInvalid; } else { offset = fSelectedTextRange.begin + sendOffset // If no selection, this means insertion-point relative offset if (offset < 0 || offset > fDocument.length) status = errOffsetInvalid; } require_noerr( status, OffsetToPosHandler_Fatal ); ATSUFontID fmFont; // or FMFont long fontSize; SInt16 lineHeight, ascent; thePt = MyCharToPos( offset, &ascent, &lineHeight, &fmFont, &fontSize ) // Required reply parameters thePt.v += lineHeight; // Push the point below our line, so the input method palette doesn't obscure the inline session status = SetEventParameter( inEvent, kEventParamTextInputReplyPoint, typeQDPoint, sizeof( Point ), &thePt ); // Optional reply parameters Fixed tempFixed = LongToFixed( fontSize ); status = SetEventParameter( inEvent, kEventParamTextInputReplyPointSize, typeFixed, sizeof( Fixed ), &tempFixed ); status = SetEventParameter( inEvent, kEventParamTextInputReplyLineHeight, typeShortInteger, sizeof( short ), &lineHeight ); status = SetEventParameter( inEvent, kEventParamTextInputReplyLineAscent, typeShortInteger, sizeof( short ), &ascent ); status = SetEventParameter( inEvent, kEventParamTextInputReplyFMFont, typeUInt32, sizeof( UInt32 ), &fmFont ); OffsetToPosHandler_Fatal: return status; how do I set the QD coordinates in typeLongInteger?You don't. The kEventParamTextInputReplyPoint event parameter is typed as typeQDPoint On Mar 30, 2005, at 8:46 AM, Norio Ota wrote:
|
_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden This email sent to email@hidden
| References: | |
| >Re: Text Service (From: Alexey Proskuryakov <email@hidden>) | |
| >Re: Text Service (From: Norio Ota <email@hidden>) | |
| >Re: Text Service (From: Michael Grady <email@hidden>) | |
| >Re: Text Service (From: Norio Ota <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.