diff dwt/widgets/TableColumn.d @ 213:36f5cb12e1a2

Update to SWT 3.4M7
author Frank Benoit <benoit@tionex.de>
date Sat, 17 May 2008 17:34:28 +0200
parents ab60f3309436
children ecb80b2a89e1
line wrap: on
line diff
--- a/dwt/widgets/TableColumn.d	Mon May 05 00:12:38 2008 +0200
+++ b/dwt/widgets/TableColumn.d	Sat May 17 17:34:28 2008 +0200
@@ -104,7 +104,10 @@
  * lists the style constants that are applicable to the class.
  * Style bits are also inherited from superclasses.
  * </p>
- *
+ * <p>
+ * Note that due to a restriction on some platforms, the first column
+ * is always left aligned.
+ * </p>
  * @param parent a composite control which will be the parent of the new instance (cannot be null)
  * @param style the style of control to construct
  * @param index the zero-relative index to store the receiver in its parent
@@ -387,8 +390,7 @@
         for (int i=0; i<count; i++) {
             TableItem item = parent.items [i];
             if (item !is null) {
-                auto hFont = item.cellFont !is null ? item.cellFont [index] : cast(HFONT)-1;
-                if (hFont is cast(HFONT)-1) hFont = item.font;
+                auto hFont = item.fontHandle (index);
                 if (hFont !is cast(HFONT)-1) hFont = OS.SelectObject (hDC, hFont);
                 Event event = parent.sendMeasureItemEvent (item, i, index, hDC);
                 if (hFont !is cast(HFONT)-1) hFont = OS.SelectObject (hDC, hFont);
@@ -544,7 +546,10 @@
  * Controls how text and images will be displayed in the receiver.
  * The argument should be one of <code>LEFT</code>, <code>RIGHT</code>
  * or <code>CENTER</code>.
- *
+ * <p>
+ * Note that due to a restriction on some platforms, the first column
+ * is always left aligned.
+ * </p>
  * @param alignment the new alignment
  *
  * @exception DWTException <ul>
@@ -702,10 +707,12 @@
             case DWT.UP:
                 hdItem.fmt &= ~(OS.HDF_IMAGE | OS.HDF_SORTDOWN);
                 hdItem.fmt |= OS.HDF_SORTUP;
+                if (image is null) hdItem.mask &= ~OS.HDI_IMAGE;
                 break;
             case DWT.DOWN:
                 hdItem.fmt &= ~(OS.HDF_IMAGE | OS.HDF_SORTUP);
                 hdItem.fmt |= OS.HDF_SORTDOWN;
+                if (image is null) hdItem.mask &= ~OS.HDI_IMAGE;
                 break;
             case DWT.NONE:
                 hdItem.fmt &= ~(OS.HDF_SORTUP | OS.HDF_SORTDOWN);
@@ -800,7 +807,7 @@
     * with spaces.
     */
     auto hHeap = OS.GetProcessHeap ();
-    TCHAR[] buffer = StrToTCHARs (parent.getCodePage (), fixMnemonic (string), true);
+    TCHAR[] buffer = StrToTCHARs (parent.getCodePage (), fixMnemonic (string, true), true);
     int byteCount = buffer.length * TCHAR.sizeof;
     auto pszText = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
     OS.MoveMemory (pszText, buffer.ptr, byteCount);