Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » High contrast mode setting for textbox in a jface dialog
High contrast mode setting for textbox in a jface dialog [message #673420] Mon, 23 May 2011 15:19
Ravi  is currently offline Ravi Friend
Messages: 4
Registered: May 2011
Junior Member
Hello,

I have SWT Text box in a JFace Dialog along with other controls like buttons and tableviewer. In normal mode, if I don't set the background, the text box defaults to gray looking as if it is a read-only field. I changed it to white. But, in a high contrast mode, both the text and background become white making the text non-readable (unless highlighted).

I tried 2 things that worked:
1) if ( !parent.getDisplay().getHighContrast() )
text.setbackground(white);

2) text.setbackground( parent.getDisplay().getSystemColor( SWT.COLOR_LIST_BACKGROUND ));
text.setForeground( parent.getDisplay().getSystemColor( SWT.COLOR_LIST_FOREGROUND ));
What are the COLOR_LIST_XXX constants meant for?

I want to know what is the coding practice to create such UI that works in both normal and high contrast mode. There isn't much text available around.

Thanks in advance,
Ravi
Previous Topic:Is there a committer I can forward an update to?
Next Topic:Creating an email-recipient like widget
Goto Forum:
  


Current Time: Thu Jul 09 09:50:36 GMT 2020

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

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

Back to the top