• 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: Determining underline style and mask?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining underline style and mask?


  • Subject: Re: Determining underline style and mask?
  • From: Martin Wierschin <email@hidden>
  • Date: Mon, 23 Apr 2007 16:34:11 -0700

int underlineStyle = NSUnderlineStyleSingle |
NSUnderlineByWordMask;

	BOOL isSingle = (underlineStyle &
NSUnderlineStyleSingle) == NSUnderlineStyleSingle;
	BOOL isDouble = (underlineStyle &
NSUnderlineStyleDouble) == NSUnderlineStyleDouble;
	BOOL byWord = (underlineStyle &
NSUnderlineByWordMask) == NSUnderlineByWordMask;

Returns non-zero for everything.

The trouble you are experiencing is that the double underline mask includes the single underline bit. What you're after is:


BOOL isDouble = (NSUnderlineStyleDouble == (style & NSUnderlineStyleDouble));
BOOL isSingle = (! isDouble) && (NSUnderlineStyleSingle == (style & NSUnderlineStyleSingle));
BOOL isByWord = (0 != (style & NSUnderlineByWordMask));


~Martin
	



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >Determining underline style and mask? (From: Keith Blount <email@hidden>)

  • Prev by Date: Re: SetSystemUIMode disabling Exposé hotkeys
  • Next by Date: EPSOperationWithView toPath not working
  • Previous by thread: Determining underline style and mask?
  • Next by thread: Correct way to create a subview at runtime
  • Index(es):
    • Date
    • Thread