Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Strange behavior of gc.setForeground() and a table in Cocoa SWT
Strange behavior of gc.setForeground() and a table in Cocoa SWT [message #521316] Wed, 17 March 2010 09:06 Go to next message
Artem Redkin is currently offline Artem RedkinFriend
Messages: 26
Registered: July 2009
Junior Member
I have a table with FocusCellOwnerDrawHighlighter (custom version of it, to be precise), but on selection all text in cells, which have SWT.Right align, shifts to the right border:
http://picasaweb.google.ru/lh/photo/RL4JgyKfUQpax-6bOnYQSQ?f eat=directlink
http://picasaweb.google.ru/lh/photo/jJCjXk4bSD71WqHk0MrCNA?f eat=directlink

It seem that gc.setForeground(Color foreground) is causing this problem. Any hints or workarounds for this?
Re: Strange behavior of gc.setForeground() and a table in Cocoa SWT [message #521423 is a reply to message #521316] Wed, 17 March 2010 14:24 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi,

I see what you're describing, but don't know why gc.setForeground() would
affect the position of drawn text, are you sure that removing this call
makes the problem not appear? Are you able to provide a snippet that shows
the problem happening, or at least, your custom
FocusCellOwnerDrawHighlighter implementation?

Grant


"Artem Redkin" <artem@redkin.su> wrote in message
news:hnq62e$rvm$1@build.eclipse.org...
> I have a table with FocusCellOwnerDrawHighlighter (custom version of it,
to be precise), but on selection all text in cells, which have SWT.Right
align, shifts to the right border:
> http://picasaweb.google.ru/lh/photo/RL4JgyKfUQpax-6bOnYQSQ?f eat=directlink
> http://picasaweb.google.ru/lh/photo/jJCjXk4bSD71WqHk0MrCNA?f eat=directlink
>
> It seem that gc.setForeground(Color foreground) is causing this problem.
Any hints or workarounds for this?
Re: Strange behavior of gc.setForeground() and a table in Cocoa SWT [message #521576 is a reply to message #521423] Thu, 18 March 2010 07:25 Go to previous messageGo to next message
Artem Redkin is currently offline Artem RedkinFriend
Messages: 26
Registered: July 2009
Junior Member
Grant Gayed wrote on Wed, 17 March 2010 10:24
I see what you're describing, but don't know why gc.setForeground() would
affect the position of drawn text, are you sure that removing this call
makes the problem not appear? Are you able to provide a snippet that shows
the problem happening, or at least, your custom
FocusCellOwnerDrawHighlighter implementation?


You can download snippet from here:
http://dl.dropbox.com/u/2610519/TestTable.zip

4 classes there, fully illustrates the problem.
Re: Strange behavior of gc.setForeground() and a table in Cocoa SWT [message #522767 is a reply to message #521576] Tue, 23 March 2010 20:48 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi,

I've figured out what's happening and have released a fix to HEAD (
https://bugs.eclipse.org/bugs/show_bug.cgi?id=306877 ).

Believe it or not, a workaround you can use in the meantime is to set the
foreground for selected items to any Color != black.

Grant


"Artem Redkin" <artem@redkin.su> wrote in message
news:hnskhn$q64$1@build.eclipse.org...
> Grant Gayed wrote on Wed, 17 March 2010 10:24
> > I see what you're describing, but don't know why gc.setForeground()
would
> > affect the position of drawn text, are you sure that removing this call
> > makes the problem not appear? Are you able to provide a snippet that
shows
> > the problem happening, or at least, your custom
> > FocusCellOwnerDrawHighlighter implementation?
>
>
> You can download snippet from here:
> http://dl.dropbox.com/u/2610519/TestTable.zip
>
> 4 classes there, fully illustrates the problem.
>
Re: Strange behavior of gc.setForeground() and a table in Cocoa SWT [message #522833 is a reply to message #522767] Wed, 24 March 2010 07:05 Go to previous message
Artem Redkin is currently offline Artem RedkinFriend
Messages: 26
Registered: July 2009
Junior Member
Grant Gayed wrote on Tue, 23 March 2010 16:48
I've figured out what's happening and have released a fix to HEAD (
https://bugs.eclipse.org/bugs/show_bug.cgi?id=306877 ).

Believe it or not, a workaround you can use in the meantime is to set the
foreground for selected items to any Color != black.

Thanks again, Grant!
Previous Topic:ScrolledComposite scrolling in tiny steps if I click in the scroll bar
Next Topic:Label displayed Incorrectly in KDE/Gnome
Goto Forum:
  


Current Time: Wed Apr 24 20:37:59 GMT 2024

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

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

Back to the top