Skip to main content



      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 11:19
Eclipse UserFriend
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: Sat Jul 05 02:18:07 EDT 2025

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

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

Back to the top