diff dwtx/jface/text/AbstractInformationControlManager.d @ 161:f8d52b926852

...
author Frank Benoit <benoit@tionex.de>
date Wed, 27 Aug 2008 14:49:30 +0200
parents 3678e4f1a766
children 1a5b8f8129df
line wrap: on
line diff
--- a/dwtx/jface/text/AbstractInformationControlManager.d	Wed Aug 27 02:07:22 2008 +0200
+++ b/dwtx/jface/text/AbstractInformationControlManager.d	Wed Aug 27 14:49:30 2008 +0200
@@ -63,7 +63,7 @@
 import dwtx.jface.text.IDocumentExtension4; // packageimport
 import dwtx.jface.text.IDocumentExtension2; // packageimport
 import dwtx.jface.text.IDocumentPartitionerExtension2; // packageimport
-import dwtx.jface.text.Assert; // packageimport
+// import dwtx.jface.text.Assert; // packageimport
 import dwtx.jface.text.DefaultInformationControl; // packageimport
 import dwtx.jface.text.IWidgetTokenOwnerExtension; // packageimport
 import dwtx.jface.text.DocumentClone; // packageimport
@@ -339,7 +339,11 @@
      * Anchor representing the middle of the subject control
      * @since 2.1
      */
-    public const static Anchor ANCHOR_GLOBAL= new Anchor(DWT.CENTER);
+    public static Anchor ANCHOR_GLOBAL_;
+    public static Anchor ANCHOR_GLOBAL(){
+        if( ANCHOR_GLOBAL_ is null ) ANCHOR_GLOBAL_ = new Anchor(DWT.CENTER);
+        return ANCHOR_GLOBAL_;
+    }
 
     /**
      * Dialog store constant for the location's x-coordinate.
@@ -538,7 +542,7 @@
     protected this(IInformationControlCreator creator) {
         fAnchor= ANCHOR_BOTTOM();
         fFallbackAnchors= ANCHORS();
-        Assert.isNotNull(creator);
+        Assert.isNotNull(cast(Object)creator);
         fInformationControlCreator= creator;
     }
 
@@ -559,7 +563,7 @@
      * @param subjectArea the subject area, or <code>null</code> if none is available
      */
     protected final void setInformation(String information, Rectangle subjectArea) {
-        setInformation(cast(Object)information, subjectArea);
+        setInformation(stringcast(information), subjectArea);
     }
 
     /**
@@ -1182,7 +1186,7 @@
         do {
 
             upperLeft= computeLocation(subjectArea, controlSize, testAnchor);
-            Monitor monitor= getClosestMonitor(subjectAreaDisplayRelative, testAnchor);
+            dwt.widgets.Monitor.Monitor monitor= getClosestMonitor(subjectAreaDisplayRelative, testAnchor);
             if (updateLocation(upperLeft, controlSize, monitor.getClientArea(), testAnchor))
                 return upperLeft;
 
@@ -1216,7 +1220,7 @@
      *         <code>anchor</code>
      * @since 3.3
      */
-    private Monitor getClosestMonitor(Rectangle area, Anchor anchor) {
+    private dwt.widgets.Monitor.Monitor getClosestMonitor(Rectangle area, Anchor anchor) {
         Point center;
         if (ANCHOR_GLOBAL is anchor)
             center= Geometry.centerPoint(area);
@@ -1235,15 +1239,15 @@
      * @return the monitor closest to the given point
      * @since 3.3
      */
-    private Monitor getClosestMonitor(Display display, Rectangle rectangle) {
+    private dwt.widgets.Monitor.Monitor getClosestMonitor(Display display, Rectangle rectangle) {
         int closest = Integer.MAX_VALUE;
 
         Point toFind= Geometry.centerPoint(rectangle);
-        Monitor[] monitors = display.getMonitors();
-        Monitor result = monitors[0];
+        dwt.widgets.Monitor.Monitor[] monitors = display.getMonitors();
+        dwt.widgets.Monitor.Monitor result = monitors[0];
 
         for (int idx = 0; idx < monitors.length; idx++) {
-            Monitor current = monitors[idx];
+            dwt.widgets.Monitor.Monitor current = monitors[idx];
 
             Rectangle clientArea = current.getClientArea();
 
@@ -1288,8 +1292,8 @@
      */
     protected void presentInformation() {
         bool hasContents= false;
-        if ( cast(String)fInformation )
-            hasContents= (cast(String)fInformation).trim().length() > 0;
+        if ( stringcast(fInformation) )
+            hasContents= (stringcast(fInformation)).trim().length() > 0;
         else
             hasContents= (fInformation !is null);