Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 171774 Details for
Bug 316662
CCombo: allow setting background of Text and List individually
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch
CCombo_patch.txt (text/plain), 3.71 KB, created by
Elias Volanakis
on 2010-06-11 19:01:12 EDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Elias Volanakis
Created:
2010-06-11 19:01:12 EDT
Size:
3.71 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.swt >Index: Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java,v >retrieving revision 1.139 >diff -u -r1.139 CCombo.java >--- Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java 31 May 2010 16:44:12 -0000 1.139 >+++ Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java 11 Jun 2010 21:50:36 -0000 >@@ -54,7 +54,7 @@ > Button arrow; > boolean hasFocus; > Listener listener, filter; >- Color foreground, background; >+ Color listForeground, listBackground; > Font font; > Shell _shell; > >@@ -467,8 +467,8 @@ > if ((style & SWT.LEFT_TO_RIGHT) != 0) listStyle |= SWT.LEFT_TO_RIGHT; > list = new List (popup, listStyle); > if (font != null) list.setFont (font); >- if (foreground != null) list.setForeground (foreground); >- if (background != null) list.setBackground (background); >+ if (listForeground != null) list.setForeground (listForeground); >+ if (listBackground != null) list.setBackground (listBackground); > > int [] popupEvents = {SWT.Close, SWT.Paint, SWT.Deactivate}; > for (int i=0; i<popupEvents.length; i++) popup.addListener (popupEvents [i], listener); >@@ -1400,12 +1400,56 @@ > } > public void setBackground (Color color) { > super.setBackground(color); >- background = color; >+ setTextBackground(color); >+ setListBackground(color); >+} >+/** >+ * Sets the text widget's background color to the color specified >+ * by the argument, or to the default system color for the control >+ * if the argument is null. >+ * <p> >+ * Note: This operation is a hint and may be overridden by the platform. >+ * For example, on Windows the background of a Button cannot be changed. >+ * </p> >+ * @param color the new color (or null) >+ * >+ * @exception IllegalArgumentException <ul> >+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> >+ * </ul> >+ * @exception SWTException <ul> >+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> >+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> >+ * </ul> >+ * @since 3.7 >+ */ >+public void setTextBackground(Color color) { > if (text != null) text.setBackground(color); >- if (list != null) list.setBackground(color); > if (arrow != null) arrow.setBackground(color); > } > /** >+ * Sets the list widget's background color to the color specified >+ * by the argument, or to the default system color for the control >+ * if the argument is null. >+ * <p> >+ * Note: This operation is a hint and may be overridden by the platform. >+ * For example, on Windows the background of a Button cannot be changed. >+ * </p> >+ * @param color the new color (or null) >+ * >+ * @exception IllegalArgumentException <ul> >+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> >+ * </ul> >+ * @exception SWTException <ul> >+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> >+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> >+ * </ul> >+ * @since 3.7 >+ */ >+public void setListBackground(Color color) { >+ listBackground = color; >+ if (list != null) list.setBackground(color); >+} >+/** > * Sets the editable state. > * > * @param editable the new editable state >@@ -1442,7 +1486,7 @@ > } > public void setForeground (Color color) { > super.setForeground(color); >- foreground = color; >+ listForeground = color; > if (text != null) text.setForeground(color); > if (list != null) list.setForeground(color); > if (arrow != null) arrow.setForeground(color);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 316662
: 171774