• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: drop location feedback in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: drop location feedback in NSTextView


  • Subject: Re: drop location feedback in NSTextView
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 4 Nov 2005 09:49:16 -0800


On Nov 3, 2005, at 2:31 PM, Ken Victor wrote:

i have a custom subclass of NSTextView. i have this because i have some strings that i wish to be treated as if they are a single character for purposes of selection, deletion, etc. its all working the way i want in all cases but one. the one problematic situation is the drop point feedback when dragging into my custom view. when dragging into my view, the drop location feedback cursor "happily" appears between characters of my special string when i don't want this.

i don't see how to change this and would appreciate some help.


I don't have a good solution for you--you could file a bug on this-- but I do have a possible workaround. In your NSTextView subclass, you could override draggingEntered: and draggingUpdated:, and in each case set a flag noting that you are within a dragging method. You could then subclass NSLayoutManager and make sure that your custom text view uses your custom layout manager.


In your NSLayoutManager subclass, override rectArrayForGlyphRange:withinSelectedGlyphRange:inTextContainer:rectCoun t:. If the flag noting that you are within a dragging method is not set, just call the super method. If the flag is set, however, check and see whether the two glyph range arguments describe a zero-length range inside one of your forbidden regions. If so, pick a different zero-length glyph range in the same text container, and call the super method with that for the two glyph range arguments instead.

Douglas Davidson

_______________________________________________
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


  • Follow-Ups:
    • Re: drop location feedback in NSTextView
      • From: Ken Victor <email@hidden>
References: 
 >drop location feedback in NSTextView (From: Ken Victor <email@hidden>)

  • Prev by Date: Re: Ad-hoc Core Data queries ?
  • Next by Date: Re: Ad-hoc Core Data queries ?
  • Previous by thread: Re: drop location feedback in NSTextView (2)
  • Next by thread: Re: drop location feedback in NSTextView
  • Index(es):
    • Date
    • Thread