Re: NSTextView and -smartInsertForString:replacingRange:beforeString:afterString:
Re: NSTextView and -smartInsertForString:replacingRange:beforeString:afterString:
- Subject: Re: NSTextView and -smartInsertForString:replacingRange:beforeString:afterString:
- From: "Timothy J. Wood" <email@hidden>
- Date: Thu, 6 Oct 2005 11:31:14 -0700
This doesn't answer your question exactly, but some research I did
on this yielded some info...
NSTextView puts a special marker type on the pasteboard ("NeXT
smart paste pasteboard type") when the source of the copy was
produced by word or paragraph selection (i.e., you double or triple
clicked in the source text field instead of a plain click-drag). In
its pasteboard reading code, it seems to check for this and then use
the 'smart' paste. This extra data seems to hold no data; it's just
a marker that you should do a smart paste.
Sadly, none of this seems particularly public.
-tim
On Oct 6, 2005, at 11:27 AM, Sean Todd wrote:
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
_______________________________________________
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