• 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
[FIXED] Re: Focus ring not displaying while editing custom split NSCell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FIXED] Re: Focus ring not displaying while editing custom split NSCell


  • Subject: [FIXED] Re: Focus ring not displaying while editing custom split NSCell
  • From: "Brad Willoughby" <email@hidden>
  • Date: Tue, 15 May 2007 09:39:05 -0700

Thanks to I.S., Steve, and Kevin for responding on list and bwebster
for replying on #macsb, I managed to make this work.

Getting the text to not over-type on the existing text was simply a
matter of implementing the following in my NSCell subclass:
- (void)setDrawsBackground:(BOOL)flag {
	[[self timeTextFieldCell] setDrawsBackground:flag];
	[[self nameTextFieldCell] setDrawsBackground:flag];
}

After that, getting the focus ring to draw properly was accomplished
within drawWithFrame by determining which subcell was being edited and
then doing:
	[NSGraphicsContext saveGraphicsState];
	NSSetFocusRingStyle(NSFocusRingOnly);
	[[NSBezierPath bezierPathWithRect:focusRingFrame] fill];
	[NSGraphicsContext restoreGraphicsState];

Also, for the record, it was suggested off-list that I move to using
to individual NSTextFieldCells in two columns instead of cramming two
subcells into one column.  This avoids these drawing problems as well
as keyboard navigation/focus problems.  I'll look into modifying our
UI to make this happen.

Thanks for the help.
Cheers,
Brad
_______________________________________________

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: 
 >Focus ring not displaying while editing custom split NSCell (From: "Brad Willoughby" <email@hidden>)
 >Re: Focus ring not displaying while editing custom split NSCell (From: "Brad Willoughby" <email@hidden>)
 >Re: Focus ring not displaying while editing custom split NSCell (From: "I. Savant" <email@hidden>)
 >Re: Focus ring not displaying while editing custom split NSCell (From: "Brad Willoughby" <email@hidden>)

  • Prev by Date: Re: NSDictionary valueForKey: and @ character at start of NSString
  • Next by Date: Re: NSDictionary valueForKey: and @ character at start of NSString
  • Previous by thread: Re: Focus ring not displaying while editing custom split NSCell
  • Next by thread: Re: Focus ring not displaying while editing custom split NSCell
  • Index(es):
    • Date
    • Thread