summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java
diff options
context:
space:
mode:
authorSteve Northover <steve>2006-02-02 19:49:34 +0000
committerSteve Northover <steve>2006-02-02 19:49:34 +0000
commite51b9d108a5cb44078400862e751bdfdba7ca232 (patch)
tree47e1d21c17e1a56f779cc9e7a9b304dbf792809c /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java
parenta684de6a853311f231dc5eb8652028641d8f98a4 (diff)
downloadeclipse.platform.swt-e51b9d108a5cb44078400862e751bdfdba7ca232.tar.gz
eclipse.platform.swt-e51b9d108a5cb44078400862e751bdfdba7ca232.tar.xz
eclipse.platform.swt-e51b9d108a5cb44078400862e751bdfdba7ca232.zip
pack() doesn't take into account cell font for anything but the first column
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java
index 55621197e8..d1709fd4dc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java
@@ -340,6 +340,9 @@ public void pack () {
OS.SendMessage (hwnd, OS.TVM_GETITEM, 0, tvItem);
TreeItem item = tvItem.lParam != -1 ? parent.items [tvItem.lParam] : null;
if (item != null) {
+ int newWidth = 0, hFont = -1;
+ if (item.cellFont != null) hFont = item.cellFont [index];
+ if (hFont == -1) hFont = item.font;
if (index == 0) {
if ((parent.style & SWT.VIRTUAL) == 0 && !item.cached && !parent.painted) {
tvItem.mask = OS.TVIF_HANDLE | OS.TVIF_TEXT;
@@ -361,7 +364,9 @@ public void pack () {
String string = item.strings != null ? item.strings [index] : null;
if (string != null) {
TCHAR buffer = new TCHAR (cp, string, false);
+ if (hFont != -1) hFont = OS.SelectObject (hDC, hFont);
OS.DrawText (hDC, buffer, buffer.length (), rect, flags);
+ if (hFont != -1) OS.SelectObject (hDC, hFont);
textWidth = rect.right - rect.left;
}
columnWidth = Math.max (columnWidth, imageWidth + textWidth + Tree.INSET * 3);