comparison org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Tree.d @ 38:2e09b0e6857a

work on phobosfication
author Frank Benoit <benoit@tionex.de>
date Wed, 25 Mar 2009 11:18:25 +0100
parents 6dd524f61e62
children 9f4c18c268b2
comparison
equal deleted inserted replaced
37:46c5f8f56b41 38:2e09b0e6857a
834 TreeColumn column = columns !is null ? columns [index] : null; 834 TreeColumn column = columns !is null ? columns [index] : null;
835 if (column !is null) { 835 if (column !is null) {
836 if ((column.style & SWT.CENTER) !is 0) flags |= OS.DT_CENTER; 836 if ((column.style & SWT.CENTER) !is 0) flags |= OS.DT_CENTER;
837 if ((column.style & SWT.RIGHT) !is 0) flags |= OS.DT_RIGHT; 837 if ((column.style & SWT.RIGHT) !is 0) flags |= OS.DT_RIGHT;
838 } 838 }
839 TCHAR[] buffer = StrToTCHARs (getCodePage (), string, false); 839 StringT buffer = StrToTCHARs (getCodePage (), string, false);
840 if (!ignoreDrawForeground) OS.DrawText (hDC, buffer.ptr, buffer.length, rect, flags); 840 if (!ignoreDrawForeground) OS.DrawText (hDC, buffer.ptr, buffer.length, rect, flags);
841 OS.DrawText (hDC, buffer.ptr, buffer.length, rect, flags | OS.DT_CALCRECT); 841 OS.DrawText (hDC, buffer.ptr, buffer.length, rect, flags | OS.DT_CALCRECT);
842 if (hFont !is cast(HFONT)-1) hFont = cast(HFONT)OS.SelectObject (hDC, hFont); 842 if (hFont !is cast(HFONT)-1) hFont = cast(HFONT)OS.SelectObject (hDC, hFont);
843 if (clrText !is -1) clrText = OS.SetTextColor (hDC, clrText); 843 if (clrText !is -1) clrText = OS.SetTextColor (hDC, clrText);
844 if (clrTextBk !is -1) clrTextBk = OS.SetBkColor (hDC, clrTextBk); 844 if (clrTextBk !is -1) clrTextBk = OS.SetBkColor (hDC, clrTextBk);
7156 } else { 7156 } else {
7157 String [] strings = item.strings; 7157 String [] strings = item.strings;
7158 if (strings !is null) string = strings [index]; 7158 if (strings !is null) string = strings [index];
7159 } 7159 }
7160 if (string !is null) { 7160 if (string !is null) {
7161 TCHAR[] buffer = StrToTCHARs (getCodePage (), string, false); 7161 StringT buffer = StrToTCHARs (getCodePage (), string, false);
7162 int byteCount = Math.min (buffer.length, lptvdi.item.cchTextMax - 1) * TCHAR.sizeof; 7162 int byteCount = Math.min (buffer.length, lptvdi.item.cchTextMax - 1) * TCHAR.sizeof;
7163 OS.MoveMemory (lptvdi.item.pszText, buffer.ptr, byteCount); 7163 OS.MoveMemory (lptvdi.item.pszText, buffer.ptr, byteCount);
7164 int st = byteCount/TCHAR.sizeof; 7164 int st = byteCount/TCHAR.sizeof;
7165 lptvdi.item.pszText[ st .. st+1 ] = 0; 7165 lptvdi.item.pszText[ st .. st+1 ] = 0;
7166 //OS.MoveMemory (lptvdi.pszText + byteCount, new byte [TCHAR.sizeof], TCHAR.sizeof); 7166 //OS.MoveMemory (lptvdi.pszText + byteCount, new byte [TCHAR.sizeof], TCHAR.sizeof);
7790 TreeColumn column = columns !is null ? columns [index] : null; 7790 TreeColumn column = columns !is null ? columns [index] : null;
7791 if (column !is null) { 7791 if (column !is null) {
7792 if ((column.style & SWT.CENTER) !is 0) flags |= OS.DT_CENTER; 7792 if ((column.style & SWT.CENTER) !is 0) flags |= OS.DT_CENTER;
7793 if ((column.style & SWT.RIGHT) !is 0) flags |= OS.DT_RIGHT; 7793 if ((column.style & SWT.RIGHT) !is 0) flags |= OS.DT_RIGHT;
7794 } 7794 }
7795 TCHAR[] buffer = StrToTCHARs (getCodePage (), string, false); 7795 StringT buffer = StrToTCHARs (getCodePage (), string, false);
7796 RECT textRect; 7796 RECT textRect;
7797 OS.SetRect (&textRect, x, cellRect.top, cellRect.right, cellRect.bottom); 7797 OS.SetRect (&textRect, x, cellRect.top, cellRect.right, cellRect.bottom);
7798 OS.DrawText (nmcd.nmcd.hdc, buffer.ptr, buffer.length, &textRect, flags); 7798 OS.DrawText (nmcd.nmcd.hdc, buffer.ptr, buffer.length, &textRect, flags);
7799 } 7799 }
7800 gc.dispose (); 7800 gc.dispose ();