Changeset 84:00a333240696
- Timestamp:
- 02/06/08 12:46:23 (10 months ago)
- Files:
-
- dwt/DWT.d (modified) (1 diff)
- dwt/dwthelper/ByteArrayInputStream.d (added)
- dwt/dwthelper/InputStream.d (modified) (1 diff)
- dwt/dwthelper/ResourceBundle.d (modified) (1 diff)
- dwt/dwthelper/System.d (modified) (2 diffs)
- dwt/dwthelper/utils.d (modified) (1 diff)
- dwt/graphics/Device.d (modified) (1 diff)
- dwt/graphics/FontData.d (modified) (1 diff)
- dwt/internal/win32/OS.d (modified) (1 diff)
- dwt/widgets/FileDialog.d (modified) (25 diffs)
- dwt/widgets/Tracker.d (modified) (1 diff)
- tango_sys_win32/Types.d (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/DWT.d
r78 r84 25 25 pragma(link, "advapi32"); 26 26 pragma(link, "comctl32"); 27 pragma(link, "comdlg32"); 27 28 pragma(link, "gdi32"); 28 29 pragma(link, "kernel32"); dwt/dwthelper/InputStream.d
r0 r84 19 19 int c = read(); 20 20 if( c == -1 ){ 21 return idx;21 return ( idx == 0 ) ? -1 : idx; 22 22 } 23 23 b[ idx] = cast(byte)( c & 0xFF ); dwt/dwthelper/ResourceBundle.d
r0 r84 1 /**1 /** 2 2 * Authors: Frank Benoit <keinfarbton@googlemail.com> 3 3 */ 4 4 module dwt.dwthelper.ResourceBundle; 5 5 6 import tango.text.Util; 7 import tango.io.Stdout; 8 9 6 10 class ResourceBundle { 7 11 8 public this( char[] name ){ 12 char[][ char[] ] map; 13 14 public this( char[] data ){ 15 char[] line; 16 int dataIndex; 17 18 //tango.io.Stdout.Stdout.formatln( "properties put ..." ); 19 void readLine(){ 20 line.length = 0; 21 char i = data[ dataIndex++ ]; 22 while( dataIndex < data.length && i !is '\n' && i !is '\r' ){ 23 line ~= i; 24 i = data[ dataIndex++ ]; 25 } 26 } 27 28 //tango.io.Stdout.Stdout.formatln( "properties put {}", __LINE__ ); 29 bool linecontinue = false; 30 bool iskeypart = true; 31 char[] key; 32 char[] value; 33 nextline: 34 while( dataIndex < data.length ){ 35 //tango.io.Stdout.Stdout.formatln( "properties put {} startline", __LINE__ ); 36 readLine(); 37 line = tango.text.Util.trim( line ); 38 if( line.length is 0 ){ 39 //tango.io.Stdout.Stdout.formatln( "properties put {} was 0 length", __LINE__ ); 40 continue; 41 } 42 if( line[0] == '#' ){ 43 //tango.io.Stdout.Stdout.formatln( "properties put {} was comment", __LINE__ ); 44 continue; 45 } 46 int pos = 0; 47 bool esc = false; 48 if( !linecontinue ){ 49 iskeypart = true; 50 key = null; 51 value = null; 52 } 53 else{ 54 linecontinue = false; 55 } 56 while( pos < line.length ){ 57 char c = line[pos]; 58 if( esc ){ 59 esc = false; 60 switch( c ){ 61 case 't': c = '\t'; break; 62 case 'n': c = '\n'; break; 63 case '\\': c = '\\'; break; 64 default: c = '?'; break; 65 } 66 } 67 else{ 68 if( c == '\\' ){ 69 if( pos == line.length -1 ){ 70 linecontinue = true; 71 goto nextline; 72 } 73 esc = true; 74 pos++; 75 continue; 76 } 77 else if( iskeypart && c == '=' ){ 78 pos++; 79 iskeypart = false; 80 continue; 81 } 82 } 83 pos++; 84 if( iskeypart ){ 85 key ~= c; 86 } 87 else{ 88 value ~= c; 89 } 90 } 91 if( iskeypart ){ 92 tango.io.Stdout.Stdout.formatln( "dwt.dwthelper.ResourceBundle ctor cannot find '='." ); 93 continue; 94 } 95 key = tango.text.Util.trim( key ); 96 value = tango.text.Util.trim(value); 97 //tango.io.Stdout.Stdout.formatln( "properties put {}=>{}", key, value ); 98 99 map[ key.dup ] = value.dup; 100 //tango.io.Stdout.Stdout.formatln( "properties put {}", __LINE__ ); 101 } 9 102 } 10 103 11 104 public char[] getString( char[] key ){ 105 if( auto v = key in map ){ 106 return (*v).dup; 107 } 12 108 return key; 13 109 } 14 110 15 111 public static ResourceBundle getBundle( char[] name ){ 16 return new ResourceBundle( n ame);112 return new ResourceBundle( null ); 17 113 } 18 114 public static ResourceBundle getBundleFromData( char[] data ){ 115 return new ResourceBundle( data ); 116 } 19 117 } 20 118 dwt/dwthelper/System.d
r33 r84 5 5 6 6 import tango.core.Exception; 7 import tango.time.Clock; 7 8 import tango.stdc.stdlib : exit; 8 9 … … 122 123 123 124 static long currentTimeMillis(){ 124 //PORTING_FIXMe 125 return 0; 125 return Clock.now().ticks() / 10000; 126 126 } 127 127 dwt/dwthelper/utils.d
r79 r84 89 89 } 90 90 91 public char[] replace( char[] str, char from, char to ){ 92 return tango.text.Util.replace( str.dup, from, to ); 93 } 94 91 95 public char[] substring( char[] str, int start ){ 92 96 return str[ start .. $ ].dup; dwt/graphics/Device.d
r81 r84 512 512 */ 513 513 cbdata.scalable = scalable; 514 if (OS.IsUnicode) {514 static if (OS.IsUnicode) { 515 515 OS.EnumFontFamiliesW (hDC, (cast(LOGFONTW*)lf).lfFaceName.ptr, &EnumFontFamFunc, cast(int)&cbdata); 516 516 } else { dwt/graphics/FontData.d
r48 r84 324 324 } 325 325 326 //PORTING_FIXME: tango has this callback defined always with char*, needs fix 327 extern (Windows) static 328 //int EnumLocalesProc(TCHAR* lpLocaleString) { 329 int EnumLocalesProc(char* lpLocaleString) { 326 extern (Windows) static int EnumLocalesProc(TCHAR* lpLocaleString) { 330 327 331 328 /* Get the locale ID */ dwt/internal/win32/OS.d
r83 r84 231 231 pActCtx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_SET_PROCESS_DEFAULT; 232 232 pActCtx.lpSource = pszText; 233 pActCtx.lpResourceName = cast( char*)MANIFEST_RESOURCE_ID;233 pActCtx.lpResourceName = cast(TCHAR*)MANIFEST_RESOURCE_ID; 234 234 HANDLE hActCtx = OS.CreateActCtx (&pActCtx); 235 235 if (pszText !is null) OS.HeapFree (hHeap, 0, pszText); dwt/widgets/FileDialog.d
r82 r84 13 13 module dwt.widgets.FileDialog; 14 14 15 16 import dwt.DWT; 17 import dwt.DWTException; 18 import dwt.internal.win32.OS; 15 19 import dwt.widgets.Dialog; 16 20 import dwt.widgets.Shell; 17 18 class FileDialog : Dialog { 19 public this (Shell parent) { 20 this (parent, 0); 21 } 22 public this (Shell parent, int style) { 23 super (parent, style); 24 } 25 26 } 27 28 /++ 29 import dwt.DWT; 30 import dwt.DWTException; 31 import dwt.internal.Callback; 32 import dwt.internal.win32.OFNOTIFY; 33 import dwt.internal.win32.OPENFILENAME; 34 import dwt.internal.win32.OS; 35 import dwt.internal.win32.TCHAR; 21 import dwt.widgets.Display; 22 23 import dwt.dwthelper.utils; 36 24 37 25 /** … … 51 39 * </p> 52 40 */ 53 public class FileDialog extendsDialog {54 String [] filterNames = new String [0];55 String [] filterExtensions = new String [0];56 String [] fileNames = new String [0];57 StringfilterPath = "", fileName = "";58 static final StringFILTER = "*.*";41 public class FileDialog : Dialog { 42 char[] [] filterNames; 43 char[] [] filterExtensions; 44 char[] [] fileNames; 45 char[] filterPath = "", fileName = ""; 46 static final char[] FILTER = "*.*"; 59 47 static int BUFFER_SIZE = 1024 * 32; 60 48 static bool USE_HOOK; … … 73 61 * </ul> 74 62 */ 75 public FileDialog(Shell parent) {63 public this (Shell parent) { 76 64 this (parent, DWT.PRIMARY_MODAL); 77 65 } … … 101 89 * </ul> 102 90 */ 103 public FileDialog(Shell parent, int style) {91 public this (Shell parent, int style) { 104 92 super (parent, style); 105 93 checkSubclass (); … … 113 101 * @return the relative path of the file 114 102 */ 115 public StringgetFileName () {103 public char[] getFileName () { 116 104 return fileName; 117 105 } … … 123 111 * @return the relative paths of the files 124 112 */ 125 public String[] getFileNames () {113 public char[] [] getFileNames () { 126 114 return fileNames; 127 115 } … … 133 121 * @return the file extensions filter 134 122 */ 135 public String[] getFilterExtensions () {123 public char[] [] getFilterExtensions () { 136 124 return filterExtensions; 137 125 } … … 143 131 * @return the list of filter names 144 132 */ 145 public String[] getFilterNames () {133 public char[] [] getFilterNames () { 146 134 return filterNames; 147 135 } … … 156 144 * @see #setFilterExtensions 157 145 */ 158 public StringgetFilterPath () {146 public char[] getFilterPath () { 159 147 return filterPath; 160 148 } 161 149 162 int OFNHookProc (int hdlg, int uiMsg,int wParam, int lParam) {150 private static extern(Windows) uint OFNHookProc (HWND hdlg, uint uiMsg, uint wParam, int lParam) { 163 151 switch (uiMsg) { 164 152 case OS.WM_NOTIFY: 165 OFNOTIFY ofn = new OFNOTIFY ();166 OS.MoveMemory (ofn, lParam, OFNOTIFY.sizeof);167 if (ofn. code is OS.CDN_SELCHANGE) {168 int lResult = OS.SendMessage (ofn.h wndFrom, OS.CDM_GETSPEC, 0, 0);153 OFNOTIFY* ofn = cast(OFNOTIFY*)lParam; 154 //OS.MoveMemory (ofn, lParam, OFNOTIFY.sizeof); 155 if (ofn.hdr.code is OS.CDN_SELCHANGE) { 156 int lResult = OS.SendMessage (ofn.hdr.hwndFrom, OS.CDM_GETSPEC, 0, 0); 169 157 if (lResult > 0) { 170 158 lResult += OS.MAX_PATH; 171 OPENFILENAME lpofn = new OPENFILENAME ();172 OS.MoveMemory (lpofn, ofn.lpOFN, OPENFILENAME.sizeof);159 OPENFILENAME* lpofn = ofn.lpOFN; 160 //OS.MoveMemory (lpofn, ofn.lpOFN, OPENFILENAME.sizeof); 173 161 if (lpofn.nMaxFile < lResult) { 174 inthHeap = OS.GetProcessHeap ();175 int lpstrFile =OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, lResult * TCHAR.sizeof);176 if (lpstrFile !is 0) {177 if (lpofn.lpstrFile !is 0) OS.HeapFree (hHeap, 0, lpofn.lpstrFile);162 auto hHeap = OS.GetProcessHeap (); 163 auto lpstrFile = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, lResult * TCHAR.sizeof); 164 if (lpstrFile !is null) { 165 if (lpofn.lpstrFile !is null) OS.HeapFree (hHeap, 0, lpofn.lpstrFile); 178 166 lpofn.lpstrFile = lpstrFile; 179 167 lpofn.nMaxFile = lResult; 180 OS.MoveMemory (ofn.lpOFN, lpofn, OPENFILENAME.sizeof);168 //OS.MoveMemory (ofn.lpOFN, lpofn, OPENFILENAME.sizeof); 181 169 } 182 170 } … … 201 189 * </ul> 202 190 */ 203 public Stringopen () {204 inthHeap = OS.GetProcessHeap ();191 public char[] open () { 192 auto hHeap = OS.GetProcessHeap (); 205 193 206 194 /* Get the owner HWND for the dialog */ 207 int hwndOwner = 0;195 HWND hwndOwner; 208 196 if (parent !is null) hwndOwner = parent.handle; 209 197 … … 211 199 if (title is null) title = ""; 212 200 /* Use the character encoding for the default locale */ 213 TCHAR buffer3 = new TCHAR(0, title, true);214 int byteCount3 = buffer3.length ()* TCHAR.sizeof;215 int lpstrTitle =OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount3);216 OS.MoveMemory (lpstrTitle, buffer3 , byteCount3);201 TCHAR[] buffer3 = StrToTCHARs (0, title, true); 202 int byteCount3 = buffer3.length * TCHAR.sizeof; 203 auto lpstrTitle = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount3); 204 OS.MoveMemory (lpstrTitle, buffer3.ptr, byteCount3); 217 205 218 206 /* Compute filters and copy into lpstrFilter */ 219 StringstrFilter = "";220 if (filterNames is null) filterNames = n ew String [0];221 if (filterExtensions is null) filterExtensions = n ew String [0];207 char[] strFilter = ""; 208 if (filterNames is null) filterNames = null; 209 if (filterExtensions is null) filterExtensions = null; 222 210 for (int i=0; i<filterExtensions.length; i++) { 223 StringfilterName = filterExtensions [i];211 char[] filterName = filterExtensions [i]; 224 212 if (i < filterNames.length) filterName = filterNames [i]; 225 strFilter = strFilter + filterName + '\0' + filterExtensions [i] +'\0';213 strFilter = strFilter ~ filterName ~ '\0' ~ filterExtensions [i] ~ '\0'; 226 214 } 227 215 if (filterExtensions.length is 0) { 228 strFilter = strFilter + FILTER + '\0' + FILTER +'\0';216 strFilter = strFilter ~ FILTER ~ '\0' ~ FILTER ~ '\0'; 229 217 } 230 218 /* Use the character encoding for the default locale */ 231 TCHAR buffer4 = new TCHAR(0, strFilter, true);232 int byteCount4 = buffer4.length ()* TCHAR.sizeof;233 int lpstrFilter =OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount4);234 OS.MoveMemory (lpstrFilter, buffer4 , byteCount4);219 TCHAR[] buffer4 = StrToTCHARs (0, strFilter, true); 220 int byteCount4 = buffer4.length * TCHAR.sizeof; 221 auto lpstrFilter = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount4); 222 OS.MoveMemory (lpstrFilter, buffer4.ptr, byteCount4); 235 223 236 224 /* Convert the fileName and filterName to C strings */ 237 225 if (fileName is null) fileName = ""; 238 226 /* Use the character encoding for the default locale */ 239 TCHAR name = new TCHAR(0, fileName, true);227 TCHAR[] name = StrToTCHARs (0, fileName, true); 240 228 241 229 /* … … 246 234 if ((style & DWT.MULTI) !is 0) nMaxFile = Math.max (nMaxFile, BUFFER_SIZE); 247 235 int byteCount = nMaxFile * TCHAR.sizeof; 248 int lpstrFile =OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);249 int byteCountFile = Math.min (name.length ()* TCHAR.sizeof, byteCount - TCHAR.sizeof);250 OS.MoveMemory (lpstrFile, name , byteCountFile);236 auto lpstrFile = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount); 237 int byteCountFile = Math.min (name.length * TCHAR.sizeof, byteCount - TCHAR.sizeof); 238 OS.MoveMemory (lpstrFile, name.ptr, byteCountFile); 251 239 252 240 /* … … 256 244 if (filterPath is null) filterPath = ""; 257 245 /* Use the character encoding for the default locale */ 258 TCHAR path = new TCHAR(0, filterPath.replace ('/', '\\'), true);246 TCHAR[] path = StrToTCHARs (0, filterPath.replace ('/', '\\'), true); 259 247 int byteCount5 = OS.MAX_PATH * TCHAR.sizeof; 260 int lpstrInitialDir =OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount5);261 int byteCountDir = Math.min (path.length ()* TCHAR.sizeof, byteCount5 - TCHAR.sizeof);262 OS.MoveMemory (lpstrInitialDir, path , byteCountDir);248 auto lpstrInitialDir = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount5); 249 int byteCountDir = Math.min (path.length * TCHAR.sizeof, byteCount5 - TCHAR.sizeof); 250 OS.MoveMemory (lpstrInitialDir, path.ptr, byteCountDir); 263 251 264 252 /* Create the file dialog struct */ 265 OPENFILENAME struct = new OPENFILENAME ();266 struct .lStructSize = OPENFILENAME.sizeof;267 struct .Flags = OS.OFN_HIDEREADONLY | OS.OFN_NOCHANGEDIR;268 Callback callback = null;253 OPENFILENAME struct_; 254 struct_.lStructSize = OPENFILENAME.sizeof; 255 struct_.Flags = OS.OFN_HIDEREADONLY | OS.OFN_NOCHANGEDIR; 256 //Callback callback = null; 269 257 if ((style & DWT.MULTI) !is 0) { 270 struct .Flags |= OS.OFN_ALLOWMULTISELECT | OS.OFN_EXPLORER;258 struct_.Flags |= OS.OFN_ALLOWMULTISELECT | OS.OFN_EXPLORER; 271 259 if (!OS.IsWinCE && USE_HOOK) { 272 callback = new Callback (this, "OFNHookProc", 4); //$NON-NLS-1$ 273 int lpfnHook = callback.getAddress (); 274 if (lpfnHook is 0) DWT.error (DWT.ERROR_NO_MORE_CALLBACKS); 275 struct.lpfnHook = lpfnHook; 276 struct.Flags |= OS.OFN_ENABLEHOOK; 260 //callback = new Callback (this, "OFNHookProc", 4); //$NON-NLS-1$ 261 //int lpfnHook = callback.getAddress (); 262 //if (lpfnHook is 0) DWT.error (DWT.ERROR_NO_MORE_CALLBACKS); 263 struct_.lCustData = cast(uint) cast(void*) this; 264 struct_.lpfnHook = &OFNHookProc; 265 struct_.Flags |= OS.OFN_ENABLEHOOK; 277 266 } 278 267 } 279 struct .hwndOwner = hwndOwner;280 struct .lpstrTitle = lpstrTitle;281 struct .lpstrFile = lpstrFile;282 struct .nMaxFile = nMaxFile;283 struct .lpstrInitialDir = lpstrInitialDir;284 struct .lpstrFilter = lpstrFilter;285 struct .nFilterIndex = 0;268 struct_.hwndOwner = hwndOwner; 269 struct_.lpstrTitle = lpstrTitle; 270 struct_.lpstrFile = lpstrFile; 271 struct_.nMaxFile = nMaxFile; 272 struct_.lpstrInitialDir = lpstrInitialDir; 273 struct_.lpstrFilter = lpstrFilter; 274 struct_.nFilterIndex = 0; 286 275 287 276 /* … … 291 280 * extension at the time that the dialog is closed. 292 281 */ 293 int lpstrDefExt = 0;282 TCHAR* lpstrDefExt; 294 283 bool save = (style & DWT.SAVE) !is 0; 295 284 if (save) { 296 lpstrDefExt = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, TCHAR.sizeof);297 struct .lpstrDefExt = lpstrDefExt;285 lpstrDefExt = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, TCHAR.sizeof); 286 struct_.lpstrDefExt = lpstrDefExt; 298 287 } 299 288 … … 324 313 * file name, use an empty file name and open it again. 325 314 */ 326 bool success = (save) ? OS.GetSaveFileName (struct) : OS.GetOpenFileName (struct);315 bool success = cast(bool)( (save) ? OS.GetSaveFileName (&struct_) : OS.GetOpenFileName (&struct_)); 327 316 switch (OS.CommDlgExtendedError ()) { 328 317 case OS.FNERR_INVALIDFILENAME: 329 OS.MoveMemory (lpstrFile, new TCHAR (0, "", true), TCHAR.sizeof);330 success = (save) ? OS.GetSaveFileName (struct) : OS.GetOpenFileName (struct);318 OS.MoveMemory (lpstrFile, StrToTCHARz ( "" ), TCHAR.sizeof); 319 success = cast(bool)((save) ? OS.GetSaveFileName (&struct_) : OS.GetOpenFileName (&struct_)); 331 320 break; 332 321 case OS.FNERR_BUFFERTOOSMALL: … … 343 332 344 333 /* Dispose the callback and reassign the buffer */ 345 if (callback !is null) callback.dispose ();346 lpstrFile = struct .lpstrFile;334 //if (callback !is null) callback.dispose (); 335 lpstrFile = struct_.lpstrFile; 347 336 348 337 /* Set the new path, file name and filter */ 349 fileNames = new String[0];350 StringfullPath = null;338 fileNames = new char[] [0]; 339 char[] fullPath = null; 351 340 if (success) { 352 341 353 342 /* Use the character encoding for the default locale */ 354 TCHAR buffer = new TCHAR (0, struct.nMaxFile);355 int byteCount1 = buffer.length ()* TCHAR.sizeof;356 OS.MoveMemory (buffer , lpstrFile, byteCount1);343 TCHAR[] buffer = NewTCHARs (0, struct_.nMaxFile); 344 int byteCount1 = buffer.length * TCHAR.sizeof; 345 OS.MoveMemory (buffer.ptr, lpstrFile, byteCount1); 357 346 358 347 /* … … 365 354 * Note: WinCE does not support multi-select file dialogs. 366 355 */ 367 int nFileOffset = struct .nFileOffset;356 int nFileOffset = struct_.nFileOffset; 368 357 if (OS.IsWinCE && nFileOffset is 0) { 369 358 int index = 0; 370 while (index < buffer.length ()) {371 int ch = buffer .tcharAt (index);359 while (index < buffer.length ) { 360 int ch = buffer[index]; 372 361 if (ch is 0) break; 373 362 if (ch is '\\') nFileOffset = index + 1; … … 378 367 379 368 /* Use the character encoding for the default locale */ 380 TCHAR prefix = new TCHAR(0, nFileOffset - 1);381 int byteCount2 = prefix.length ()* TCHAR.sizeof;382 OS.MoveMemory (prefix , lpstrFile, byteCount2);383 filterPath = prefix.toString (0, prefix.length ());369 TCHAR[] prefix = NewTCHARs (0, nFileOffset - 1); 370 int byteCount2 = prefix.length * TCHAR.sizeof; 371 OS.MoveMemory (prefix.ptr, lpstrFile, byteCount2); 372 filterPath = TCHARsToStr( prefix ); 384 373 385 374 /* … … 388 377 */ 389 378 int count = 0; 390 fileNames = new String [(style & DWT.MULTI) !is 0 ? 4 : 1];379 fileNames = new char[][]( (style & DWT.MULTI) !is 0 ? 4 : 1 ); 391 380 int start = nFileOffset; 392 381 do { 393 382 int end = start; 394 while (end < buffer.length () && buffer.tcharAt (end)!is 0) end++;395 String string = buffer.toString (start, end - start);383 while (end < buffer.length && buffer[end] !is 0) end++; 384 char[] string = TCHARsToStr( buffer[ start .. end - start ] ); 396 385 start = end; 397 386 if (count is fileNames.length) { 398 String [] newFileNames = new String [fileNames.length + 4];387 char[] [] newFileNames = new char[][]( fileNames.length + 4 ); 399 388 System.arraycopy (fileNames, 0, newFileNames, 0, fileNames.length); 400 389 fileNames = newFileNames; … … 403 392 if ((style & DWT.MULTI) is 0) break; 404 393 start++; 405 } while (start < buffer.length () && buffer.tcharAt (start)!is 0);394 } while (start < buffer.length && buffer[start] !is 0); 406 395 407 396 if (fileNames.length > 0) fileName = fileNames [0]; 408 Stringseparator = "";409 int length = filterPath.length ();410 if (length > 0 && filterPath.charAt (length - 1)!is '\\') {397 char[] separator = ""; 398 int length_ = filterPath.length; 399 if (length_ > 0 && filterPath[length_ - 1] !is '\\') { 411 400 separator = "\\"; 412 401 } 413 fullPath = filterPath + separator +fileName;402 fullPath = filterPath ~ separator ~ fileName; 414 403 if (count < fileNames.length) { 415 String [] newFileNames = new String [count];404 char[] [] newFileNames = new char[][]( count ); 416 405 System.arraycopy (fileNames, 0, newFileNames, 0, count); 417 406 fileNames = newFileNames; … … 425 414 OS.HeapFree (hHeap, 0, lpstrInitialDir); 426 415 OS.HeapFree (hHeap, 0, lpstrTitle); 427 if (lpstrDefExt !is 0) OS.HeapFree (hHeap, 0, lpstrDefExt);416 if (lpstrDefExt !is null) OS.HeapFree (hHeap, 0, lpstrDefExt); 428 417 429 418 /* … … 447 436 * @param string the file name 448 437 */ 449 public void setFileName ( Stringstring) {438 public void setFileName (char[] string) { 450 439 fileName = string; 451 440 } … … 466 455 * names corresponding to the extensions 467 456 */ 468 public void setFilterExtensions ( String[] extensions) {457 public void setFilterExtensions (char[] [] extensions) { 469 458 filterExtensions = extensions; 470 459 } … … 484 473 * @see #setFilterExtensions 485 474 */ 486 public void setFilterNames ( String[] names) {475 public void setFilterNames (char[] [] names) { 487 476 filterNames = names; 488 477 } … … 505 494 * @see #setFilterExtensions 506 495 */ 507 public void setFilterPath ( Stringstring) {496 public void setFilterPath (char[] string) { 508 497 filterPath = string; 509 498 } 510 499 511 500 } 512 ++/ 501 dwt/widgets/Tracker.d
r82 r84 499 499 hwndTransparent = OS.CreateWindowEx ( 500 500 isVista ? OS.WS_EX_LAYERED | OS.WS_EX_NOACTIVATE : OS.WS_EX_TRANSPARENT, 501 display.windowClass_ ,501 display.windowClass_.ptr, 502 502 null, 503 503 OS.WS_POPUP, tango_sys_win32/Types.d
r78 r84 98 98 alias COLORREF* LPCOLORREF; 99 99 alias PCHAR LPCSTR; 100 alias PCHARLPCTSTR;100 alias TCHAR* LPCTSTR; 101 101 alias wchar* LPCWCH; 102 102 alias wchar* LPCWSTR; … … 107 107 alias PCHAR LPSTR; 108 108 alias PCHAR LPTCH; 109 alias PCHARLPTSTR;109 alias TCHAR* LPTSTR; 110 110 alias int LRESULT; 111 111 alias POINTER LPVOID; … … 151 151 alias DWORD SERVICE_STATUS_HANDLE; 152 152 alias ubyte TBYTE; 153 alias char TCHAR; 153 154 // version dependent 155 alias wchar TCHAR; 156 154 157 alias ubyte BCHAR; 155 158 alias ubyte UCHAR;
