Changeset 92
- Timestamp:
- 01/27/06 05:30:34 (3 years ago)
- Files:
-
- trunk/current/win32/import/dwt/browser/browser.d (modified) (7 diffs)
- trunk/current/win32/import/dwt/custom/styledtexthelper.d (modified) (7 diffs)
- trunk/current/win32/import/dwt/extra/make-dwtextra-lib.bat (modified) (1 diff)
- trunk/current/win32/import/dwt/graphics/device.d (modified) (3 diffs)
- trunk/current/win32/import/dwt/ole/win32/olecontrolsite.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/ole/win32/olemisc.d (modified) (1 diff)
- trunk/current/win32/import/dwt/util/resourcemanager.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/util/util.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/util/vector.d (modified) (12 diffs)
- trunk/current/win32/import/make-dwt-lib.bat (modified) (1 diff)
- trunk/current/win32/packages/dwt/examples/controlexample/controlexample.d (modified) (3 diffs)
- trunk/current/win32/packages/dwt/examples/controlexample/styledtexttab.d (modified) (1 diff)
- trunk/current/win32/packages/dwt/examples/dummyeclipse/dummyeclipse.d (modified) (12 diffs)
- trunk/current/win32/packages/dwt/examples/traytest/Traytest.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/current/win32/import/dwt/browser/browser.d
r82 r92 555 555 } 556 556 557 VecT!(CloseWindowListener).remove(closeWindowListeners, listener);557 TVector!(CloseWindowListener).remove(closeWindowListeners, listener); 558 558 } 559 559 … … 577 577 checkWidget(); 578 578 if (listener is null) DWT.error (__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 579 VecT!(LocationListener).remove(locationListeners, listener);579 TVector!(LocationListener).remove(locationListeners, listener); 580 580 } 581 581 … … 599 599 checkWidget(); 600 600 if (listener is null) DWT.error (__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 601 VecT!(OpenWindowListener).remove(openWindowListeners, listener);601 TVector!(OpenWindowListener).remove(openWindowListeners, listener); 602 602 } 603 603 … … 621 621 checkWidget(); 622 622 if (listener is null) DWT.error (__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 623 VecT!(ProgressListener).remove(progressListeners, listener);623 TVector!(ProgressListener).remove(progressListeners, listener); 624 624 } 625 625 … … 643 643 checkWidget(); 644 644 if (listener is null) DWT.error (__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 645 VecT!(StatusTextListener).remove(statusTextListeners, listener);645 TVector!(StatusTextListener).remove(statusTextListeners, listener); 646 646 } 647 647 … … 665 665 checkWidget(); 666 666 if (listener is null) DWT.error (__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 667 VecT!(TitleListener).remove(titleListeners, listener);667 TVector!(TitleListener).remove(titleListeners, listener); 668 668 } 669 669 … … 687 687 checkWidget(); 688 688 if (listener is null) DWT.error (__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 689 VecT!(VisibilityWindowListener).remove(visibilityWindowListeners, listener);689 TVector!(VisibilityWindowListener).remove(visibilityWindowListeners, listener); 690 690 } 691 691 trunk/current/win32/import/dwt/custom/styledtexthelper.d
r82 r92 1749 1749 // expand the lines by powers of 2 1750 1750 RANGE[] newLines = new RANGE[len+Compatibility.pow2(expandExp)]; 1751 Simp Type!(RANGE).arraycopy(lines, 0, newLines, 0, len);1751 SimpleType!(RANGE).arraycopy(lines, 0, newLines, 0, len); 1752 1752 lines = newLines; 1753 1753 expandExp++; … … 1776 1776 newLines = new RANGE[size+Compatibility.pow2(replaceExpandExp)]; 1777 1777 replaceExpandExp++; 1778 Simp Type!(RANGE).arraycopy(linesArray, 0, newLines, 0, size);1778 SimpleType!(RANGE).arraycopy(linesArray, 0, newLines, 0, size); 1779 1779 } 1780 1780 RANGE range; … … 1947 1947 } 1948 1948 RANGE[] newLines = new RANGE[lineCnt+1]; 1949 Simp Type!(RANGE).arraycopy(indexedLines, 0, newLines, 0, lineCnt);1949 SimpleType!(RANGE).arraycopy(indexedLines, 0, newLines, 0, lineCnt); 1950 1950 1951 1951 RANGE range; … … 2365 2365 } 2366 2366 RANGE[] newLines = new RANGE[size+Math.max(10, numLines)]; 2367 Simp Type!(RANGE).arraycopy(lines, 0, newLines, 0, size);2367 SimpleType!(RANGE).arraycopy(lines, 0, newLines, 0, size); 2368 2368 lines = newLines; 2369 2369 } … … 3530 3530 } 3531 3531 RANGE[] newLines = new RANGE[Math.max(size * 2, numLines)]; 3532 Simp Type!(RANGE).arraycopy(visualLines, 0, newLines, 0, size);3532 SimpleType!(RANGE).arraycopy(visualLines, 0, newLines, 0, size); 3533 3533 visualLines = newLines; 3534 3534 resetVisualLines(size, visualLines.length - size); … … 3802 3802 // there are more visual lines for a given logical line than before 3803 3803 if (visualLines[visualLineIndex][LINE_OFFSET] != -1) { 3804 Simp Type!(RANGE).arraycopy(visualLines, visualLineIndex, visualLines, visualLineIndex + 1, visualLineCount - visualLineIndex);3804 SimpleType!(RANGE).arraycopy(visualLines, visualLineIndex, visualLines, visualLineIndex + 1, visualLineCount - visualLineIndex); 3805 3805 3806 3806 RANGE range; … … 3876 3876 if (emptyLineCount > 0) { 3877 3877 int copyLineCount = visualLineCount - visualLineIndex; 3878 Simp Type!(RANGE).arraycopy(visualLines, visualLineIndex + emptyLineCount, visualLines, visualLineIndex, copyLineCount);3878 SimpleType!(RANGE).arraycopy(visualLines, visualLineIndex + emptyLineCount, visualLines, visualLineIndex, copyLineCount); 3879 3879 resetVisualLines(visualLineIndex + copyLineCount, emptyLineCount); 3880 3880 } trunk/current/win32/import/dwt/extra/make-dwtextra-lib.bat
r82 r92 1 1 @echo deleting old intermediate files ... 2 2 3 del *.obj *.map /s /q3 del *.obj *.map *.rsp *.lsp *.ksp *.def /s /q 4 4 5 5 @echo Build release version ... trunk/current/win32/import/dwt/graphics/device.d
r82 r92 14 14 private import dwt.dwt; 15 15 16 17 18 16 private import dwt.graphics.color; 19 private import dwt.graphics.cursor;20 17 private import dwt.graphics.devicedata; 21 18 private import dwt.graphics.drawable; 22 19 private import dwt.graphics.font; 23 20 private import dwt.graphics.fontdata; 24 private import dwt.graphics.fontmetrics;25 private import dwt.graphics.gc;26 21 private import dwt.graphics.gcdata; 27 private import dwt.graphics.image;28 private import dwt.graphics.imagedata;29 private import dwt.graphics.imageloader;30 private import dwt.graphics.imageloaderevent;31 private import dwt.graphics.imageloaderlistener;32 private import dwt.graphics.palettedata;33 22 private import dwt.graphics.point; 34 23 private import dwt.graphics.rectangle; 35 private import dwt.graphics.region;36 private import dwt.graphics.rgb;37 private import dwt.graphics.textlayout;38 private import dwt.graphics.textstyle;39 private import dwt.internal.bidiutil;40 private import dwt.internal.cloneablecompatibility;41 24 private import dwt.internal.compatibility; 42 private import dwt.internal.library;43 private import dwt.internal.serializablecompatibility;44 private import dwt.internal.dwteventlistener;45 private import dwt.internal.dwteventobject;46 25 private import dwt.internal.win32.os; 47 26 48 49 50 27 private import dwt.util.util; 51 28 private import dwt.util.javatypes; 52 private import dwt.util.util;53 private import dwt.util.vector;54 private import dwt.util.hashtable;55 private import dwt.util.eventhandler;56 private import dwt.util.javatypes;57 //private import dwt.internal.callback;58 29 59 30 … … 67 38 68 39 private import std.windows.charset; 69 private import std.windows.syserror;70 71 40 72 41 /* Debugging */ … … 529 498 if (error == 0) return ""; 530 499 531 // there is bug in phobos sysErrorString(), call fromMBSz() myself 532 char[] buffer = std.windows.syserror.sysErrorString(error); 533 if(buffer[--$] != '\0') 534 buffer ~= '\0'; 535 return std.windows.charset.fromMBSz(buffer); 536 537 // TCHAR* buffer = null; 538 // int dwFlags = OS.FORMAT_MESSAGE_ALLOCATE_BUFFER | OS.FORMAT_MESSAGE_FROM_SYSTEM | OS.FORMAT_MESSAGE_IGNORE_INSERTS; 539 // int length = OS.FormatMessage(dwFlags, null, error, OS.LANG_USER_DEFAULT, cast(TCHAR*)&buffer, 0, null); 540 // char[] errorNum = ("[GetLastError=") ~ Converter.toHex(error) ~ "] "; 541 // if (length == 0) return errorNum; 542 // char[] buffer1 = Converter.TCHARzToStr(buffer, length); 543 // if ( *buffer != 0) 544 // OS.LocalFree(cast(HLOCAL)buffer); 545 // return errorNum ~ buffer1; 500 TCHAR* buffer = null; 501 int dwFlags = OS.FORMAT_MESSAGE_ALLOCATE_BUFFER | OS.FORMAT_MESSAGE_FROM_SYSTEM | OS.FORMAT_MESSAGE_IGNORE_INSERTS; 502 int length = OS.FormatMessage(dwFlags, null, error, OS.LANG_USER_DEFAULT, cast(TCHAR*)&buffer, 0, null); 503 char[] errorNum = ("[GetLastError=") ~ Converter.toHex(error) ~ "] "; 504 if (length == 0) return errorNum; 505 char[] buffer1 = Converter.TCHARzToStr(buffer, length); 506 if ( *buffer != 0) 507 OS.LocalFree(cast(HLOCAL)buffer); 508 return errorNum ~ buffer1; 546 509 } 547 510 trunk/current/win32/import/dwt/ole/win32/olecontrolsite.d
r82 r92 41 41 42 42 43 private alias Simp Type!(Variant).arraycopy arraycopy;43 private alias SimpleType!(Variant).arraycopy arraycopy; 44 44 45 45 class _IDispatchImpl : IDispatch { … … 747 747 oleEventSinkIUnknown = null; 748 748 } else { 749 VecT!(OleEventSink).remove(oleEventSink, i);750 VecT!(GUID*).remove(oleEventSinkGUID, i);751 VecT!(IUnknown).remove(oleEventSinkIUnknown, i);749 TVector!(OleEventSink).remove(oleEventSink, i); 750 TVector!(GUID*).remove(oleEventSinkGUID, i); 751 TVector!(IUnknown).remove(oleEventSinkIUnknown, i); 752 752 } 753 753 } trunk/current/win32/import/dwt/ole/win32/olemisc.d
r76 r92 117 117 TypedHandler hand = handlers[i]; 118 118 if(hand && hand.equals(handler)){ 119 VecT!(TypedHandler).remove(handlers, hand);119 TVector!(TypedHandler).remove(handlers, hand); 120 120 hand = null; 121 121 return; trunk/current/win32/import/dwt/util/resourcemanager.d
r82 r92 26 26 */ 27 27 28 public class ResourceManager { 28 // since there is a ResourceManager class in JFace, and I may port JFace from java to D soon, 29 // to avoid name conflicts, rename this class to DWTResourceManager 30 31 deprecated alias DWTResourceManager ResourceManager; 32 33 public class DWTResourceManager { 29 34 30 35 private import std.c.windows.windows; … … 57 62 Widget w = cast(Widget)e.getSource(); 58 63 assert(w !is null); 59 if(w in ResourceManager.users)60 ResourceManager.users.remove(w);61 if ( ResourceManager.users.length == 0)62 ResourceManager.dispose();64 if(w in DWTResourceManager.users) 65 DWTResourceManager.users.remove(w); 66 if (DWTResourceManager.users.length == 0) 67 DWTResourceManager.dispose(); 63 68 } 64 69 // widget.handleDispose(null, &onDispose); trunk/current/win32/import/dwt/util/util.d
r82 r92 176 176 } 177 177 178 template SimpType(T) 178 deprecated alias SimpleType SimpType; 179 180 template SimpleType(T) 179 181 { 180 182 debug{ 181 183 static void validCheck(uint SrcLen, uint DestLen, uint copyLen){ 182 184 if(SrcLen < copyLen || DestLen < copyLen|| SrcLen < 0 || DestLen < 0){ 183 Util.trace("Error : VecT.arraycopy(), out of bounds.");185 Util.trace("Error : SimpleType.arraycopy(), out of bounds."); 184 186 assert(0); 185 187 } … … 287 289 return GetTickCount(); 288 290 } 289 alias Simp Type!(int).arraycopy arraycopy;290 alias Simp Type!(byte).arraycopy arraycopy;291 alias Simp Type!(double).arraycopy arraycopy;292 alias Simp Type!(float).arraycopy arraycopy;293 alias Simp Type!(short).arraycopy arraycopy;294 alias Simp Type!(long).arraycopy arraycopy;295 alias Simp Type!(uint).arraycopy arraycopy;296 alias Simp Type!(ushort).arraycopy arraycopy;297 alias Simp Type!(ubyte).arraycopy arraycopy;298 alias Simp Type!(ulong).arraycopy arraycopy;299 alias Simp Type!(char).arraycopy arraycopy;300 alias Simp Type!(wchar).arraycopy arraycopy;301 alias Simp Type!(Object).arraycopy arraycopy;302 alias Simp Type!(void*).arraycopy arraycopy;303 alias Simp Type!(HANDLE).arraycopy arraycopy;304 alias Simp Type!(IUnknown).arraycopy arraycopy;305 alias Simp Type!(GUID*).arraycopy arraycopy;306 307 308 alias Simp Type!(int[]).arraycopy arraycopy;309 alias Simp Type!(byte[]).arraycopy arraycopy;310 alias Simp Type!(double[]).arraycopy arraycopy;311 alias Simp Type!(float[]).arraycopy arraycopy;312 alias Simp Type!(short[]).arraycopy arraycopy;313 alias Simp Type!(long[]).arraycopy arraycopy;314 alias Simp Type!(uint[]).arraycopy arraycopy;315 alias Simp Type!(ushort[]).arraycopy arraycopy;316 alias Simp Type!(ubyte[]).arraycopy arraycopy;317 alias Simp Type!(ulong[]).arraycopy arraycopy;318 alias Simp Type!(char[]).arraycopy arraycopy;319 alias Simp Type!(wchar[]).arraycopy arraycopy;320 alias Simp Type!(Object[]).arraycopy arraycopy;321 alias Simp Type!(LPVOID[]).arraycopy arraycopy;322 alias Simp Type!(HANDLE[]).arraycopy arraycopy;323 alias Simp Type!(IUnknown[]).arraycopy arraycopy;324 alias Simp Type!(GUID*[]).arraycopy arraycopy;291 alias SimpleType!(int).arraycopy arraycopy; 292 alias SimpleType!(byte).arraycopy arraycopy; 293 alias SimpleType!(double).arraycopy arraycopy; 294 alias SimpleType!(float).arraycopy arraycopy; 295 alias SimpleType!(short).arraycopy arraycopy; 296 alias SimpleType!(long).arraycopy arraycopy; 297 alias SimpleType!(uint).arraycopy arraycopy; 298 alias SimpleType!(ushort).arraycopy arraycopy; 299 alias SimpleType!(ubyte).arraycopy arraycopy; 300 alias SimpleType!(ulong).arraycopy arraycopy; 301 alias SimpleType!(char).arraycopy arraycopy; 302 alias SimpleType!(wchar).arraycopy arraycopy; 303 alias SimpleType!(Object).arraycopy arraycopy; 304 alias SimpleType!(void*).arraycopy arraycopy; 305 alias SimpleType!(HANDLE).arraycopy arraycopy; 306 alias SimpleType!(IUnknown).arraycopy arraycopy; 307 alias SimpleType!(GUID*).arraycopy arraycopy; 308 309 310 alias SimpleType!(int[]).arraycopy arraycopy; 311 alias SimpleType!(byte[]).arraycopy arraycopy; 312 alias SimpleType!(double[]).arraycopy arraycopy; 313 alias SimpleType!(float[]).arraycopy arraycopy; 314 alias SimpleType!(short[]).arraycopy arraycopy; 315 alias SimpleType!(long[]).arraycopy arraycopy; 316 alias SimpleType!(uint[]).arraycopy arraycopy; 317 alias SimpleType!(ushort[]).arraycopy arraycopy; 318 alias SimpleType!(ubyte[]).arraycopy arraycopy; 319 alias SimpleType!(ulong[]).arraycopy arraycopy; 320 alias SimpleType!(char[]).arraycopy arraycopy; 321 alias SimpleType!(wchar[]).arraycopy arraycopy; 322 alias SimpleType!(Object[]).arraycopy arraycopy; 323 alias SimpleType!(LPVOID[]).arraycopy arraycopy; 324 alias SimpleType!(HANDLE[]).arraycopy arraycopy; 325 alias SimpleType!(IUnknown[]).arraycopy arraycopy; 326 alias SimpleType!(GUID*[]).arraycopy arraycopy; 325 327 326 328 } trunk/current/win32/import/dwt/util/vector.d
r76 r92 1 1 /************************************* 2 * Java Vector like array implementation. 3 * 4 * Contributors: Shawn Liu 5 * 6 */ 7 2 8 module dwt.util.vector; 3 9 4 10 private import dwt.dwt; 5 //private import dwt.util.util;6 //private import dwt.string;7 8 9 10 11 11 12 int foo; 12 13 13 // don't use T as simple data type, such as int, char 14 template VecT(T) 15 { 14 15 16 deprecated alias TVector VecT; 17 18 /** 19 * Don't use T as simple data type, such as int, char, 20 */ 21 template TVector(T) 22 { 16 23 static boolean contains(T[] items, T element, boolean byRef = true) { 17 24 18 25 return indexOf(items, element, byRef) >= 0; 26 } 27 28 static void sort (inout T[] items, int function(T a,T b) compareFunc) 29 { 30 assert(compareFunc); 31 32 if(!items.length) return; 33 34 T tmp; 35 boolean notdone=1; 36 int c=0,c2=0; 37 for(;notdone;) 38 { 39 notdone=0; 40 for(c=items.length-1;c>0;c=c2) 41 { 42 c2=c-1; 43 if(compareFunc(items[c],items[c2])<0) 44 { 45 tmp=items[c2]; 46 items[c2]=items[c]; 47 items[c]=tmp; 48 notdone=1; 49 } 50 } 51 } 52 } 53 54 static boolean deleteItems(inout T[] items, int index, int len=1) 55 { 56 if(index<0 || index>=items.length || index+len>items.length) return false; 57 if(len==0) return true; 58 if(len==items.length) 59 { 60 items.length=0; 61 return true; 62 } 63 items=items[0..index]~items[index+len..items.length]; 64 return true; 19 65 } 20 66 … … 34 80 static T remove(inout T[] items, int index) 35 81 { 36 if(items.length == 0) 82 if(items.length == 0) { 37 83 return null; 38 84 } 85 39 86 if(index < 0 || index >= items.length){ 40 DWT.error(__FILE__, __LINE__, "Out of array bounds."); 87 debug{ 88 DWT.error(__FILE__, __LINE__, "Out of array bounds."); 89 } 41 90 return null; 42 91 } … … 61 110 62 111 /** 63 * remove an item from Array, compare the item by reference or content 112 * remove an item from Array, compare the item by reference or content 113 * if T is char[], you may do a string content compare by set byRef to false 64 114 */ 65 115 static int remove(inout T[] items, T item, boolean byRef = true) … … 88 138 static void insert(inout T[] items, T item, int index = -1) 89 139 { 90 if(item is null)91 return;92 93 140 if(index == -1) 94 141 index = items.length; 95 142 96 143 if(index < 0 || index > items.length ){ 97 DWT.error(__FILE__, __LINE__, "Out of array bounds."); 144 debug{ 145 DWT.error(__FILE__, __LINE__, "Out of array bounds."); 146 } 98 147 return; 99 148 } … … 119 168 } 120 169 121 } // end of class VecT(T)170 } // end of class TVector(T) 122 171 123 172 … … 134 183 // Util.printObj(xx, new String("xx")); 135 184 136 VecT!(Object).insert(objs, xx, 2);137 138 139 VecT!(Object).insert(objs, xx);185 TVector!(Object).insert(objs, xx, 2); 186 187 188 TVector!(Object).insert(objs, xx); 140 189 141 190 assert(obj2 is objs[3]); … … 148 197 149 198 150 VecT!(Object).remove(objs, 1);199 TVector!(Object).remove(objs, 1); 151 200 152 201 assert(obj2 is objs[2]); … … 157 206 } 158 207 159 VecT!(Object).remove(objs, xx);208 TVector!(Object).remove(objs, xx); 160 209 161 210 // Util.trace("\ndump 3\n"); … … 172 221 cArr ~= c1; 173 222 cArr ~= c2; 174 VecT!(char[]).insert(cArr, "abcd");223 TVector!(char[]).insert(cArr, "abcd"); 175 224 176 225 assert(cArr[2] == "abcd"); … … 178 227 } 179 228 180 229 /** 230 * Java Vector like array implementation. 231 * Don't use T as simple data type, such as int, char, 232 */ 181 233 class Vector(T) 182 234 { … … 208 260 public void insertElementAt(T element, int index) 209 261 { 210 VecT!(T).insert(_values, element, index);262 TVector!(T).insert(_values, element, index); 211 263 } 212 264 … … 250 302 public void removeElement(T element) 251 303 { 252 VecT!(T).remove(_values, element);304 TVector!(T).remove(_values, element); 253 305 } 254 306 255 307 public T removeElementAt(int index) 256 308 { 257 return VecT!(T).remove(this._values, index);309 return TVector!(T).remove(this._values, index); 258 310 } 259 311 260 312 public T[] values(){ return _values[];} 261 313 314 262 315 public boolean contains(T element) 263 316 { 264 if( cast(int)cast(void*)element == 0) return false;265 266 317 foreach(T t; _values){ 267 318 if(t is element) trunk/current/win32/import/make-dwt-lib.bat
r82 r92 1 1 @echo deleting old intermediate files ... 2 2 3 del *.obj *.map /s /q3 del *.obj *.map *.rsp *.lsp *.ksp *.def /s /q 4 4 5 5 @echo Build release version ... trunk/current/win32/packages/dwt/examples/controlexample/controlexample.d
r76 r92 276 276 */ 277 277 public this(Composite parent) { 278 ResourceManager.registerResourceUser(parent);279 parent.getShell().setImage( ResourceManager.getImage("DLOGO", "BMPFILE"));278 DWTResourceManager.registerResourceUser(parent); 279 parent.getShell().setImage(DWTResourceManager.getImage("DLOGO", "BMPFILE")); 280 280 intStringRes(); 281 281 initResources(); … … 344 344 * Frees the resources 345 345 */ 346 // <Shawn> ResourceManager will freeResources automatically346 // <Shawn> DWTResourceManager will freeResources automatically 347 347 void freeResources() { 348 348 // if (images !is null) { … … 392 392 images = new Image[imageLocations.length]; 393 393 for (int i = 0; i < imageLocations.length; ++i) { 394 images[i] = ResourceManager.getImage(imageLocations[i], "GIFFILE");394 images[i] = DWTResourceManager.getImage(imageLocations[i], "GIFFILE"); 395 395 } 396 396 } trunk/current/win32/packages/dwt/examples/controlexample/styledtexttab.d
r76 r92 47 47 // ImageData mask = new ImageData(name ~ "_mask.bmp"); 48 48 // return new Image (display, source, mask); 49 return ResourceManager.getImage("TARGET", "BMPFILE");49 return DWTResourceManager.getImage("TARGET", "BMPFILE"); 50 50 } 51 51 trunk/current/win32/packages/dwt/examples/dummyeclipse/dummyeclipse.d
r76 r92 51 51 52 52 Display display = getDisplay(); 53 ResourceManager.registerResourceUser(this);53 DWTResourceManager.registerResourceUser(this); 54 54 55 55 // not like java, stores image file in jar file, … … 59 59 gradientColors[2] = null; 60 60 61 this.getShell().setImage( ResourceManager.getImage("SAMPLE", GIFFILE));61 this.getShell().setImage(DWTResourceManager.getImage("SAMPLE", GIFFILE)); 62 62 initGUI(); 63 63 } … … 231 231 cLabel7LData.verticalAlignment = GridData.FILL; 232 232 cLabel7.setText("Properties"); 233 cLabel7.setImage( ResourceManager.getImage("PROP_PS", GIFFILE));233 cLabel7.setImage(DWTResourceManager.getImage("PROP_PS", GIFFILE)); 234 234 cLabel7.setForeground(getDisplay().getSystemColor(DWT.COLOR_WHITE)); 235 235 cLabel7.setLayoutData(cLabel7LData); … … 241 241 242 242 with(new ToolItem(toolBar, DWT.NONE)) { 243 setImage( ResourceManager.getImage("VIEW_MENU", GIFFILE));243 setImage(DWTResourceManager.getImage("VIEW_MENU", GIFFILE)); 244 244 } 245 245 246 246 with(new ToolItem(toolBar, DWT.NONE)) { 247 setImage( ResourceManager.getImage("CLOSE_VIEW", GIFFILE));247 setImage(DWTResourceManager.getImage("CLOSE_VIEW", GIFFILE)); 248 248 } 249 249 … … 359 359 360 360 newToolItem = new ToolItem(toolBar, DWT.DROP_DOWN); 361 newToolItem.setImage( ResourceManager.getImage("NEW_WIZ", GIFFILE));361 newToolItem.setImage(DWTResourceManager.getImage("NEW_WIZ", GIFFILE)); 362 362 363 363 // java like anonymous class, remember to introduce … … 373 373 374 374 ToolItem toolItem6 = new ToolItem(toolBar, DWT.NONE); 375 toolItem6.setImage( ResourceManager.getImage("SAVEAS_EDIT", GIFFILE));375 toolItem6.setImage(DWTResourceManager.getImage("SAVEAS_EDIT", GIFFILE)); 376 376 377 377 ToolItem toolItem5 = new ToolItem(toolBar, DWT.NONE); 378 toolItem5.setImage( ResourceManager.getImage("SAVE_EDIT", GIFFILE));378 toolItem5.setImage(DWTResourceManager.getImage("SAVE_EDIT", GIFFILE)); 379 379 380 380 ToolItem toolItem8 = new ToolItem(toolBar, DWT.NONE); 381 toolItem8.setImage( ResourceManager.getImage("PRINT_EDIT", GIFFILE));381 toolItem8.setImage(DWTResourceManager.getImage("PRINT_EDIT", GIFFILE)); 382 382 383 383 new ToolItem(toolBar, DWT.SEPARATOR); 384 384 385 385 ToolItem toolItem13 = new ToolItem(toolBar, DWT.NONE); 386 toolItem13.setImage( ResourceManager.getImage("BUILD_EXEC", GIFFILE));386 toolItem13.setImage(DWTResourceManager.getImage("BUILD_EXEC", GIFFILE)); 387 387 388 388 389 389 debugToolItem = new ToolItem(toolBar, DWT.DROP_DOWN); 390 390 debugToolItem.handleSelection(this, &debugToolItemWidgetSelected); 391 debugToolItem.setImage( ResourceManager.getImage("DEBUG_EXEC", GIFFILE));391 debugToolItem.setImage(DWTResourceManager.getImage("DEBUG_EXEC", GIFFILE)); 392 392 393 393 runToolItem = new ToolItem(toolBar, DWT.DROP_DOWN); 394 runToolItem.setImage( ResourceManager.getImage("RUN_EXEC", GIFFILE));394 runToolItem.setImage(DWTResourceManager.getImage("RUN_EXEC", GIFFILE)); 395 395 runToolItem.handleSelection(this, &runToolItemWidgetSelected); 396 396 } … … 435 435 cLabel5.setBackground(getDisplay().getSystemColor(DWT.COLOR_WIDGET_BACKGROUND)); 436 436 cLabel5.setText("Hierarchy Test"); 437 cLabel5.setImage( ResourceManager.getImage("SAMPLE", GIFFILE));437 cLabel5.setImage(DWTResourceManager.getImage("SAMPLE", GIFFILE)); 438 438 cLabel5.setLayoutData(cLabel5LData); 439 439 … … 481 481 TreeItem treeItem7 = new TreeItem(tree3, DWT.NONE); 482 482 treeItem7.setText("testPackage"); 483 treeItem7.setImage( ResourceManager.getImage("PACKAGE", GIFFILE));483 treeItem7.setImage(DWTResourceManager.getImage("PACKAGE", GIFFILE)); 484 484 treeItem7.setExpanded(true); 485 485 486 486 TreeItem treeItem8 = new TreeItem(treeItem7, DWT.NONE); 487 487 treeItem8.setText("Class1"); 488 treeItem8.setImage( ResourceManager.getImage("JCU_OBJ", GIFFILE));488 treeItem8.setImage(DWTResourceManager.getImage("JCU_OBJ", GIFFILE)); 489 489 490 490 TreeItem treeItem9 = new TreeItem(treeItem7, DWT.NONE); 491 491 treeItem9.setText("Class2"); 492 treeItem9.setImage( ResourceManager.getImage("JCU_OBJ", GIFFILE));492 treeItem9.setImage(DWTResourceManager.getImage("JCU_OBJ", GIFFILE)); 493 493 494 494 CLabel cLabel4 = new CLabel(composite9, DWT.NONE); … … 498 498 cLabel4LData.grabExcessHorizontalSpace = true; 499 499 cLabel4.setText("Package Explorer"); 500 cLabel4.setImage( ResourceManager.getImage("PACKAGE", GIFFILE));500 cLabel4.setImage(DWTResourceManager.getImage("PACKAGE", GIFFILE)); 501 501 cLabel4.setLayoutData(cLabel4LData); 502 502 … … 506 506 507 507 ToolItem toolItem3 = new ToolItem(toolBar5, DWT.NONE); 508 toolItem3.setImage( ResourceManager.getImage("VIEW_MENU", GIFFILE));508 toolItem3.setImage(DWTResourceManager.getImage("VIEW_MENU", GIFFILE)); 509 509 510 510 ToolItem toolItem4 = new ToolItem(toolBar5, DWT.NONE); 511 toolItem4.setImage( ResourceManager.getImage("close_view", GIFFILE));511 toolItem4.setImage(DWTResourceManager.getImage("close_view", GIFFILE)); 512 512 513 513 cTabFolder_topleft.setSelection(0); … … 522 522 CTabItem cTabItem6 = new CTabItem(cTabFolder_topright, DWT.NONE); 523 523 cTabItem6.setText(" FakeJava.java "); 524 cTabItem6.setImage( ResourceManager.getImage("JCU_OBJ", GIFFILE));524 cTabItem6.setImage(DWTResourceManager.getImage("JCU_OBJ", GIFFILE)); 525 525 526 526 CTabItem cTabItem7 = new CTabItem(cTabFolder_topright, DWT.NONE); 527 527 cTabItem7.setText(" FakeJava.form "); 528 cTabItem7.setImage( ResourceManager.getImage("FORM", GIFFILE));528 cTabItem7.setImage(DWTResourceManager.getImage("FORM", GIFFILE)); 529 529 530 530 ScrolledComposite scrolledComposite1 = new ScrolledComposite( … … 607 607 setText("&Save"); 608 608 handleSelection(this, &onMenuSelected); 609 setImage( ResourceManager.getImage("SAVE", GIFFILE));609 setImage(DWTResourceManager.getImage("SAVE", GIFFILE)); 610 610 } 611 611 // exit trunk/current/win32/packages/dwt/examples/traytest/Traytest.d
r76 r92 160 160 161 161 // Install a timer to animate icons 162 // ResourceManager helps to dispose images when shell disposing163 ResourceManager.registerResourceUser(shell);164 images ~= ResourceManager.getImage("TARGET", "GIFFILE");165 images ~= ResourceManager.getImage("OPENFOLDER", "GIFFILE");166 images ~= ResourceManager.getImage("CLOSEDFOLDER", "GIFFILE");162 // DWTResourceManager helps to dispose images when shell disposing 163 DWTResourceManager.registerResourceUser(shell); 164 images ~= DWTResourceManager.getImage("TARGET", "GIFFILE"); 165 images ~= DWTResourceManager.getImage("OPENFOLDER", "GIFFILE"); 166 images ~= DWTResourceManager.getImage("CLOSEDFOLDER", "GIFFILE"); 167 167 168 168 void delegate(Object) pfunc = &onTimer;
