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?



> Unfortunately, key filters are not Unicode saavy. That's why I
> suggested
> using a kEventTextInputUnicodeForKeyEvent handler, which is the
> recommended
> approach.

In this case the key filter doesn't have to be Unicode savvy. It
simply has to retrieve the unicode text from the control at each
keystroke and determine whether any more text can be added to the
string. It really doesn't care what the incomming keystroke's value
is.

> Note that a validation proc isn't called until after the text has been
> pasted. At best this means your application would be allowing a paste
> which
> has no effect, which as user experiences go is less than ideal. Better
> to
> disable the Paste command if you don't want to allow pasting of what's
> on
> the Clipboard.

I couldn't disagree more. Disabling the paste command is far more
restrictive than allowing the paste. The user who knows that the text
field can only hold five characters should still be given the option of
copying and pasting five characters into the field. Good user
interface design considerations would allow the user to paste and, in
the case of an error, explain why the paste is invalid. Perhaps the
resulting dialog could offering the user the option of truncating the
pasted text to the desired length.

--
Macintosh Software Engineering Consulting Services
Visit my resume at <http://homepage.mac.com/easco/RSTResume.html>

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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: Laurence Harris <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.