summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
diff options
context:
space:
mode:
authorSteve Northover <steve>2005-10-28 19:23:05 +0000
committerSteve Northover <steve>2005-10-28 19:23:05 +0000
commite38d4aec3f79c42ea6666a7a37c026187a8aa6ea (patch)
tree88f34e7cad76263c1d87c17fa20c1eee6a11d4fc /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
parentc63ca636edfbea4cd55ccc07da414186be375ce0 (diff)
downloadeclipse.platform.swt-e38d4aec3f79c42ea6666a7a37c026187a8aa6ea.tar.gz
eclipse.platform.swt-e38d4aec3f79c42ea6666a7a37c026187a8aa6ea.tar.xz
eclipse.platform.swt-e38d4aec3f79c42ea6666a7a37c026187a8aa6ea.zip
29994 - Image background Composite / Transparent widget backgrounds (/*public*/)
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java29
1 files changed, 27 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
index beb13d05f7..f23ba34598 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
@@ -240,6 +240,27 @@ void createHandle () {
}
}
+/*public*/ void drawBackground (GC gc, int id, int x, int y, int width, int height) {
+ checkWidget ();
+ if (gc == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (gc.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ int pixel = -1;
+ switch (id) {
+ case SWT.COLOR_LIST_BACKGROUND:
+ pixel = OS.GetSysColor (OS.COLOR_WINDOW);
+ break;
+ case SWT.COLOR_INFO_BACKGROUND:
+ pixel = OS.GetSysColor (OS.COLOR_INFOBK);
+ break;
+ case SWT.COLOR_WIDGET_BACKGROUND:
+ pixel = OS.GetSysColor (OS.COLOR_3DFACE);
+ break;
+ }
+ RECT rect = new RECT ();
+ OS.SetRect (rect, x, y, x + width, y + height);
+ drawBackground (gc.handle, rect, pixel);
+}
+
Composite findDeferredControl () {
return layoutCount > 0 ? this : parent.findDeferredControl ();
}
@@ -1292,8 +1313,12 @@ LRESULT WM_SIZE (int wParam, int lParam) {
}
}
}
- if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {
- if (findThemeControl () != null) redrawChildren ();
+ if (backgroundImage != null) {
+ redrawChildren ();
+ } else {
+ if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {
+ if (findThemeControl () != null) redrawChildren ();
+ }
}
}