comparison org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/CTabItem.d @ 112:9f4c18c268b2

Update to compile and execute with dmd 2.052.
author kntroh
date Wed, 16 Mar 2011 21:53:53 +0900
parents b98647bc0aef
children 536e43f63c81
comparison
equal deleted inserted replaced
111:b6e9904989ed 112:9f4c18c268b2
30 import org.eclipse.swt.widgets.Display; 30 import org.eclipse.swt.widgets.Display;
31 import org.eclipse.swt.widgets.Item; 31 import org.eclipse.swt.widgets.Item;
32 import org.eclipse.swt.widgets.Widget; 32 import org.eclipse.swt.widgets.Widget;
33 import org.eclipse.swt.custom.CTabFolder; 33 import org.eclipse.swt.custom.CTabFolder;
34 34
35 version(Tango){
36 import tango.text.convert.Utf;
37 } else {
38 import std.conv;
39 alias to!(string) toString;
40 alias to!(dstring) toString32;
41 }
42
35 /** 43 /**
36 * Instances of this class represent a selectable user interface object 44 * Instances of this class represent a selectable user interface object
37 * that represent a page in a notebook widget. 45 * that represent a page in a notebook widget.
38 * 46 *
39 * <dl> 47 * <dl>
171 break; 179 break;
172 } 180 }
173 end = layout.getPreviousOffset(end, SWT.MOVEMENT_CLUSTER); 181 end = layout.getPreviousOffset(end, SWT.MOVEMENT_CLUSTER);
174 } 182 }
175 layout.dispose(); 183 layout.dispose();
176 return end is 0 ? text.substring(0, 1) : text ~ ellipses; 184 return end is 0 ? .toString(toString32(text)[0 .. 1]) : text ~ ellipses;
177 } 185 }
178 186
179 public override void dispose() { 187 public override void dispose() {
180 if (isDisposed ()) return; 188 if (isDisposed ()) return;
181 //if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); 189 //if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
857 } 865 }
858 String text = null; 866 String text = null;
859 if (minimum) { 867 if (minimum) {
860 int minChars = parent.minChars; 868 int minChars = parent.minChars;
861 text = minChars is 0 ? null : getText(); 869 text = minChars is 0 ? null : getText();
862 if (text !is null && text.length > minChars) { 870 if (text !is null && toString32(text).length > minChars) {
863 if (useEllipses()) { 871 if (useEllipses()) {
864 int end = minChars < ELLIPSIS.length + 1 ? minChars : minChars - ELLIPSIS.length; 872 int end = minChars < ELLIPSIS.length + 1 ? minChars : minChars - ELLIPSIS.length;
865 text = text[ 0 .. end ]; 873 text = .toString(toString32(text)[ 0 .. end ]);
866 if (minChars > ELLIPSIS.length + 1) text ~= ELLIPSIS; 874 if (minChars > ELLIPSIS.length + 1) text ~= ELLIPSIS;
867 } else { 875 } else {
868 int end = minChars; 876 int end = minChars;
869 text = text[ 0 .. end ]; 877 text = .toString(toString32(text)[ 0 .. end ]);
870 } 878 }
871 } 879 }
872 } else { 880 } else {
873 text = getText(); 881 text = getText();
874 } 882 }