Mercurial > projects > dwt2
comparison org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/TableItem.d @ 39:0ecb2b338560
further work on phobosification
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 25 Mar 2009 13:20:43 +0100 |
parents | 2e09b0e6857a |
children |
comparison
equal
deleted
inserted
replaced
38:2e09b0e6857a | 39:0ecb2b338560 |
---|---|
274 if (code is 0) return RECT.init; | 274 if (code is 0) return RECT.init; |
275 if (getText) { | 275 if (getText) { |
276 int width = 0; | 276 int width = 0; |
277 auto hFont = fontHandle (column); | 277 auto hFont = fontHandle (column); |
278 if (hFont is cast(HFONT)-1 && hDC is null) { | 278 if (hFont is cast(HFONT)-1 && hDC is null) { |
279 TCHAR* buffer = StrToTCHARz (parent.getCodePage (), text); | 279 LPCTSTR buffer = StrToTCHARz (parent.getCodePage (), text); |
280 width = OS.SendMessage (hwnd, OS.LVM_GETSTRINGWIDTH, 0, buffer); | 280 width = OS.SendMessage (hwnd, OS.LVM_GETSTRINGWIDTH, 0, cast(void*)buffer); |
281 } else { | 281 } else { |
282 StringT buffer = StrToTCHARs (parent.getCodePage (), text, false); | 282 StringT buffer = StrToTCHARs (parent.getCodePage (), text, false); |
283 auto textDC = hDC !is null ? hDC : OS.GetDC (hwnd), oldFont = cast(HFONT)-1; | 283 auto textDC = hDC !is null ? hDC : OS.GetDC (hwnd), oldFont = cast(HFONT)-1; |
284 if (hDC is null) { | 284 if (hDC is null) { |
285 if (hFont is cast(HFONT)-1) hFont = cast(HFONT) OS.SendMessage (hwnd, OS.WM_GETFONT, 0, 0); | 285 if (hFont is cast(HFONT)-1) hFont = cast(HFONT) OS.SendMessage (hwnd, OS.WM_GETFONT, 0, 0); |
1185 */ | 1185 */ |
1186 public void setText (int index, String string) { | 1186 public void setText (int index, String string) { |
1187 checkWidget(); | 1187 checkWidget(); |
1188 if (index is 0) { | 1188 if (index is 0) { |
1189 if (string.equals(text)) return; | 1189 if (string.equals(text)) return; |
1190 super.setText (string.idup); | 1190 super.setText (string._idup()); |
1191 } | 1191 } |
1192 int count = Math.max (1, parent.getColumnCount ()); | 1192 int count = Math.max (1, parent.getColumnCount ()); |
1193 if (0 > index || index > count - 1) return; | 1193 if (0 > index || index > count - 1) return; |
1194 if (strings is null && index !is 0) { | 1194 if (strings is null && index !is 0) { |
1195 strings = new String[] (count); | 1195 strings = new String[] (count); |
1196 strings [0] = text; | 1196 strings [0] = text; |
1197 } | 1197 } |
1198 if (strings !is null) { | 1198 if (strings !is null) { |
1199 if (string==/*eq*/strings [index]) return; | 1199 if (string==/*eq*/strings [index]) return; |
1200 strings [index] = string.idup; | 1200 strings [index] = string._idup(); |
1201 } | 1201 } |
1202 if ((parent.style & SWT.VIRTUAL) !is 0) cached = true; | 1202 if ((parent.style & SWT.VIRTUAL) !is 0) cached = true; |
1203 if (index is 0) { | 1203 if (index is 0) { |
1204 /* | 1204 /* |
1205 * Bug in Windows. Despite the fact that every item in the | 1205 * Bug in Windows. Despite the fact that every item in the |