diff 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
line wrap: on
line diff
--- a/dwtx/jface/window/ToolTip.d	Thu May 22 01:36:46 2008 +0200
+++ b/dwtx/jface/window/ToolTip.d	Thu May 22 04:03:58 2008 +0200
@@ -121,19 +121,19 @@
         });
 
         this.listener = new ToolTipOwnerControlListener();
-        this.shellListener = new Listener() {
+        this.shellListener = new class Listener {
             public void handleEvent(final Event event) {
-                if( ToolTip.this.control !is null && ! ToolTip.this.control.isDisposed() ) {
-                    ToolTip.this.control.getDisplay().asyncExec(new Runnable() {
+                if( this.outer.control !is null && ! this.outer.control.isDisposed() ) {
+                    this.outer.control.getDisplay().asyncExec(new class Runnable {
 
                         public void run() {
                             // Check if the new active shell is the tooltip itself
-                            if( ToolTip.this.control.getDisplay().getActiveShell() !is CURRENT_TOOLTIP) {
+                            if( this.outer.control.getDisplay().getActiveShell() !is CURRENT_TOOLTIP) {
                                 toolTipHide(CURRENT_TOOLTIP, event);
                             }
                         }
-                        
-                    });                 
+
+                    });
                 }
             }
         };
@@ -458,10 +458,10 @@
 
     private void passOnEvent(Shell tip,Event event) {
         if ( control !is null && ! control.isDisposed() && event !is null && event.widget !is control && event.type is DWT.MouseDown) {
-            final Display display = control.getDisplay();
+            Display display = control.getDisplay();
             Point newPt = display.map(tip, null, new Point(event.x, event.y));
 
-            final Event newEvent = new Event();
+            Event newEvent = new Event();
             newEvent.button=event.button;
             newEvent.character=event.character;
             newEvent.count = event.count;
@@ -486,20 +486,26 @@
             newEvent.y = newPt.y;
 
             tip.close();
-            display.asyncExec(new Runnable() {
+            display.asyncExec(new class(display,newEvent) Runnable {
+                Display display_;
+                Event newEvent_;
+                this( Display a, Event b ){
+                    display_=a;
+                    newEvent_=b;
+                }
                 public void run() {
                     if( IS_OSX ) {
                         try {
-                            Thread.sleep(300);
+                            Thread.sleep(0.300);
                         } catch (InterruptedException e) {
 
                         }
 
-                        display.post(newEvent);
-                        newEvent.type = DWT.MouseUp;
-                        display.post(newEvent);
+                        display_.post(newEvent_);
+                        newEvent_.type = DWT.MouseUp;
+                        display_.post(newEvent_);
                     } else {
-                        display.post(newEvent);
+                        display_.post(newEvent_);
                     }
                 }
             });