Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Combo look-and-feel on Windows 7
Combo look-and-feel on Windows 7 [message #653610] Thu, 10 February 2011 12:02 Go to next message
Roel De Nijs is currently offline Roel De NijsFriend
Messages: 28
Registered: March 2010
Junior Member
Hi all,

In our RCP application we set the background of a combo to let the user know it is a required field. When running this application on Windows XP the background of the text-area of the combo is rendered in blue.
When we run this application on a Windows 7 the background of this text-area is rendered in some grey color. When the combo list is shown the background of the list is still in blue. But because of this grey color the user can't see anymore if this field is required or not.

I tried running our application with both Eclipse 3.5 and Eclipse 3.6 SR1, but the look-and-feel of the combo is the same. So I guess (and fear) this new look is the new style of a combo in Windows 7. It's quiet an important part of the user experience of our application, so it would be great if this grey color can be changed back to blue on Windows 7.

Any suggestions / ideas are highly appreciated.

Thanks!
Kind regards,
Roel
Re: Combo look-and-feel on Windows 7 [message #654649 is a reply to message #653610] Wed, 16 February 2011 15:01 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi Roel,

I tried setting a Combo's background to blue on Windows 7 and I didn't see
an obvious behavioural difference from XP. Does this problem happen for you
regardless of the background colour you choose? Are you using the default
Windows 7 theme? Can you provide a screenshot showing the problem?

Grant


"Roel De Nijs" <roel@javaroe.be> wrote in message
news:ij0jo9$res$1@news.eclipse.org...
> Hi all,
>
> In our RCP application we set the background of a combo to let the user
> know it is a required field. When running this application on Windows XP
> the background of the text-area of the combo is rendered in blue.
> When we run this application on a Windows 7 the background of this
> text-area is rendered in some grey color. When the combo list is shown the
> background of the list is still in blue. But because of this grey color
> the user can't see anymore if this field is required or not.
>
> I tried running our application with both Eclipse 3.5 and Eclipse 3.6 SR1,
> but the look-and-feel of the combo is the same. So I guess (and fear) this
> new look is the new style of a combo in Windows 7. It's quiet an important
> part of the user experience of our application, so it would be great if
> this grey color can be changed back to blue on Windows 7.
> Any suggestions / ideas are highly appreciated.
>
> Thanks!
> Kind regards,
> Roel
Re: Combo look-and-feel on Windows 7 [message #654793 is a reply to message #653610] Thu, 17 February 2011 07:59 Go to previous messageGo to next message
Roel De Nijs is currently offline Roel De NijsFriend
Messages: 28
Registered: March 2010
Junior Member
Hi Grant,

I used following small code snippet to test the combo's behavior:
public class ComboTest {
	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setText("ComboTest");
		shell.setLayout(new FillLayout(SWT.VERTICAL));

		new Text(shell, SWT.SINGLE);

		Combo combo = new Combo(shell, SWT.READ_ONLY);
		combo.setItems(new String[] { "A", "B", "C" });
		combo.setBackground(new Color(display, 153, 186, 243));

		shell.pack();
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
}


I don't see any possibility to attach some files to this topic, so I guess it's not allowed to add files to this forum (according to the help pages).

I executed this program on a Windows XP and a Windows 7 machine and took some screenshots to show the difference.

1. WinXP with XP Theme
http://www.javaroe.be/winxp-theme-xp.jpg

2. WinXP with Classic Theme
http://www.javaroe.be/winxp-theme-classic.jpg

3. Win7 with Win7 Basic Theme
http://www.javaroe.be/win7-theme-win7-basic.jpg

4. Win7 with Windows Classic Theme
http://www.javaroe.be/win7-theme-win-classic.jpg

As you can see the combo looks different on a Win7 with Win7 basic theme (see 3rd screenshot) and the user can't see the blue-ish color (which in our application is the color to indicate a mandatory field).

I ran the code snippet with both Eclipse 3.5 (sr2) and 3.6 (sr1) and the results are the same. I also tried with a different color, but again similar results.

Kind regards,
Roel
Re: Combo look-and-feel on Windows 7 [message #654904 is a reply to message #654793] Thu, 17 February 2011 14:56 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
I see, this is for read-only Combos. This is a behaviour that comes from
the theme, so it's "correct" (see "hint" in the javadoc for
Control.setBackground()). It's not something that swt would change, and
quite possibly could not override anyways. I don't know of a workaround to
suggest to make this work, other than to change your visual cue for marking
a control as being "required".

Grant


"Roel De Nijs" <roel@javaroe.be> wrote in message
news:ijik5k$jq9$1@news.eclipse.org...
> Hi Grant,
>
> I used following small code snippet to test the combo's behavior:
> public class ComboTest {
> public static void main(String[] args) {
> Display display = new Display();
> Shell shell = new Shell(display);
> shell.setText("ComboTest");
> shell.setLayout(new FillLayout(SWT.VERTICAL));
>
> new Text(shell, SWT.SINGLE);
>
> Combo combo = new Combo(shell, SWT.READ_ONLY);
> combo.setItems(new String[] { "A", "B", "C" });
> combo.setBackground(new Color(display, 153, 186, 243));
>
> shell.pack();
> shell.open();
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch())
> display.sleep();
> }
> display.dispose();
> }
> }
>
>
> I don't see any possibility to attach some files to this topic, so I guess
> it's not allowed to add files to this forum (according to the help pages).
>
> I executed this program on a Windows XP and a Windows 7 machine and took
> some screenshots to show the difference.
>
> 1. WinXP with XP Theme
>
>
> 2. WinXP with Classic Theme
>
>
> 3. Win7 with Win7 Basic Theme
>
>
> 4. Win7 with Windows Classic Theme
>
>
> As you can see the combo looks different on a Win7 with Win7 basic theme
> (see 3rd screenshot) and the user can't see the blue-ish color (which in
> our application is the color to indicate a mandatory field).
>
> I ran the code snippet with both Eclipse 3.5 (sr2) and 3.6 (sr1) and the
> results are the same. I also tried with a different color, but again
> similar results.
>
> Kind regards,
> Roel
Re: Combo look-and-feel on Windows 7 [message #654964 is a reply to message #653610] Thu, 17 February 2011 19:07 Go to previous messageGo to next message
Roel De Nijs is currently offline Roel De NijsFriend
Messages: 28
Registered: March 2010
Junior Member
Thanks for confirming this behavior for read-only combos. No need to look further into overriding this behavior.

Do you know if it is possible to simulate the behavior of a read-only combo without using the style constant SWT.READ_ONLY ? So the user should only be able to select 1 item in the drop down list, without being able to enter an item himself.
I guess using the style constant SWT.DROP_DOWN could be an alternative, if it is possible to make it non-editable.

Roel
Re: Combo look-and-feel on Windows 7 [message #655064 is a reply to message #653610] Fri, 18 February 2011 08:47 Go to previous messageGo to next message
Roel De Nijs is currently offline Roel De NijsFriend
Messages: 28
Registered: March 2010
Junior Member
We'll use CCombo to emulate a combo's behavior. It's almost as good as a native one with a big plus: the background of the ccombo (the text field) has the correct background color (even on a Windows 7 machine).

Just 2 (minor) issues in comparison with a native combo:
* because a text field is used for the emulation, it seems you can enter some text in the text field (but you can't if you use READ_ONLY style)
* with a native combo you can enter the first letter of an item and the combo will select this item, with a ccombo you can't

But we prefer showing the correct background color above these issues, so CCombo is the obvious choice (unless you would know of some big troubles using this control)

Thanks!
Roel

[Updated on: Fri, 18 February 2011 08:48]

Report message to a moderator

Re: Combo look-and-feel on Windows 7 [message #655177 is a reply to message #655064] Fri, 18 February 2011 14:59 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
No, there shouldn't be a problem with using CCombo, I should have thought of
this as an alternate suggestion.

Grant


"Roel De Nijs" <roel@javaroe.be> wrote in message
news:ijlbbb$mjb$1@news.eclipse.org...
> We'll use CCombo to emulate a combo's behavior. It's almost as good as a
> native one with a big plus: the background of the ccombo (the text field)
> has the correct background color (even on a Windows 7 machine).
>
> Just 2 (minor) issues in comparison with a native combo:
>
> because a text field is used for the emulation, it seems you can enter
> some text in the text field (but you can't if you use READ_ONLY style)
> with a native combo you can enter the first letter of an item and the
> combo will select this item, with a ccombo you can't
>
> But we prefer showing the correct background color above these issues, so
> CCombo is the obvious choice (unless you would know of some big troubles
> using this control)
>
> Thanks!
Re: Combo look-and-feel on Windows 7 [message #655209 is a reply to message #655177] Fri, 18 February 2011 16:32 Go to previous message
Roel De Nijs is currently offline Roel De NijsFriend
Messages: 28
Registered: March 2010
Junior Member
Thanks, Grant!
Previous Topic:Cannot remove first item when using TableEditor and Table.Remove(0) is used
Next Topic:mouseDown/widgetSelected/mouseUp behavior
Goto Forum:
  


Current Time: Sat Apr 20 02:59:46 GMT 2024

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

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

Back to the top