NSTextView and -smartInsertForString:replacingRange:beforeString:afterString:
NSTextView and -smartInsertForString:replacingRange:beforeString:afterString:
- Subject: NSTextView and -smartInsertForString:replacingRange:beforeString:afterString:
- From: Sean Todd <email@hidden>
- Date: Thu, 6 Oct 2005 13:27:36 -0500
While implementing drag-n-drop text fields I noticed that
NSTextView's -
smartInsertForString:replacingRange:beforeString:afterString: does
not follow Apple's HIG for intelligent cut and paste rules.
The HIG for drop feedback of text states:
"Drag-and-drop operations involving text should support intelligent
cut-and-paste rules, as explained in "Intelligent Cut and Paste."
The HIG for intelligent cut and paste states:
"When the user chooses Paste, if the character to the left or right
of the current selection is part of a word (but not inside a word),
insert a space before pasting."
If you use -
smartInsertForString:replacingRange:beforeString:afterString: to drop
(or paste) the text, it results in spaces inserted before and after
the dropped text even if the insertion point was in the middle of a
word.
You can see this sort of behavior in action with XCode and the search
field of a project window. Just type some word in the search field,
then drag some other text and drop it in the middle of the word in
the search field.
So, should I follow the HIG or use -
smartInsertForString:replacingRange:beforeString:afterString:? Is
this a case of the guidelines not being kept up-to-date or of Cocoa
not following the guidelines?
Thanks for any advice.
Sean
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden