comparison dwtx/jface/window/ToolTip.d @ 71:4878bef4a38e

Some fixing
author Frank Benoit <benoit@tionex.de>
date Thu, 22 May 2008 04:03:58 +0200
parents 46a6e0e6ccd4
children 5df4896124c7
comparison
equal deleted inserted replaced
70:46a6e0e6ccd4 71:4878bef4a38e
119 } 119 }
120 120
121 }); 121 });
122 122
123 this.listener = new ToolTipOwnerControlListener(); 123 this.listener = new ToolTipOwnerControlListener();
124 this.shellListener = new Listener() { 124 this.shellListener = new class Listener {
125 public void handleEvent(final Event event) { 125 public void handleEvent(final Event event) {
126 if( ToolTip.this.control !is null && ! ToolTip.this.control.isDisposed() ) { 126 if( this.outer.control !is null && ! this.outer.control.isDisposed() ) {
127 ToolTip.this.control.getDisplay().asyncExec(new Runnable() { 127 this.outer.control.getDisplay().asyncExec(new class Runnable {
128 128
129 public void run() { 129 public void run() {
130 // Check if the new active shell is the tooltip itself 130 // Check if the new active shell is the tooltip itself
131 if( ToolTip.this.control.getDisplay().getActiveShell() !is CURRENT_TOOLTIP) { 131 if( this.outer.control.getDisplay().getActiveShell() !is CURRENT_TOOLTIP) {
132 toolTipHide(CURRENT_TOOLTIP, event); 132 toolTipHide(CURRENT_TOOLTIP, event);
133 } 133 }
134 } 134 }
135 135
136 }); 136 });
137 } 137 }
138 } 138 }
139 }; 139 };
140 140
141 if (!manualActivation) { 141 if (!manualActivation) {
456 } 456 }
457 } 457 }
458 458
459 private void passOnEvent(Shell tip,Event event) { 459 private void passOnEvent(Shell tip,Event event) {
460 if ( control !is null && ! control.isDisposed() && event !is null && event.widget !is control && event.type is DWT.MouseDown) { 460 if ( control !is null && ! control.isDisposed() && event !is null && event.widget !is control && event.type is DWT.MouseDown) {
461 final Display display = control.getDisplay(); 461 Display display = control.getDisplay();
462 Point newPt = display.map(tip, null, new Point(event.x, event.y)); 462 Point newPt = display.map(tip, null, new Point(event.x, event.y));
463 463
464 final Event newEvent = new Event(); 464 Event newEvent = new Event();
465 newEvent.button=event.button; 465 newEvent.button=event.button;
466 newEvent.character=event.character; 466 newEvent.character=event.character;
467 newEvent.count = event.count; 467 newEvent.count = event.count;
468 newEvent.data=event.data; 468 newEvent.data=event.data;
469 newEvent.detail=event.detail; 469 newEvent.detail=event.detail;
484 newEvent.width=event.width; 484 newEvent.width=event.width;
485 newEvent.x = newPt.x; 485 newEvent.x = newPt.x;
486 newEvent.y = newPt.y; 486 newEvent.y = newPt.y;
487 487
488 tip.close(); 488 tip.close();
489 display.asyncExec(new Runnable() { 489 display.asyncExec(new class(display,newEvent) Runnable {
490 Display display_;
491 Event newEvent_;
492 this( Display a, Event b ){
493 display_=a;
494 newEvent_=b;
495 }
490 public void run() { 496 public void run() {
491 if( IS_OSX ) { 497 if( IS_OSX ) {
492 try { 498 try {
493 Thread.sleep(300); 499 Thread.sleep(0.300);
494 } catch (InterruptedException e) { 500 } catch (InterruptedException e) {
495 501
496 } 502 }
497 503
498 display.post(newEvent); 504 display_.post(newEvent_);
499 newEvent.type = DWT.MouseUp; 505 newEvent_.type = DWT.MouseUp;
500 display.post(newEvent); 506 display_.post(newEvent_);
501 } else { 507 } else {
502 display.post(newEvent); 508 display_.post(newEvent_);
503 } 509 }
504 } 510 }
505 }); 511 });
506 } 512 }
507 } 513 }