summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java
diff options
context:
space:
mode:
authorSteve Northover <steve>2006-03-29 18:19:19 +0000
committerSteve Northover <steve>2006-03-29 18:19:19 +0000
commit8dbb340b3196dde91c1c2e1eb201d4f5aef78dcb (patch)
tree3a09e7250402224a0cfa97f02583e428319f0150 /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java
parentbd2095446116874d9600a932f55f259a8835f96f (diff)
downloadeclipse.platform.swt-8dbb340b3196dde91c1c2e1eb201d4f5aef78dcb.tar.gz
eclipse.platform.swt-8dbb340b3196dde91c1c2e1eb201d4f5aef78dcb.tar.xz
eclipse.platform.swt-8dbb340b3196dde91c1c2e1eb201d4f5aef78dcb.zip
133756 - Regression in SWT.Label
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java
index 40e76b79a3..5b2b05bb29 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java
@@ -380,7 +380,7 @@ public void setText (String string) {
if ((style & SWT.WRAP) != 0) {
newBits |= OS.SS_LEFT;
} else {
- newBits |= OS.SS_LEFTNOWORDWRAP;
+ newBits |= OS.SS_LEFTNOWORDWRAP;
}
}
if ((style & SWT.CENTER) != 0) newBits |= OS.SS_CENTER;
@@ -390,6 +390,17 @@ public void setText (String string) {
string = Display.withCrLf (string);
TCHAR buffer = new TCHAR (getCodePage (), string, true);
OS.SetWindowText (handle, buffer);
+ /*
+ * Bug in Windows. For some reason, the HBRUSH that
+ * is returned from WM_CTRLCOLOR is misaligned when
+ * the label uses it to draw. If the brush is a solid
+ * color, this does not matter. However, if the brush
+ * contains an image, the image is misaligned. The
+ * fix is to draw the background in WM_ERASEBKGND.
+ */
+ if (OS.COMCTL32_MAJOR < 6 || !OS.IsAppThemed ()) {
+ if (findImageControl () != null) OS.InvalidateRect (handle, null, true);
+ }
}
int widgetExtStyle () {