Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Set max chars for Unicode Edit Text control?



On 7/26/04 12:45 AM, Manfred Schubert didst favor us with:

> Am 26.07.2004 um 05:53 schrieb Scott Thompson:
>
>> First, you might want to provide your control with a key filter using
>> the kControlKeyFilterTag with SetControlData. The Key Filter tag will
>> allow you to access the contents of the control as each key is pressed.
>> You have the ability to accept, or reject, keystrokes using that
>> filter. Next, you will probably want a validation proc (using
>> kControlEditTextValidationProcTag). This procedure can be used to
>> validate the contents of the field when data is pasted into the
>> control.
>
> I tried Laurence' suggestion installing an
> kEventTextInputUnicodeForKeyEvent handler, but it failed for Japanese.
> I have to try your suggestion.

Failed in what way? How exactly do you want to limit the text? I quote from
part of a message posted here a long time ago (this has been discussed many
times) by someone at Apple:

> Since how to filter data with MLTE objects is a common question, we have
> put together some sample code (written by John Harvey) to illustrate
> filtering text when using a EditUnicodeTextControl. It shows how to
> filter text coming as kEventTextInputUnicodeForKeyEvent event (keyboard)
> as well as a kEventTextInputActiveInputArea event (input method).

A kEventTextInputUnicodeForKeyEvent handler is the recommended approach for
filtering text input, so if it isn't working for you there may be something
wrong in your code.

Larry
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: Set max chars for Unicode Edit Text control? (From: Manfred Schubert <email@hidden>)



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.