• 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: How is "Apple + Ctrl + D" implemented?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How is "Apple + Ctrl + D" implemented?


  • Subject: Re: How is "Apple + Ctrl + D" implemented?
  • From: John Stiles <email@hidden>
  • Date: Tue, 29 Apr 2008 13:36:57 -0700

Man, what a bummer. I wish you had been around when I asked the question before :)

Keith Blount wrote:
Really? Does this actually work?
I needed to find word boundaries to implement a Find panel which supports searching for "Whole Words" and I ended up using UCFindTextBreak based on advice from this list. It was a pain to implement (since it's not designed to mesh with Cocoa at all).

Yes, it works. I had to implement my own Find panel for various reasons, too, and I used -selectionRangeForProposedRange: for exactly that: NSRangewordRange = [text selectionRangeForProposedRange:foundRange granularity:NSSelectByWord]; if(tag == FindTypeContains) searchSuccess = YES; else if ( (tag == FindTypeWholeWord) && (NSEqualRanges(foundRange,wordRange)) ) searchSuccess = YES; else if ( (tag == FindTypeStartsWith) && (foundRange.location == wordRange.location) ) searchSuccess = YES; else if ( (tag == FindTypeEndsWith) && (NSMaxRange(foundRange) == NSMaxRange(wordRange)) ) searchSuccess = YES;

Best,
Keith


____________________________________________________________________________________
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: How is "Apple + Ctrl + D" implemented? (From: Keith Blount <email@hidden>)

  • Prev by Date: Re: Immediate memory release
  • Next by Date: Re: How to adopt a superclass's protocol?
  • Previous by thread: Re: How is "Apple + Ctrl + D" implemented?
  • Next by thread: Another question about Disabling Energy Saving mode
  • Index(es):
    • Date
    • Thread