summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine <veronika>2004-02-12 18:55:34 +0000
committerVeronika Irvine <veronika>2004-02-12 18:55:34 +0000
commit24fd1d065de6ab451b31c68e1c1e1ba56b21a381 (patch)
treef43910872f529a84cec51f6e24d2142406c89a4f
parent37654c9652264af637ed812fcc540515a702247e (diff)
downloadeclipse.platform.swt-24fd1d065de6ab451b31c68e1c1e1ba56b21a381.tar.gz
eclipse.platform.swt-24fd1d065de6ab451b31c68e1c1e1ba56b21a381.tar.xz
eclipse.platform.swt-24fd1d065de6ab451b31c68e1c1e1ba56b21a381.zip
font for selected item
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java15
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java6
2 files changed, 10 insertions, 11 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
index e6c421bb67..02719bf3e5 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
@@ -1887,15 +1887,14 @@ LRESULT wmNotifyChild (int wParam, int lParam) {
tvItem.mask = OS.TVIF_STATE;
tvItem.hItem = item.handle;
OS.SendMessage (handle, OS.TVM_GETITEM, 0, tvItem);
- if ((tvItem.state & OS.TVIS_SELECTED) != 0) break;
- int font = item.font;
- int clrText = item.foreground, clrTextBk = item.background;
- if (font == -1 && clrText == -1 && clrTextBk == -1) break;
- nmcd.clrText = clrText == -1 ? getForegroundPixel () : clrText;
- nmcd.clrTextBk = clrTextBk == -1 ? getBackgroundPixel () : clrTextBk;
+ int hFont = item.font, clrText = item.foreground, clrTextBk = item.background;
+ if (hFont == -1 && clrText == -1 && clrTextBk == -1) break;
+ if (hFont != -1) OS.SelectObject (nmcd.hdc, hFont);
+ if ((tvItem.state & OS.TVIS_SELECTED) == 0) {
+ nmcd.clrText = clrText == -1 ? getForegroundPixel () : clrText;
+ nmcd.clrTextBk = clrTextBk == -1 ? getBackgroundPixel () : clrTextBk;
+ }
OS.MoveMemory (lParam, nmcd, NMTVCUSTOMDRAW.sizeof);
- if (font == -1) font = getFont ().handle;
- OS.SelectObject(nmcd.hdc, font);
return new LRESULT (OS.CDRF_NEWFONT);
}
break;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java
index 8024df435a..497ebc0e8e 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java
@@ -607,12 +607,12 @@ public void setFont (Font font){
if (font != null && font.isDisposed ()) {
SWT.error (SWT.ERROR_INVALID_ARGUMENT);
}
- int newFont = -1;
+ int hFont = -1;
if (font != null) {
parent.customDraw = true;
- newFont = font.handle;
+ hFont = font.handle;
}
- this.font = newFont;
+ this.font = hFont;
redraw ();
}