Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Drawing focus ring on mac
Drawing focus ring on mac [message #492402] Tue, 20 October 2009 11:05 Go to next message
Artem Redkin is currently offline Artem RedkinFriend
Messages: 26
Registered: July 2009
Junior Member
I have custom control, a composite with borderless text field and an image. This composite has a print listener, which draws text frame around text field and image. The problem is, that focus ring is not drawn outside this composite:
http://picasaweb.google.com/lh/photo/GVMtRQpYUiZwBeQBWmNIGA? feat=directlink
On the left is my control, on the right - focused text field.

Can i draw outside this composite without invoking new GC on this composite's parent?
Re: Drawing focus ring on mac [message #492770 is a reply to message #492402] Wed, 21 October 2009 16:06 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi,

The GC in the PaintEvent you get is created on your control, so there's no
way to extend its clipping beyond the Control's bounds.

The only suggestion I can think of is to give your custom control an
additional parent Composite that is larger than your control by a few pixels
in each direction, and when the parent Composite gets a Paint event then it
can draw the border on itself if appropriate.

HTH,
Grant


"Artem Redkin" <artem@redkin.su> wrote in message
news:hbk5hl$jic$1@build.eclipse.org...
> I have custom control, a composite with borderless text field and an
image. This composite has a print listener, which draws text frame around
text field and image. The problem is, that focus ring is not drawn outside
this composite:
>
http://picasaweb.google.com/lh/photo/GVMtRQpYUiZwBeQBWmNIGA? feat=directlink
> On the left is my control, on the right - focused text field.
>
> Can i draw outside this composite without invoking new GC on this
composite's parent?
Re: Drawing focus ring on mac [message #492936 is a reply to message #492770] Thu, 22 October 2009 12:25 Go to previous message
Artem Redkin is currently offline Artem RedkinFriend
Messages: 26
Registered: July 2009
Junior Member
Thanks.
Previous Topic:SWT.Deactivate in Eclipse 3.4
Next Topic:Editable Text to fill scrolled composite, but not expand it?
Goto Forum:
  


Current Time: Sat Apr 20 01:18:42 GMT 2024

Powered by FUDForum. Page generated in 0.03166 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top