comparison dwt/widgets/Combo.d @ 46:cfa563df4fdd

Updated Widget and Display to 3.514
author Jacob Carlborg <doob@me.com>
date Fri, 05 Dec 2008 16:00:41 +0100
parents d8635bb48c7c
children 10eaa644646f
comparison
equal deleted inserted replaced
45:d8635bb48c7c 46:cfa563df4fdd
403 } 403 }
404 404
405 void createHandle () { 405 void createHandle () {
406 if ((style & DWT.READ_ONLY) !is 0) { 406 if ((style & DWT.READ_ONLY) !is 0) {
407 NSPopUpButton widget = cast(NSPopUpButton)new SWTPopUpButton().alloc(); 407 NSPopUpButton widget = cast(NSPopUpButton)new SWTPopUpButton().alloc();
408 widget.initWithFrame(new NSRect(), false); 408 widget.initWithFrame(NSRect(), false);
409 widget.menu().setAutoenablesItems(false); 409 widget.menu().setAutoenablesItems(false);
410 widget.setTarget(widget); 410 widget.setTarget(widget);
411 widget.setAction(OS.sel_sendSelection); 411 widget.setAction(OS.sel_sendSelection);
412 view = widget; 412 view = widget;
413 } else { 413 } else {
414 NSComboBox widget = cast(NSComboBox)new SWTComboBox().alloc(); 414 NSComboBox widget = cast(NSComboBox)new SWTComboBox().alloc();
415 widget.initWithFrame(new NSRect()); 415 widget.initWithFrame(NSRect());
416 widget.setDelegate(widget); 416 widget.setDelegate(widget);
417 view = widget; 417 view = widget;
418 } 418 }
419 } 419 }
420 420
1564 * text will be automatically selected. 1564 * text will be automatically selected.
1565 */ 1565 */
1566 if (receivingFocus && selectionRange !is null) return selectionRange; 1566 if (receivingFocus && selectionRange !is null) return selectionRange;
1567 1567
1568 /* allow the selection change to proceed */ 1568 /* allow the selection change to proceed */
1569 NSRange result = new NSRange(); 1569 NSRange result = NSRange();
1570 OS.memmove(result, newSelectedCharRange, NSRange.sizeof); 1570 OS.memmove(result, newSelectedCharRange, NSRange.sizeof);
1571 return result; 1571 return result;
1572 } 1572 }
1573 1573
1574 String verifyText (String string, int start, int end, NSEvent keyEvent) { 1574 String verifyText (String string, int start, int end, NSEvent keyEvent) {