comparison dwt/widgets/Menu.d @ 37:642f460a0908

Fixed a lot of compile errors, a "hello world" app compiles now
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Fri, 10 Oct 2008 12:29:48 +0200
parents db5a898b2119
children d8635bb48c7c
comparison
equal deleted inserted replaced
36:db5a898b2119 37:642f460a0908
218 location.x = shellCoord.x; 218 location.x = shellCoord.x;
219 location.y = topView.frame().height - shellCoord.y; 219 location.y = topView.frame().height - shellCoord.y;
220 } else { 220 } else {
221 location = window.mouseLocationOutsideOfEventStream(); 221 location = window.mouseLocationOutsideOfEventStream();
222 } 222 }
223 NSEvent nsEvent = NSEvent.otherEventWithType(OS.NSApplicationDefined, location, 0, 0.0, window.windowNumber(), window.graphicsContext(), cast(short)0, 0, 0); 223 NSEvent nsEvent = NSEvent.otherEventWithType(NSApplicationDefined, location, 0, 0.0, window.windowNumber(), window.graphicsContext(), cast(short)0, 0, 0);
224 NSMenu.static_popUpContextMenu_withEvent_forView_ (nsMenu, nsEvent, shell.view); 224 NSMenu.static_popUpContextMenu_withEvent_forView_ (nsMenu, nsEvent, shell.view);
225 } else { 225 } else {
226 nsMenu.cancelTracking (); 226 nsMenu.cancelTracking ();
227 } 227 }
228 } 228 }
462 } 462 }
463 463
464 String getNameText () { 464 String getNameText () {
465 String result = ""; 465 String result = "";
466 MenuItem [] items = getItems (); 466 MenuItem [] items = getItems ();
467 int length = items.length; 467 int length_ = items.length;
468 if (length > 0) { 468 if (length_ > 0) {
469 for (int i=0; i<length-1; i++) { 469 for (int i=0; i<length_-1; i++) {
470 result = result + items [i].getNameText() + ", "; 470 result = result ~ items [i].getNameText() ~ ", ";
471 } 471 }
472 result = result + items [length-1].getNameText (); 472 result = result ~ items [length_-1].getNameText ();
473 } 473 }
474 return result; 474 return result;
475 } 475 }
476 476
477 /** 477 /**
646 public bool isVisible () { 646 public bool isVisible () {
647 checkWidget (); 647 checkWidget ();
648 return getVisible (); 648 return getVisible ();
649 } 649 }
650 650
651 void menu_willHighlightItem(int menu, int itemID) { 651 void menu_willHighlightItem(int menu, objc.id itemID) {
652 NSInteger jniRef = cast(NSInteger) OS.objc_msgSend(itemID, OS.sel_tag); 652 NSInteger jniRef = cast(NSInteger) OS.objc_msgSend(itemID, OS.sel_tag);
653 if (jniRef !is -1 && jniRef !is 0) { 653 if (jniRef !is -1 && jniRef !is 0) {
654 Object object = OS.JNIGetObject(jniRef); 654 Object object = OS.JNIGetObject(jniRef);
655 if ( null !is cast(MenuItem)object ) { 655 if ( null !is cast(MenuItem)object ) {
656 MenuItem item = cast(MenuItem)object; 656 MenuItem item = cast(MenuItem)object;