diff options
author | Steve Northover <steve> | 2006-03-29 18:19:19 +0000 |
---|---|---|
committer | Steve Northover <steve> | 2006-03-29 18:19:19 +0000 |
commit | 8dbb340b3196dde91c1c2e1eb201d4f5aef78dcb (patch) | |
tree | 3a09e7250402224a0cfa97f02583e428319f0150 /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java | |
parent | bd2095446116874d9600a932f55f259a8835f96f (diff) | |
download | eclipse.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-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java | 13 |
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 () { |