changeset 123:63a09873578e

Fixed compile errors
author Jacob Carlborg <doob@me.com>
date Thu, 15 Jan 2009 23:08:54 +0100
parents 2e671fa40eec
children 540fa4e9974a
files dsss.conf dwt/accessibility/ACC.d dwt/accessibility/Accessible.d dwt/accessibility/AccessibleAdapter.d dwt/accessibility/AccessibleControlAdapter.d dwt/accessibility/AccessibleControlEvent.d dwt/accessibility/AccessibleControlListener.d dwt/accessibility/AccessibleEvent.d dwt/accessibility/AccessibleListener.d dwt/accessibility/AccessibleTextAdapter.d dwt/accessibility/AccessibleTextEvent.d dwt/accessibility/AccessibleTextListener.d dwt/accessibility/SWTAccessibleDelegate.d dwt/custom/CCombo.d dwt/custom/TableTreeEditor.d dwt/custom/TreeEditor.d dwt/dnd/DND.d dwt/dwthelper/array.d dwt/dwthelper/utils.d dwt/internal/c/Carbon.d dwt/internal/c/bindings.d dwt/internal/c/gl.d dwt/internal/cocoa/NSDatePicker.d dwt/internal/cocoa/NSFileManager.d dwt/internal/cocoa/NSImageCell.d dwt/internal/cocoa/NSImageView.d dwt/internal/cocoa/NSKeyValueObserving.d dwt/internal/cocoa/NSNumberFormatter.d dwt/internal/cocoa/NSPrintPanel.d dwt/internal/cocoa/NSPropertyListFormat.d dwt/internal/cocoa/NSTabView.d dwt/internal/cocoa/NSTabViewItem.d dwt/internal/cocoa/NSTableView.d dwt/internal/cocoa/NSWorkspace.d dwt/internal/cocoa/OS.d dwt/internal/cocoa/SWTDragSourceDelegate.d dwt/internal/objc/cocoa/Cocoa.d dwt/internal/objc/cocoa/bindings.d dwt/widgets/Button.d dwt/widgets/Combo.d dwt/widgets/Control.d dwt/widgets/CoolBar.d dwt/widgets/CoolItem.d dwt/widgets/DateTime.d dwt/widgets/DirectoryDialog.d dwt/widgets/Display.d dwt/widgets/ExpandBar.d dwt/widgets/ExpandItem.d dwt/widgets/FileDialog.d dwt/widgets/Group.d dwt/widgets/Label.d dwt/widgets/Link.d dwt/widgets/List.d dwt/widgets/ProgressBar.d dwt/widgets/Sash.d dwt/widgets/Scale.d dwt/widgets/Scrollable.d dwt/widgets/Shell.d dwt/widgets/Slider.d dwt/widgets/Spinner.d dwt/widgets/TabFolder.d dwt/widgets/TabItem.d dwt/widgets/Table.d dwt/widgets/TableColumn.d dwt/widgets/TableItem.d dwt/widgets/Text.d dwt/widgets/ToolBar.d dwt/widgets/ToolItem.d dwt/widgets/ToolTip.d dwt/widgets/Tracker.d dwt/widgets/Tree.d dwt/widgets/TreeColumn.d dwt/widgets/TreeItem.d dwt/widgets/Widget.d
diffstat 74 files changed, 1824 insertions(+), 1847 deletions(-) [+]
line wrap: on
line diff
--- a/dsss.conf	Wed Dec 31 21:01:13 2008 +0100
+++ b/dsss.conf	Thu Jan 15 23:08:54 2009 +0100
@@ -1,2 +1,8 @@
 [dwt]
-buildflags+=-framework Cocoa -framework Carbon
\ No newline at end of file
+version (GDC){
+    buildflags+=-framework Cocoa -framework Carbon
+}
+
+version (LDC){
+    buildflags+=-L-framework=Cocoa -L-framework=Carbon
+}
\ No newline at end of file
--- a/dwt/accessibility/ACC.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/accessibility/ACC.d	Thu Jan 15 23:08:54 2009 +0100
@@ -39,7 +39,7 @@
     public static const int STATE_OFFSCREEN = 0x10000;
     public static const int STATE_SIZEABLE = 0x20000;
     public static const int STATE_LINKED = 0x400000;
-
+    
     public static const int ROLE_CLIENT_AREA = 0xa;
     public static const int ROLE_WINDOW = 0x9;
     public static const int ROLE_MENUBAR = 0x2;
@@ -71,11 +71,11 @@
     public static const int ROLE_PROGRESSBAR = 0x30;
     public static const int ROLE_SLIDER = 0x33;
     public static const int ROLE_LINK = 0x1e;
-
+    
     public static const int CHILDID_SELF = -1;
     public static const int CHILDID_NONE = -2;
     public static const int CHILDID_MULTIPLE = -3;
-
+    
     public static const int TEXT_INSERT = 0;
     public static const int TEXT_DELETE = 1;
 }
--- a/dwt/accessibility/Accessible.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/accessibility/Accessible.d	Thu Jan 15 23:08:54 2009 +0100
@@ -73,27 +73,27 @@
  * @since 2.0
  */
 public class Accessible {
-
+    
     static NSString[] baseAttributes;
-
+    
     static NSString[] baseTextAttributes;
     
     static NSString[] baseParameterizedAttributes;
     
-
+    
     NSMutableArray attributeNames = null;
     NSMutableArray parameterizedAttributeNames = null;
     NSMutableArray actionNames = null;
-
+    
     AccessibleListener[] accessibleListeners;
     AccessibleControlListener[] accessibleControlListeners;
     AccessibleTextListener[] accessibleTextListeners;
     Control control;
-
+    
     HashMap!(int, SWTAccessibleDelegate) children;
     
     this (Control control) {
-    
+        
         this.control = control;
         
         baseAttributes = [ 
@@ -107,7 +107,7 @@
                           OS.NSAccessibilitySizeAttribute,
                           OS.NSAccessibilityWindowAttribute,
                           OS.NSAccessibilityTopLevelUIElementAttribute
-                      ];
+                          ];
         
         baseTextAttributes = [
                               OS.NSAccessibilityNumberOfCharactersAttribute,
@@ -117,12 +117,12 @@
                               OS.NSAccessibilitySelectedTextRangesAttribute,
                               OS.NSAccessibilityVisibleCharacterRangeAttribute,
                               OS.NSAccessibilityValueAttribute
-                          ];
+                              ];
         
         baseParameterizedAttributes = [
                                        OS.NSAccessibilityStringForRangeParameterizedAttribute,
                                        OS.NSAccessibilityRangeForLineParameterizedAttribute
-                                   ];
+                                       ];
     }
     
     /**
@@ -141,7 +141,7 @@
 	public static Accessible internal_new_Accessible(Control control) {
 		return new Accessible(control);
 	}
-
+    
     /**
      * Adds the listener to the collection of listeners who will
      * be notified when an accessible client asks for certain strings,
@@ -168,7 +168,7 @@
         if (listener is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
         accessibleListeners.addElement(listener);
     }
-
+    
     /**
      * Adds the listener to the collection of listeners who will
      * be notified when an accessible client asks for custom control
@@ -195,7 +195,7 @@
         if (listener is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
         accessibleControlListeners.addElement(listener);
     }
-
+    
     /**
      * Adds the listener to the collection of listeners who will
      * be notified when an accessible client asks for custom text control
@@ -229,7 +229,7 @@
         // TODO No action support for now.
         return NSString.stringWith("");
     }
-
+    
     public NSArray internal_accessibilityActionNames(int childID) {
         // The supported action list depends on the role played by the control.
         AccessibleControlEvent event = new AccessibleControlEvent(this);
@@ -239,7 +239,7 @@
             AccessibleControlListener listener = elementAt(accessibleControlListeners, i);
             listener.getRole(event);
         }
-
+        
         // No accessible listener is overriding the role of the control, so let Cocoa return the default set for the control.
         if (event.detail is -1) {
             return null;
@@ -252,21 +252,21 @@
         NSMutableArray returnValue = NSMutableArray.arrayWithCapacity(5);
         
         switch (event.detail) {
-        case ACC.ROLE_PUSHBUTTON:
-        case ACC.ROLE_RADIOBUTTON:
-        case ACC.ROLE_CHECKBUTTON:
-        case ACC.ROLE_TABITEM:
-            returnValue.addObject(OS.NSAccessibilityPressAction);
-            break;
+            case ACC.ROLE_PUSHBUTTON:
+            case ACC.ROLE_RADIOBUTTON:
+            case ACC.ROLE_CHECKBUTTON:
+            case ACC.ROLE_TABITEM:
+                returnValue.addObject(OS.NSAccessibilityPressAction);
+                break;
         }
-
+        
         switch (event.detail) {
-        case ACC.ROLE_COMBOBOX:
-            returnValue.addObject(OS.NSAccessibilityConfirmAction);
-            break;
+            case ACC.ROLE_COMBOBOX:
+                returnValue.addObject(OS.NSAccessibilityConfirmAction);
+                break;
         }
-
-
+        
+        
         if (childID is ACC.CHILDID_SELF) {
             actionNames = returnValue;
             actionNames.retain();
@@ -276,7 +276,7 @@
             return returnValue;
         }
     }
-
+    
     public NSArray internal_accessibilityAttributeNames(int childID) {
         // The supported attribute set depends on the role played by the control.
         // We may need to add or remove from the base set as needed.
@@ -287,7 +287,7 @@
             AccessibleControlListener listener = accessibleControlListeners.elementAt(i);
             listener.getRole(event);
         }
-
+        
         // No accessible listener is overriding the role of the control, so let Cocoa
         // return the default set for the control.
         if (event.detail is -1)
@@ -298,7 +298,7 @@
         }
         
         NSMutableArray returnValue = NSMutableArray.arrayWithCapacity(baseAttributes.length);
-
+        
         /* Add our list of supported attributes to the array.
          * Make sure each attribute name is not already in the array before appending.
          */
@@ -318,37 +318,37 @@
         
         // The following are expected to have a value (AXValue)
         switch (event.detail) {
-        case ACC.ROLE_CHECKBUTTON:
-        case ACC.ROLE_RADIOBUTTON:
-        case ACC.ROLE_LABEL:
-        case ACC.ROLE_TABITEM:
-        case ACC.ROLE_TABFOLDER:
-            returnValue.addObject(OS.NSAccessibilityValueAttribute);
-            break;
+            case ACC.ROLE_CHECKBUTTON:
+            case ACC.ROLE_RADIOBUTTON:
+            case ACC.ROLE_LABEL:
+            case ACC.ROLE_TABITEM:
+            case ACC.ROLE_TABFOLDER:
+                returnValue.addObject(OS.NSAccessibilityValueAttribute);
+                break;
         }
         
         // The following are expected to report their enabled status (AXEnabled)
         switch (event.detail) {
-        case ACC.ROLE_CHECKBUTTON:
-        case ACC.ROLE_RADIOBUTTON:
-        case ACC.ROLE_LABEL:
-        case ACC.ROLE_TABITEM:
-        case ACC.ROLE_PUSHBUTTON:
-        case ACC.ROLE_COMBOBOX:
-            returnValue.addObject(OS.NSAccessibilityEnabledAttribute);
-            break;
+            case ACC.ROLE_CHECKBUTTON:
+            case ACC.ROLE_RADIOBUTTON:
+            case ACC.ROLE_LABEL:
+            case ACC.ROLE_TABITEM:
+            case ACC.ROLE_PUSHBUTTON:
+            case ACC.ROLE_COMBOBOX:
+                returnValue.addObject(OS.NSAccessibilityEnabledAttribute);
+                break;
         }
         
         // The following are expected to report a title (AXTitle)
         switch (event.detail) {
-        case ACC.ROLE_CHECKBUTTON:
-        case ACC.ROLE_RADIOBUTTON:
-        case ACC.ROLE_PUSHBUTTON:
-        case ACC.ROLE_TABITEM:
-            returnValue.addObject(OS.NSAccessibilityTitleAttribute);
-            break;
+            case ACC.ROLE_CHECKBUTTON:
+            case ACC.ROLE_RADIOBUTTON:
+            case ACC.ROLE_PUSHBUTTON:
+            case ACC.ROLE_TABITEM:
+                returnValue.addObject(OS.NSAccessibilityTitleAttribute);
+                break;
         }
-            
+        
         // Accessibility verifier says these attributes must be reported for combo boxes.
         if (event.detail is ACC.ROLE_COMBOBOX) {
             returnValue.addObject(OS.NSAccessibilityExpandedAttribute);
@@ -359,7 +359,7 @@
             returnValue.addObject(OS.NSAccessibilityContentsAttribute);
             returnValue.addObject(OS.NSAccessibilityTabsAttribute);
         }
-
+        
         /*
          * Only report back sub-roles when the DWT role maps to a sub-role.
          */
@@ -369,7 +369,7 @@
             if (dwt.dwthelper.utils.indexOf(osRole, ':') is -1)
                 returnValue.removeObject(OS.NSAccessibilitySubroleAttribute);
         }
-
+        
         /*
          * Children never return their own children, so remove that attribute.
          */
@@ -386,7 +386,7 @@
             return returnValue;
         }
     }
-
+    
     public cocoa.id internal_accessibilityAttributeValue(NSString attribute, int childID) {
         if (attribute.isEqualToString(OS.NSAccessibilityRoleAttribute)) return getRoleAttribute(childID);
         if (attribute.isEqualToString(OS.NSAccessibilitySubroleAttribute)) return getSubroleAttribute(childID);
@@ -423,7 +423,7 @@
         if (attribute.isEqualToString(OS.NSAccessibilityRangeForLineParameterizedAttribute)) return getRangeForLineParameterizedAttribute(parameter, childID);      
         return null;
     }
-
+    
     // Returns the UI Element that has the focus. You can assume that the search for the focus has already been narrowed down to the receiver.
     // Override this method to do a deeper search with a UIElement - e.g. a NSMatrix would determine if one of its cells has the focus.
     public cocoa.id internal_accessibilityFocusedUIElement(int childID) {
@@ -448,10 +448,10 @@
         if (event.childID is ACC.CHILDID_SELF || event.childID is ACC.CHILDID_NONE) {
             return new cocoa.id(OS.NSAccessibilityUnignoredAncestor(control.view.id));
         }   
-
+        
         return new cocoa.id(OS.NSAccessibilityUnignoredAncestor(childIDToOs(event.childID).id));
     }
-
+    
     // Returns the deepest descendant of the UIElement hierarchy that contains the point. 
     // You can assume the point has already been determined to lie within the receiver.
     // Override this method to do deeper hit testing within a UIElement - e.g. a NSMatrix would test its cells. The point is bottom-left relative screen coordinates.
@@ -460,7 +460,7 @@
         event.x = cast(int) point.x;
         dwt.widgets.Monitor.Monitor primaryMonitor = Display.getCurrent().getPrimaryMonitor();
         event.y = cast(int) (primaryMonitor.getBounds().height - point.y);
-    
+        
         // Set an impossible value to determine if anything responded to the event.
         event.childID = ACC.CHILDID_MULTIPLE;
         for (int i = 0; i < accessibleControlListeners.size(); i++) {
@@ -475,41 +475,41 @@
         if (event.accessible !is null) {
             return new cocoa.id(OS.NSAccessibilityUnignoredAncestor(event.accessible.control.view.id));
         }
-    
+        
         if (event.childID is ACC.CHILDID_SELF || event.childID is ACC.CHILDID_NONE) {
             return new cocoa.id(OS.NSAccessibilityUnignoredAncestor(control.view.id));
         }
-    
+        
         return new cocoa.id(OS.NSAccessibilityUnignoredAncestor(childIDToOs(event.childID).id));
     }
-
+    
     public bool internal_accessibilityIsAttributeSettable(NSString attribute, int childID) {
         return false;
     }
-
+    
     // Return YES if the UIElement doesn't show up to the outside world - i.e. its parent should return the UIElement's children as its own - cutting the UIElement out. E.g. NSControls are ignored when they are single-celled.
     public bool internal_accessibilityIsIgnored(int childID) {
         return false;
     }
-
+    
     // parameterized attribute methods
     public NSArray internal_accessibilityParameterizedAttributeNames(int childID) {
-
+        
         if ((childID is ACC.CHILDID_SELF) && (parameterizedAttributeNames !is null)) {
             return retainedAutoreleased(parameterizedAttributeNames);
         }
-
+        
         NSMutableArray returnValue = NSMutableArray.arrayWithCapacity(4);
-
+        
         if (accessibleTextListeners.size() > 0) {
             for (int i = 0; i < baseParameterizedAttributes.length; i++) {
                 if (!returnValue.containsObject(baseParameterizedAttributes[i])) {
                     returnValue.addObject(baseParameterizedAttributes[i]);
                 }
             }
-
+            
         }
-
+        
         if (childID is ACC.CHILDID_SELF) {
             parameterizedAttributeNames = returnValue;
             parameterizedAttributeNames.retain();
@@ -519,12 +519,12 @@
             return returnValue;
         }
     }
-
+    
     public void internal_accessibilityPerformAction(NSString action, int childID) {
         // TODO Auto-generated method stub
         // No action support for now.
     }
-
+    
     /**
      * Returns the control for this Accessible object. 
      *
@@ -534,7 +534,7 @@
     public Control getControl() {
         return control;
     }
-
+    
     /**
      * Invokes platform specific functionality to dispose an accessible object.
      * <p>
@@ -554,7 +554,7 @@
         parameterizedAttributeNames = null;        
         
         foreach (childDelegate ; children)
-            childDelegate.internal_dispose_SWTAccessibleDelegate();
+        childDelegate.internal_dispose_SWTAccessibleDelegate();
         
         children.clear();
     }
@@ -563,7 +563,7 @@
         // TODO: May need to expand the API so the combo box state can be reported.
         return NSNumber.numberWithBool(false);
     }
-
+    
     cocoa.id getHelpAttribute (int childID) {
         cocoa.id returnValue = null;
         AccessibleEvent event = new AccessibleEvent(this);
@@ -595,7 +595,7 @@
             if (index !is -1) appRole = appRole.substring(0, index);
             returnValue = NSString.stringWith(appRole);
         }
-
+        
         return returnValue;
     }
     
@@ -650,9 +650,9 @@
         cocoa.id returnValue = null;//NSString.stringWith("");
         
         /*
-        * Feature of the Macintosh.  The text of a Label is returned in its value,
-        * not its title, so ensure that the role is not Label before asking for the title.
-        */
+         * Feature of the Macintosh.  The text of a Label is returned in its value,
+         * not its title, so ensure that the role is not Label before asking for the title.
+         */
         AccessibleControlEvent roleEvent = new AccessibleControlEvent(this);
         roleEvent.childID = childID;
         roleEvent.detail = -1;
@@ -688,65 +688,65 @@
         }
         int role = event.detail;
         String value = event.result;
-
+        
         switch (role) {
-        case ACC.ROLE_RADIOBUTTON: // 1 = on, 0 = off
-        case ACC.ROLE_CHECKBUTTON: // 1 = checked, 0 = unchecked, 2 = mixed
-        case ACC.ROLE_SCROLLBAR: // numeric value representing the position of the scroller
-        case ACC.ROLE_SLIDER: // the value associated with the position of the slider thumb
-        case ACC.ROLE_PROGRESSBAR: // the value associated with the fill level of the progress bar
-            if (value !is null) {
-                try {
-                    int number = Integer.parseInt(value);
-                    returnValue = NSNumber.numberWithInt(number);
-                } catch (NumberFormatException ex) {
-                    if (value.equalsIgnoreCase("true")) {
-                        returnValue = NSNumber.numberWithBool(true);
-                    } else if (value.equalsIgnoreCase("false")) {
-                        returnValue = NSNumber.numberWithBool(false);
+            case ACC.ROLE_RADIOBUTTON: // 1 = on, 0 = off
+            case ACC.ROLE_CHECKBUTTON: // 1 = checked, 0 = unchecked, 2 = mixed
+            case ACC.ROLE_SCROLLBAR: // numeric value representing the position of the scroller
+            case ACC.ROLE_SLIDER: // the value associated with the position of the slider thumb
+            case ACC.ROLE_PROGRESSBAR: // the value associated with the fill level of the progress bar
+                if (value !is null) {
+                    try {
+                        int number = Integer.parseInt(value);
+                        returnValue = NSNumber.numberWithInt(number);
+                    } catch (NumberFormatException ex) {
+                        if (value.equalsIgnoreCase("true")) {
+                            returnValue = NSNumber.numberWithBool(true);
+                        } else if (value.equalsIgnoreCase("false")) {
+                            returnValue = NSNumber.numberWithBool(false);
+                        }
                     }
+                } else {
+                    returnValue = NSNumber.numberWithBool(false);
+                }
+                break;
+            case ACC.ROLE_TABFOLDER: // the accessibility object representing the currently selected tab item
+            case ACC.ROLE_TABITEM:  // 1 = selected, 0 = not selected
+                AccessibleControlEvent ace = new AccessibleControlEvent(this);
+                ace.childID = -4;
+                for (int i = 0; i < accessibleControlListeners.size(); i++) {
+                    AccessibleControlListener listener = accessibleControlListeners.elementAt(i);
+                    listener.getSelection(ace);
                 }
-            } else {
-                returnValue = NSNumber.numberWithBool(false);
-            }
-            break;
-        case ACC.ROLE_TABFOLDER: // the accessibility object representing the currently selected tab item
-        case ACC.ROLE_TABITEM:  // 1 = selected, 0 = not selected
-            AccessibleControlEvent ace = new AccessibleControlEvent(this);
-            ace.childID = -4;
-            for (int i = 0; i < accessibleControlListeners.size(); i++) {
-                AccessibleControlListener listener = accessibleControlListeners.elementAt(i);
-                listener.getSelection(ace);
-            }
-            if (ace.childID >= ACC.CHILDID_SELF) {
-                if (role is ACC.ROLE_TABITEM) {
-                    returnValue = NSNumber.numberWithBool(ace.childID is childID);
+                if (ace.childID >= ACC.CHILDID_SELF) {
+                    if (role is ACC.ROLE_TABITEM) {
+                        returnValue = NSNumber.numberWithBool(ace.childID is childID);
+                    } else {
+                        returnValue = new cocoa.id(OS.NSAccessibilityUnignoredAncestor(childIDToOs(ace.childID).id));
+                    }
                 } else {
-                    returnValue = new cocoa.id(OS.NSAccessibilityUnignoredAncestor(childIDToOs(ace.childID).id));
+                    returnValue = NSNumber.numberWithBool(false);               
                 }
-            } else {
-                returnValue = NSNumber.numberWithBool(false);               
-            }
-            break;
-        case ACC.ROLE_COMBOBOX: // text of the currently selected item
-        case ACC.ROLE_TEXT: // text in the text field
-            if (value !is null) returnValue = NSString.stringWith(value);
-            break;
-        case ACC.ROLE_LABEL: // text in the label
-            /* On a Mac, the 'value' of a label is the same as the 'name' of the label. */
-            AccessibleEvent e = new AccessibleEvent(this);
-            e.childID = childID;
-            e.result = null;
-            for (int i = 0; i < accessibleListeners.size(); i++) {
-                AccessibleListener listener = accessibleListeners.elementAt(i);
-                listener.getName(e);
-            }
-            if (e.result !is null) {
-                returnValue = NSString.stringWith(e.result);
-            } else {
+                break;
+            case ACC.ROLE_COMBOBOX: // text of the currently selected item
+            case ACC.ROLE_TEXT: // text in the text field
                 if (value !is null) returnValue = NSString.stringWith(value);
-            }
-            break;
+                break;
+            case ACC.ROLE_LABEL: // text in the label
+                /* On a Mac, the 'value' of a label is the same as the 'name' of the label. */
+                AccessibleEvent e = new AccessibleEvent(this);
+                e.childID = childID;
+                e.result = null;
+                for (int i = 0; i < accessibleListeners.size(); i++) {
+                    AccessibleListener listener = accessibleListeners.elementAt(i);
+                    listener.getName(e);
+                }
+                if (e.result !is null) {
+                    returnValue = NSString.stringWith(e.result);
+                } else {
+                    if (value !is null) returnValue = NSString.stringWith(value);
+                }
+                break;
         }
         
         return returnValue;
@@ -759,7 +759,7 @@
             AccessibleControlListener listener = accessibleControlListeners.elementAt(i);
             listener.getState(event);
         }
-
+        
         return NSNumber.numberWithBool(control.isEnabled());
     }
     
@@ -771,13 +771,13 @@
             AccessibleControlListener listener = accessibleControlListeners.elementAt(i);
             listener.getFocus(event);
         }
-
+        
         /* The application can optionally answer an accessible. */
         // FIXME:
-//      if (event.accessible !is null) {
-//          bool hasFocus = (event.accessible.childID is childID) && (event.accessible.control is this.control);
-//          return NSNumber.numberWithBool(hasFocus);
-//      }
+        //      if (event.accessible !is null) {
+        //          bool hasFocus = (event.accessible.childID is childID) && (event.accessible.control is this.control);
+        //          return NSNumber.numberWithBool(hasFocus);
+        //      }
         
         /* Or the application can answer a valid child ID, including CHILDID_SELF and CHILDID_NONE. */
         if (event.childID is ACC.CHILDID_SELF) {
@@ -791,7 +791,7 @@
             /* Other valid childID. */
             return NSNumber.numberWithBool(event.childID is childID);
         }
-
+        
         // Invalid childID at this point means the application did not implement getFocus, so 
         // let the default handler return the native focus.
         bool hasFocus = (this.control.view.window().firstResponder() is control.view);
@@ -825,7 +825,7 @@
                 if (appChildren !is null && appChildren.length > 0) {
                     /* return an NSArray of NSAccessible objects. */
                     NSMutableArray childArray = NSMutableArray.arrayWithCapacity(appChildren.length);
-
+                    
                     for (int i = 0; i < appChildren.length; i++) {
                         Object child = appChildren[i];
                         if (cast(Integer) child) {
@@ -835,7 +835,7 @@
                             childArray.addObject((cast(Accessible)child).control.view);
                         }
                     }
-
+                    
                     returnValue = new cocoa.id(OS.NSAccessibilityUnignoredChildren(childArray.id));
                 }
             }
@@ -844,7 +844,7 @@
             // Don't return null if there are no children -- always return an empty array.
             returnValue = NSArray.array();
         }
-
+        
         // Returning null here means we want the control itself to determine its children. If the accessible listener
         // implemented getChildCount/getChildren, references to those objects would have been returned above.
         return returnValue;
@@ -869,7 +869,7 @@
                 if (appChildren !is null && appChildren.length > 0) {
                     /* return an NSArray of NSAccessible objects. */
                     NSMutableArray childArray = NSMutableArray.arrayWithCapacity(appChildren.length);
-
+                    
                     for (int i = 0; i < appChildren.length; i++) {
                         Object child = appChildren[i];
                         if (cast(Integer)child) {
@@ -889,7 +889,7 @@
                             childArray.addObject((cast(Accessible)child).control.view);
                         }
                     }
-
+                    
                     returnValue = new cocoa.id(OS.NSAccessibilityUnignoredChildren(childArray.id));
                 }
             }
@@ -898,7 +898,7 @@
             // Don't return null if there are no children -- always return an empty array.
             returnValue = NSArray.array();
         }
-
+        
         // Returning null here means we want the control itself to determine its children. If the accessible listener
         // implemented getChildCount/getChildren, references to those objects would have been returned above.
         return returnValue;
@@ -922,7 +922,7 @@
             AccessibleControlListener listener = accessibleControlListeners.elementAt(i);
             listener.getLocation(event);
         }
-
+        
         dwt.widgets.Monitor.Monitor primaryMonitor = Display.getCurrent().getPrimaryMonitor();
         
         NSPoint osPositionAttribute = NSPoint ();
@@ -935,12 +935,12 @@
             if (childID !is ACC.CHILDID_SELF) {
                 Point pt = null;
                 Rectangle location = control.getBounds();
-
+                
                 if (control.getParent() !is null)
                     pt = control.getParent().toDisplay(location.x, location.y);
                 else 
                     pt = (cast(Shell)control).toDisplay(location.x, location.y);
-
+                
                 osPositionAttribute.x = pt.x;
                 osPositionAttribute.y = pt.y;
                 returnValue = NSValue.valueWithPoint(osPositionAttribute);
@@ -955,12 +955,12 @@
         AccessibleControlEvent event = new AccessibleControlEvent(this);
         event.childID = childID;
         event.width = -1;
-
+        
         for (int i = 0; i < accessibleControlListeners.size(); i++) {
             AccessibleControlListener listener = accessibleControlListeners.elementAt(i);
             listener.getLocation(event);
         }
-
+        
         NSSize controlSize = NSSize ();
         if (event.width !is -1) {
             controlSize.width = event.width;
@@ -985,14 +985,14 @@
             AccessibleListener listener = accessibleListeners.elementAt(i);
             listener.getDescription(event);
         }
-
+        
         returnValue = (event.result !is null ? NSString.stringWith(event.result) : null);
-
+        
         // If no description was provided, try the name.
         if (returnValue is null) {
             if (cast(Composite) control) returnValue = NSString.stringWith("");
         }
-
+        
         return returnValue;
     }
     
@@ -1037,7 +1037,7 @@
     
     cocoa.id getRangeForLineParameterizedAttribute (cocoa.id parameter, int childID) {
         cocoa.id returnValue = null;
-
+        
         // The parameter is an NSNumber with the line number.
         NSNumber lineNumberObj = new NSNumber(parameter.id);        
         int lineNumber = lineNumberObj.intValue();
@@ -1119,11 +1119,11 @@
             listener.getValue(event);
         }
         String appValue = event.result;
-
+        
         if (appValue !is null) {
             returnValue = NSString.stringWith(appValue.substring(range.location, range.location + range.length));
         }
-
+        
         return returnValue;
     }
     
@@ -1160,18 +1160,18 @@
         }
         
         NSRange range = NSRange();
-
+        
         if (event.result !is null) {
             range.location = 0;
             range.length = event.result.length();
         } else {
             return null;
-//          range.location = range.length = 0;
+            //          range.location = range.length = 0;
         }
-
+        
         return NSValue.valueWithRange(range);
     }
-
+    
     int lineNumberForOffset (String text, int offset) {
         int lineNumber = 1;
         int length = text.length();
@@ -1188,7 +1188,7 @@
         }
         return lineNumber;
     }
-
+    
     NSRange rangeForLineNumber (int lineNumber, String text) {
         NSRange range = NSRange();
         range.location = -1;
@@ -1214,7 +1214,7 @@
         range.length = count;
         return range;
     }
-
+    
     /**
      * Removes the listener from the collection of listeners who will
      * be notified when an accessible client asks for certain strings,
@@ -1239,7 +1239,7 @@
         if (listener is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
         accessibleListeners.removeElement(listener);
     }
-
+    
     /**
      * Removes the listener from the collection of listeners who will
      * be notified when an accessible client asks for custom control
@@ -1264,7 +1264,7 @@
         if (listener is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
         accessibleControlListeners.removeElement(listener);
     }
-
+    
     /**
      * Removes the listener from the collection of listeners who will
      * be notified when an accessible client asks for custom text control
@@ -1291,7 +1291,7 @@
         if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
         accessibleTextListeners.removeElement (listener);
     }
-
+    
     static NSArray retainedAutoreleased(NSArray inObject) {
         cocoa.id temp = inObject.retain();
         cocoa.id temp2 = (new NSObject(temp.id)).autorelease();
@@ -1313,7 +1313,7 @@
         checkWidget();
         OS.NSAccessibilityPostNotification(control.view.id, OS.NSAccessibilitySelectedChildrenChangedNotification.id);
     }
-
+    
     /**
      * Sends a message to accessible clients indicating that the focus
      * has changed within a custom control.
@@ -1329,7 +1329,7 @@
         checkWidget();
         OS.NSAccessibilityPostNotification(control.view.id, OS.NSAccessibilityFocusedUIElementChangedNotification.id);
     }
-
+    
     /**
      * Sends a message to accessible clients that the text
      * caret has moved within a custom control.
@@ -1347,7 +1347,7 @@
         checkWidget();
         OS.NSAccessibilityPostNotification(control.view.id, OS.NSAccessibilitySelectedTextChangedNotification.id);
     }
-
+    
     /**
      * Sends a message to accessible clients that the text
      * within a custom control has changed.
@@ -1371,7 +1371,7 @@
         checkWidget();
         OS.NSAccessibilityPostNotification(control.view.id, OS.NSAccessibilityValueChangedNotification.id);
     }
-
+    
     /**
      * Sends a message to accessible clients that the text
      * selection has changed within a custom control.
@@ -1392,7 +1392,7 @@
         if (childID is ACC.CHILDID_SELF) {
             return control.view;
         }
-
+        
         /* Check cache for childID, if found, return corresponding osChildID. */
         SWTAccessibleDelegate childRef = children[childID];
         
@@ -1403,7 +1403,7 @@
         
         return childRef;
     }
-
+    
     NSString concatStringsAsRole(NSString str1, NSString str2) {
         NSString returnValue = str1;
         returnValue = returnValue.stringByAppendingString(NSString.stringWith(":"));
@@ -1455,10 +1455,10 @@
             case ACC.ROLE_SLIDER: nsReturnValue = OS.NSAccessibilitySliderRole; break;
             case ACC.ROLE_LINK: nsReturnValue = OS.NSAccessibilityLinkRole; break;
         }
-
+        
         return nsReturnValue.getString();
     }
-
+    
     int osToRole(NSString osRole) {
         if (osRole is null) return 0;
         if (osRole.isEqualToString(OS.NSAccessibilityWindowRole)) return ACC.ROLE_WINDOW;
@@ -1498,10 +1498,10 @@
         if (!isValidThread ()) DWT.error (DWT.ERROR_THREAD_INVALID_ACCESS);
         if (control.isDisposed ()) DWT.error (DWT.ERROR_WIDGET_DISPOSED);
     }
-
+    
     /* isValidThread was copied from Widget, and rewritten to work in this package */
     bool isValidThread () {
         return control.getDisplay ().getThread () is Thread.getThis ();
     }
-
+    
 }
--- a/dwt/accessibility/AccessibleAdapter.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/accessibility/AccessibleAdapter.d	Thu Jan 15 23:08:54 2009 +0100
@@ -38,7 +38,7 @@
  * @since 2.0
  */
 public abstract class AccessibleAdapter : AccessibleListener {
-
+    
     /**
      * Sent when an accessibility client requests the name
      * of the control, or the name of a child of the control.
@@ -58,7 +58,7 @@
      */
     public void getName (AccessibleEvent e) {
     }
-
+    
     /**
      * Sent when an accessibility client requests the help String
      * of the control, or the help String of a child of the control.
@@ -83,7 +83,7 @@
      */
     public void getHelp (AccessibleEvent e) {
     }
-
+    
     /**
      * Sent when an accessibility client requests the keyboard shortcut
      * of the control, or the keyboard shortcut of a child of the control.
@@ -108,7 +108,7 @@
      */
     public void getKeyboardShortcut (AccessibleEvent e) {
     }
-
+    
     /**
      * Sent when an accessibility client requests a description
      * of the control, or a description of a child of the control.
--- a/dwt/accessibility/AccessibleControlAdapter.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/accessibility/AccessibleControlAdapter.d	Thu Jan 15 23:08:54 2009 +0100
@@ -44,7 +44,7 @@
  * @since 2.0
  */
 public abstract class AccessibleControlAdapter : AccessibleControlListener {
-
+    
     /**
      * Sent when an accessibility client requests the identifier
      * of the control child at the specified display coordinates.
@@ -65,7 +65,7 @@
      */
     public void getChildAtPoint (AccessibleControlEvent e) {
     }
-
+    
     /**
      * Sent when an accessibility client requests the location
      * of the control, or the location of a child of the control.
@@ -83,7 +83,7 @@
      */
     public void getLocation (AccessibleControlEvent e) {
     }
-
+    
     /**
      * Sent when an accessibility client requests the accessible object
      * for a child of the control.
@@ -102,7 +102,7 @@
      */
     public void getChild (AccessibleControlEvent e) {
     }
-
+    
     /**
      * Sent when an accessibility client requests the number of
      * children in the control.
@@ -118,7 +118,7 @@
      */
     public void getChildCount (AccessibleControlEvent e) {
     }
-
+    
     /**
      * Sent when an accessibility client requests the default action
      * of the control, or the default action of a child of the control.
@@ -140,7 +140,7 @@
      */
     public void getDefaultAction (AccessibleControlEvent e) {
     }
-
+    
     /**
      * Sent when an accessibility client requests the identity of
      * the child or control that has keyboard focus.
@@ -159,7 +159,7 @@
      */
     public void getFocus (AccessibleControlEvent e) {
     }
-
+    
     /**
      * Sent when an accessibility client requests the role
      * of the control, or the role of a child of the control.
@@ -177,7 +177,7 @@
      */
     public void getRole (AccessibleControlEvent e) {
     }
-
+    
     /**
      * Sent when an accessibility client requests the identity of
      * the child or control that is currently selected.
@@ -197,7 +197,7 @@
      */
     public void getSelection (AccessibleControlEvent e) {
     }
-
+    
     /**
      * Sent when an accessibility client requests the state
      * of the control, or the state of a child of the control.
@@ -215,7 +215,7 @@
      */
     public void getState (AccessibleControlEvent e) {
     }
-
+    
     /**
      * Sent when an accessibility client requests the value
      * of the control, or the value of a child of the control.
@@ -239,7 +239,7 @@
      */
     public void getValue (AccessibleControlEvent e) {
     }
-
+    
     /**
      * Sent when an accessibility client requests the children of the control.
      * The default behavior is to do nothing.
--- a/dwt/accessibility/AccessibleControlEvent.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/accessibility/AccessibleControlEvent.d	Thu Jan 15 23:08:54 2009 +0100
@@ -45,33 +45,33 @@
     public int detail; // IN/OUT
     public String result; // OUT
     public Object children[]; // [OUT]
-
+    
     static final long serialVersionUID = 3257281444169529141L;
-
-    /**
-     * Constructs a new instance of this class.
-     *
-     * @param source the object that fired the event
-     */
-    public this (Object source) {
-        super(source);
-    }
+    
+/**
+ * Constructs a new instance of this class.
+ *
+ * @param source the object that fired the event
+ */
+public this (Object source) {
+    super(source);
+}
 
-    /**
-     * Returns a String containing a concise, human-readable
-     * description of the receiver.
-     *
-     * @return a String representation of the event
-     */
-    public String toString () {
-        return Format("AccessibleControlEvent {childID={}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}" , childID , //$NON-NLS-1$
-          " accessible=" , accessible , //$NON-NLS-1$
-          " x=" , x , //$NON-NLS-1$
-          " y=" , y , //$NON-NLS-1$
-          " width=" , width , //$NON-NLS-1$
-          " height=" , height , //$NON-NLS-1$
-          " detail=" , detail , //$NON-NLS-1$
-          " result=" , result , //$NON-NLS-1$
-          "}"); //$NON-NLS-1$
-    }
+/**
+ * Returns a String containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a String representation of the event
+ */
+public String toString () {
+    return Format("AccessibleControlEvent {childID={}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}" , childID , //$NON-NLS-1$
+                  " accessible=" , accessible , //$NON-NLS-1$
+                  " x=" , x , //$NON-NLS-1$
+                  " y=" , y , //$NON-NLS-1$
+                  " width=" , width , //$NON-NLS-1$
+                  " height=" , height , //$NON-NLS-1$
+                  " detail=" , detail , //$NON-NLS-1$
+                  " result=" , result , //$NON-NLS-1$
+                  "}"); //$NON-NLS-1$
 }
+}
--- a/dwt/accessibility/AccessibleControlListener.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/accessibility/AccessibleControlListener.d	Thu Jan 15 23:08:54 2009 +0100
@@ -45,7 +45,7 @@
  * @since 2.0
  */
 public interface AccessibleControlListener : DWTEventListener {
-
+    
     /**
      * Sent when an accessibility client requests the identifier
      * of the control child at the specified display coordinates.
@@ -64,7 +64,7 @@
      * </ul>
      */
     public void getChildAtPoint (AccessibleControlEvent e);
-
+    
     /**
      * Sent when an accessibility client requests the location
      * of the control, or the location of a child of the control.
@@ -80,7 +80,7 @@
      * </ul>
      */
     public void getLocation (AccessibleControlEvent e);
-
+    
     /**
      * Sent when an accessibility client requests the accessible object
      * for a child of the control.
@@ -97,7 +97,7 @@
      * </ul>
      */
     public void getChild (AccessibleControlEvent e);
-
+    
     /**
      * Sent when an accessibility client requests the number of
      * children in the control.
@@ -111,7 +111,7 @@
      * </ul>
      */
     public void getChildCount (AccessibleControlEvent e);
-
+    
     /**
      * Sent when an accessibility client requests the default action
      * of the control, or the default action of a child of the control.
@@ -131,7 +131,7 @@
      * </ul>
      */
     public void getDefaultAction (AccessibleControlEvent e);
-
+    
     /**
      * Sent when an accessibility client requests the identity of
      * the child or control that has keyboard focus.
@@ -148,7 +148,7 @@
      * </ul>
      */
     public void getFocus (AccessibleControlEvent e);
-
+    
     /**
      * Sent when an accessibility client requests the role
      * of the control, or the role of a child of the control.
@@ -164,7 +164,7 @@
      * </ul>
      */
     public void getRole (AccessibleControlEvent e);
-
+    
     /**
      * Sent when an accessibility client requests the identity of
      * the child or control that is currently selected.
@@ -182,7 +182,7 @@
      * </ul>
      */
     public void getSelection (AccessibleControlEvent e);
-
+    
     /**
      * Sent when an accessibility client requests the state
      * of the control, or the state of a child of the control.
@@ -198,7 +198,7 @@
      * </ul>
      */
     public void getState (AccessibleControlEvent e);
-
+    
     /**
      * Sent when an accessibility client requests the value
      * of the control, or the value of a child of the control.
@@ -220,7 +220,7 @@
      * </ul>
      */
     public void getValue (AccessibleControlEvent e);
-
+    
     /**
      * Sent when an accessibility client requests the children of the control.
      * <p>
--- a/dwt/accessibility/AccessibleEvent.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/accessibility/AccessibleEvent.d	Thu Jan 15 23:08:54 2009 +0100
@@ -42,33 +42,33 @@
      * or a 0-based integer representing a specific child of the control.
      */
     public int childID;
+    
+/**
+ * The value of this field must be set in the accessible listener
+ * method before returning.
+ * What to set it to depends on the listener method called, and
+ * the childID specified by the client.
+ */
+public String result;
 
-    /**
-     * The value of this field must be set in the accessible listener
-     * method before returning.
-     * What to set it to depends on the listener method called, and
-     * the childID specified by the client.
-     */
-    public String result;
-
-    static const long serialVersionUID = 3257567304224026934L;
+static const long serialVersionUID = 3257567304224026934L;
 
-    /**
-     * Constructs a new instance of this class.
-     *
-     * @param source the object that fired the event
-     */
-    public this (Object source) {
-        super(source);
-    }
+/**
+ * Constructs a new instance of this class.
+ *
+ * @param source the object that fired the event
+ */
+public this (Object source) {
+    super(source);
+}
 
-    /**
-     * Returns a string containing a concise, human-readable
-     * description of the receiver.
-     *
-     * @return a string representation of the event
-     */
-    public String toString () {
-        return Format("AccessibleEvent {childID={}{}{}{}" , childID , " result=" , result , "}"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-    }
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public String toString () {
+    return Format("AccessibleEvent {childID={}{}{}{}" , childID , " result=" , result , "}"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 }
+}
--- a/dwt/accessibility/AccessibleListener.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/accessibility/AccessibleListener.d	Thu Jan 15 23:08:54 2009 +0100
@@ -41,7 +41,7 @@
  * @since 2.0
  */
 public interface AccessibleListener : DWTEventListener {
-
+    
     /**
      * Sent when an accessibility client requests the name
      * of the control, or the name of a child of the control.
@@ -59,7 +59,7 @@
      * </ul>
      */
     public void getName (AccessibleEvent e);
-
+    
     /**
      * Sent when an accessibility client requests the help string
      * of the control, or the help string of a child of the control.
@@ -82,7 +82,7 @@
      * </ul>
      */
     public void getHelp (AccessibleEvent e);
-
+    
     /**
      * Sent when an accessibility client requests the keyboard shortcut
      * of the control, or the keyboard shortcut of a child of the control.
@@ -105,7 +105,7 @@
      * </ul>
      */
     public void getKeyboardShortcut (AccessibleEvent e);
-
+    
     /**
      * Sent when an accessibility client requests a description
      * of the control, or a description of a child of the control.
--- a/dwt/accessibility/AccessibleTextAdapter.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/accessibility/AccessibleTextAdapter.d	Thu Jan 15 23:08:54 2009 +0100
@@ -44,7 +44,7 @@
  * @since 3.0
  */
 public abstract class AccessibleTextAdapter : AccessibleTextListener {
-
+    
     /**
      * Sent when an accessibility client requests the current character offset
      * of the text caret.
@@ -61,7 +61,7 @@
      */
     public void getCaretOffset (AccessibleTextEvent e) {
     }
-
+    
     /**
      * Sent when an accessibility client requests the range of the current
      * text selection.
--- a/dwt/accessibility/AccessibleTextEvent.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/accessibility/AccessibleTextEvent.d	Thu Jan 15 23:08:54 2009 +0100
@@ -39,28 +39,28 @@
 public class AccessibleTextEvent : DWTEventObject {
     public int childID; // IN
     public int offset, length; // OUT
-
+    
     static const long serialVersionUID = 3977019530868308275L;
-
-    /**
-     * Constructs a new instance of this class.
-     *
-     * @param source the object that fired the event
-     */
-    public this (Object source) {
-        super(source);
-    }
+    
+/**
+ * Constructs a new instance of this class.
+ *
+ * @param source the object that fired the event
+ */
+public this (Object source) {
+    super(source);
+}
 
-    /**
-     * Returns a string containing a concise, human-readable
-     * description of the receiver.
-     *
-     * @return a string representation of the event
-     */
-    public String toString () {
-        return Format("AccessibleTextEvent {childID={}{}{}{}{}{}" , childID , //$NON-NLS-1$
-        " offset=" , offset , //$NON-NLS-1$
-        " length=" , length , //$NON-NLS-1$
-        "}"); //$NON-NLS-1$
-    }
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public String toString () {
+    return Format("AccessibleTextEvent {childID={}{}{}{}{}{}" , childID , //$NON-NLS-1$
+                  " offset=" , offset , //$NON-NLS-1$
+                  " length=" , length , //$NON-NLS-1$
+                  "}"); //$NON-NLS-1$
 }
+}
--- a/dwt/accessibility/AccessibleTextListener.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/accessibility/AccessibleTextListener.d	Thu Jan 15 23:08:54 2009 +0100
@@ -45,7 +45,7 @@
  * @since 3.0
  */
 public interface AccessibleTextListener : DWTEventListener {
-
+    
     /**
      * Sent when an accessibility client requests the current character offset
      * of the text caret.
@@ -60,7 +60,7 @@
      * </ul>
      */
     public void getCaretOffset (AccessibleTextEvent e);
-
+    
     /**
      * Sent when an accessibility client requests the range of the current
      * text selection.
--- a/dwt/accessibility/SWTAccessibleDelegate.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/accessibility/SWTAccessibleDelegate.d	Thu Jan 15 23:08:54 2009 +0100
@@ -29,7 +29,7 @@
 import objc = dwt.internal.objc.runtime;
 
 class SWTAccessibleDelegate : NSObject {
-
+    
     /**
      * Accessible Key: The string constant for looking up the accessible 
      * for a control using <code>getData(String)</code>. When an accessible
@@ -38,60 +38,60 @@
      */
     static final String ACCESSIBLE_KEY = "Accessible"; //$NON-NLS-1$
     static final String DWT_OBJECT = "DWT_OBJECT";
-
+    
     static objc.IMP proc2Args, proc3Args, proc4Args;
-
+    
     Accessible accessibleParent;
     void* delegateJniRef;
     int childID;
-
+    
     NSArray attributeNames = null;
     NSArray parameterizedAttributeNames = null;
     NSArray actionNames = null;
-
+    
     static this (){
         ClassInfo clazz = SWTAccessibleDelegate.classinfo;
-
+        
         proc2Args = cast(objc.IMP) &accessibleProc2;
-
+        
         proc3Args = cast(objc.IMP) &accessibleProc3;       
-
+        
         proc4Args = cast(objc.IMP) &accessibleProc4;      
-
+        
         // Accessible custom controls need to implement the NSAccessibility protocol. To do that, 
         // we dynamically add the methods to the control's class that are required 
         // by NSAccessibility. Then, when external assistive technology services are used, 
         // those methods get called to provide the needed information.
-
+        
         String className = "SWTAccessibleDelegate";
-
+        
         // TODO: These should either move out of Display or be accessible to this class.
         String types = "*";
         size_t size = C.PTR_SIZEOF, align_ = C.PTR_SIZEOF is 4 ? 2 : 3;
-
+        
         objc.Class cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSObject, className, 0);
         OS.class_addIvar(cls, DWT_OBJECT, size, cast(byte)align_, types);
-
+        
         // Add the NSAccessibility overrides
         OS.class_addMethod(cls, OS.sel_accessibilityActionNames, proc2Args, "@:");
         OS.class_addMethod(cls, OS.sel_accessibilityAttributeNames, proc2Args, "@:");
         OS.class_addMethod(cls, OS.sel_accessibilityParameterizedAttributeNames, proc2Args, "@:");
         OS.class_addMethod(cls, OS.sel_accessibilityIsIgnored, proc2Args, "@:");
         OS.class_addMethod(cls, OS.sel_accessibilityFocusedUIElement, proc2Args, "@:");
-
+        
         OS.class_addMethod(cls, OS.sel_accessibilityAttributeValue_, proc3Args, "@:@");
         OS.class_addMethod(cls, OS.sel_accessibilityHitTest_, proc3Args, "@:{NSPoint}");
         OS.class_addMethod(cls, OS.sel_accessibilityIsAttributeSettable_, proc3Args, "@:@");
         OS.class_addMethod(cls, OS.sel_accessibilityActionDescription_, proc3Args, "@:@");
         OS.class_addMethod(cls, OS.sel_accessibilityPerformAction_, proc3Args, "@:@");
-
+        
         OS.class_addMethod(cls, OS.sel_accessibilityAttributeValue_forParameter_, proc4Args, "@:@@");
         OS.class_addMethod(cls, OS.sel_accessibilitySetValue_forAttribute_, proc4Args, "@:@@");
-
+        
         OS.objc_registerClassPair(cls);
     }
-
-
+    
+    
     public this(Accessible accessible, int childID) {
         super(cast(objc.id) null);
         this.accessibleParent = accessible;
@@ -101,7 +101,7 @@
         if (delegateJniRef is null) DWT.error(DWT.ERROR_NO_HANDLES);
         OS.object_setInstanceVariable(this.id, DWT_OBJECT, delegateJniRef);
     }
-
+    
     NSArray accessibilityActionNames() {
         
         if (actionNames !is null)
@@ -111,7 +111,7 @@
         actionNames.retain();
         return retainedAutoreleased(actionNames);
     }
-
+    
     NSArray accessibilityAttributeNames() {
         
         if (attributeNames !is null)
@@ -121,7 +121,7 @@
         attributeNames.retain();
         return retainedAutoreleased(attributeNames);
     }
-
+    
     cocoa.id accessibilityAttributeValue(NSString attribute) {
         return accessibleParent.internal_accessibilityAttributeValue(attribute, childID);
     }
@@ -140,26 +140,26 @@
     cocoa.id accessibilityAttributeValue_forParameter(NSString attribute, cocoa.id parameter) {
         return accessibleParent.internal_accessibilityAttributeValue_forParameter(attribute, parameter, childID);
     }
-
+    
     // Return YES if the UIElement doesn't show up to the outside world - i.e. its parent should return the UIElement's children as its own - cutting the UIElement out. E.g. NSControls are ignored when they are single-celled.
     bool accessibilityIsIgnored() {
         return accessibleParent.internal_accessibilityIsIgnored(childID);
     }
-
+    
     bool accessibilityIsAttributeSettable(NSString attribute) {
         return accessibleParent.internal_accessibilityIsAttributeSettable(attribute, childID);
     }
-
+    
     // Returns the deepest descendant of the UIElement hierarchy that contains the point. You can assume the point has already been determined to lie within the receiver. Override this method to do deeper hit testing within a UIElement - e.g. a NSMatrix would test its cells. The point is bottom-left relative screen coordinates.
     cocoa.id accessibilityHitTest(NSPoint point) {
         return accessibleParent.internal_accessibilityHitTest(point, childID);
     }
-
+    
     // Returns the UI Element that has the focus. You can assume that the search for the focus has already been narrowed down to the reciever. Override this method to do a deeper search with a UIElement - e.g. a NSMatrix would determine if one of its cells has the focus.
     cocoa.id accessibilityFocusedUIElement() {
         return accessibleParent.internal_accessibilityFocusedUIElement(childID);
     }
-
+    
     void accessibilityPerformAction(NSString action) {
         accessibleParent.internal_accessibilityPerformAction(action, childID);
     }
@@ -179,11 +179,11 @@
         cocoa.id temp2 = (new NSObject(temp.id)).autorelease();
         return new NSArray(temp2.id);
     }
-extern (C){    
+    extern (C){    
     static objc.id accessibleProc2(objc.id id, objc.SEL sel) {
         SWTAccessibleDelegate swtAcc = getAccessibleDelegate(id);
         if (swtAcc is null) return null;
-
+        
         if (sel is OS.sel_accessibilityAttributeNames) {
             NSArray retObject = swtAcc.accessibilityAttributeNames();
             return (retObject is null ? null : retObject.id);
@@ -200,10 +200,10 @@
             cocoa.id retObject = swtAcc.accessibilityFocusedUIElement();
             return (retObject is null ? null : retObject.id);
         }
-
+        
         return null;
     }
-
+    
     static objc.id accessibleProc3(objc.id id, objc.SEL sel, objc.id arg0) {
         SWTAccessibleDelegate swtAcc = getAccessibleDelegate(id);
         if (swtAcc is null) return null;
@@ -228,10 +228,10 @@
             NSString action = new NSString(arg0);
             swtAcc.accessibilityPerformAction(action);
         }
-
+        
         return null;
     }
-
+    
     static objc.id accessibleProc4(objc.id id, objc.SEL sel, objc.id arg0, objc.id arg1) {
         SWTAccessibleDelegate swtAcc = getAccessibleDelegate(id);
         if (swtAcc is null) return null;
@@ -246,10 +246,10 @@
             NSString attribute = new NSString(arg1);
             swtAcc.accessibilitySetValue_forAttribute(value, attribute);
         }
-
+        
         return null;
     }
-}
+    }
     static SWTAccessibleDelegate getAccessibleDelegate(objc.id id) {
         if (id is null) return null;
         void* jniRef;
@@ -257,7 +257,7 @@
         if (jniRef is null) return null;
         return cast(SWTAccessibleDelegate)OS.JNIGetObject(jniRef);
     }
-
+    
     public void internal_dispose_SWTAccessibleDelegate() {
         if (actionNames !is null) actionNames.release();
         actionNames = null;
@@ -266,5 +266,5 @@
         if (parameterizedAttributeNames !is null) parameterizedAttributeNames.release();
         parameterizedAttributeNames = null;     
     }
-
+    
 }
--- a/dwt/custom/CCombo.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/custom/CCombo.d	Thu Jan 15 23:08:54 2009 +0100
@@ -159,8 +159,8 @@
             if (getShell () is event.widget) {
                 getDisplay().asyncExec(new class() Runnable {
                     public void run() {
-                        if (isDisposed()) return;
-                        handleFocus (DWT.FocusOut);
+                        if (this.outer.outer.isDisposed()) return;
+                        this.outer.outer.handleFocus (DWT.FocusOut);
                     }
                 });
             }
--- a/dwt/custom/TableTreeEditor.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/custom/TableTreeEditor.d	Thu Jan 15 23:08:54 2009 +0100
@@ -118,10 +118,10 @@
         this() {
             runnable = new class() Runnable {
                 public void run() {
-                    if (editor is null || editor.isDisposed()) return;
+                    if (this.outer.outer.editor is null || this.outer.outer.editor.isDisposed()) return;
                     if (this.outer.outer.tableTree.isDisposed()) return;
-                    layout();
-                    editor.setVisible(true);
+                    this.outer.outer.layout();
+                    this.outer.outer.editor.setVisible(true);
                 }
             };
         }
--- a/dwt/custom/TreeEditor.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/custom/TreeEditor.d	Thu Jan 15 23:08:54 2009 +0100
@@ -124,7 +124,7 @@
                 public void run() {
                     if (this.outer.outer.editor is null || this.outer.outer.editor.isDisposed()) return;
                     if (this.outer.outer.tree.isDisposed()) return;
-                    layout();
+                    this.outer.outer.layout();
                     this.outer.outer.editor.setVisible(true);
                 }
             };
@@ -334,4 +334,4 @@
     super.layout();
 }
 
-}
+}
\ No newline at end of file
--- a/dwt/dnd/DND.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/dnd/DND.d	Thu Jan 15 23:08:54 2009 +0100
@@ -270,17 +270,17 @@
         }
         case DND.ERROR_CANNOT_INIT_DROP:{
             String msg = DND.INIT_DROP_MESSAGE;
-            if (hresult !is 0) msg += " result = "~Integer.toString(hresult); //$NON-NLS-1$
+            if (hresult !is 0) msg ~= " result = "~Integer.toString(hresult); //$NON-NLS-1$
             throw new DWTError (code, msg);
         }
         case DND.ERROR_CANNOT_SET_CLIPBOARD:{
             String msg = DND.CANNOT_SET_CLIPBOARD_MESSAGE;
-            if (hresult !is 0) msg += " result = "~Integer.toString(hresult); //$NON-NLS-1$
+            if (hresult !is 0) msg ~= " result = "~Integer.toString(hresult); //$NON-NLS-1$
             throw new DWTError (code, msg);
         }
         case DND.ERROR_INVALID_DATA:{
             String msg = DND.INVALID_DATA_MESSAGE;
-            if (hresult !is 0) msg += " result = "~Integer.toString(hresult); //$NON-NLS-1$
+            if (hresult !is 0) msg ~= " result = "~Integer.toString(hresult); //$NON-NLS-1$
             throw new DWTException (code, msg);
         }
         
--- a/dwt/dwthelper/array.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/dwthelper/array.d	Thu Jan 15 23:08:54 2009 +0100
@@ -26,6 +26,7 @@
  * Returns: the modified array
  * 
  * Throws: AssertException if the length of the array is 0
+ * Throws: AssertException if the element is null
  */
 T[] add (T) (ref T[] arr, T element)
 in
@@ -47,6 +48,7 @@
  * Returns: the modified array
  * 
  * Throws: AssertException if the length of the array is 0
+ * Throws: AssertException if the element is null
  */
 alias add addElement;
 
@@ -58,9 +60,6 @@
  *     index = the index of the element to get
  *     
  * Returns: the element at the specified index
- * 
- * Throws: AssertException if the length of the array is 0
- *         AssertException if the $(D_CODE index) is greater than the length of the array 
  */
 T elementAt (T) (T[] arr, int index)
 in
@@ -74,16 +73,13 @@
 }
 
 /**
- * Gets the element at the specified position in the array
+ * Gets the element at the specified index
  * 
  * Params:
  *     arr = the array to get the element from
  *     index = the index of the element to get
  *     
- * Returns: the element at the specified position
- * 
- * Throws: AssertException if the length of the array is 0
- *         AssertException if the $(D_CODE index) is greater than the length of the array 
+ * Returns: the element at the specified index
  */
 alias elementAt get;
 
@@ -112,7 +108,7 @@
  * Returns: the element that was removed or $(D_CODE null)
  * 
  * Throws: AssertException if the length of the array is 0
- *         AssertException if the $(D_CODE index) argument is
+ * Throws: AssertException if the $(D_CODE index) argument is
  *         negative or not less than the length of this array.
  */
 T remove (T) (ref T[] arr, int index)
--- a/dwt/dwthelper/utils.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/dwthelper/utils.d	Thu Jan 15 23:08:54 2009 +0100
@@ -1,6 +1,5 @@
 /**
  * Authors: Frank Benoit <keinfarbton@googlemail.com>
- *          Jacob Carlborg <doob@me.com>
  */
 module dwt.dwthelper.utils;
 
@@ -34,8 +33,6 @@
 import tango.text.UnicodeData;
 static import tango.util.collection.model.Seq;
 
-static import dwt.dwthelper.array;
-
 alias bool boolean;
 alias char[] String;
 alias tango.text.Text.Text!(char) StringBuffer;
@@ -272,7 +269,8 @@
     public static float NEGATIVE_INFINITY = ((-1.0f) / 0.0f);
     public static float NaN = (0.0f / 0.0f);
     public static float MAX_VALUE = 3.4028235e+38f;
-    public static float MIN_VALUE = 1.4e-45f;    
+    public static float MIN_VALUE = float.min;
+    //public static float MIN_VALUE = 1.4e-45f;    
     public static int SIZE = 32;
 
     this( float value ){
@@ -535,26 +533,34 @@
     static alias CharacterIsLetterOrDigit isLetterOrDigit;
     static alias CharacterIsSpaceChar isSpaceChar;
     static alias CharacterIsWhitespace isWhitespace;
-    static alias CharacterIsDigit isDigit;
     
-    static T toLowerCase (T)(T c)
+    static char toLowerCase (char c)
     {
         return tango.text.Unicode.toLower([c])[0];
     }
+    
+    static bool isDigit (dchar c)
+    {
+        return tango.text.Unicode.isDigit(c);
+    }
+}
+
+struct String_
+{
+    static String valueOf (int i)
+    {
+        return tango.text.convert.Integer.toString(i);
+    }
 }
 
 String new_String( String cont, int offset, int len ){
     return cont[ offset .. offset+len ].dup;
 }
 
-String new_String(String cont){
+String new_String (String cont){
     return cont.dup;
 }
 
-String new_String(wchar[] cont){
-    return cont.toString16();
-}
-
 public String toUpperCase( String str ){
     return tango.text.Unicode.toUpper( str );
 }
@@ -706,19 +712,6 @@
            "d" );
 }
 
-public alias tango.stdc.stringz.toStringz toStringz;
-public alias tango.stdc.stringz.toString16z toString16z;
-public alias tango.stdc.stringz.fromStringz fromStringz;
-public alias tango.stdc.stringz.fromString16z fromString16z;
-
-struct String_
-{
-    static String valueOf (int v)
-    {
-        return tango.text.convert.Integer.toString(v, 10);
-    }
-}
-
 class RuntimeException : Exception {
     this( String e = null){
         super(e);
--- a/dwt/internal/c/Carbon.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/internal/c/Carbon.d	Thu Jan 15 23:08:54 2009 +0100
@@ -106,6 +106,7 @@
 alias ProcessSerialNumber * ProcessSerialNumberPtr;
 
 
+
 // Appearance.h
 enum ThemeCursor : uint
 {
@@ -218,6 +219,11 @@
 
 
 
+// CFString.h
+alias uint CFStringEncoding;
+
+
+
 // CFURL.h
 alias bindings.CFURLCreateStringByAddingPercentEscapes CFURLCreateStringByAddingPercentEscapes;
 
--- a/dwt/internal/c/bindings.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/internal/c/bindings.d	Thu Jan 15 23:08:54 2009 +0100
@@ -28,7 +28,7 @@
 
 
 // CFURL.h
-CFStringRef CFURLCreateStringByAddingPercentEscapes (CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveUnescaped, CFStringRef legalURLCharactersToBeEscaped, /*CFStringEncoding*/ size_t encoding);
+CFStringRef CFURLCreateStringByAddingPercentEscapes (CFAllocatorRef allocator, CFStringRef originalString,  CFStringRef charactersToLeaveUnescaped, CFStringRef legalURLCharactersToBeEscaped, CFStringEncoding encoding);
 
 
 
--- a/dwt/internal/c/gl.d	Wed Dec 31 21:01:13 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/**
- * Copyright: Copyright (c) 2008 Jacob Carlborg. All rights reserved.
- * Authors: Jacob Carlborg
- * Version: Initial created: Aug 3, 2008
- * License: $(LINK2 http://opensource.org/licenses/bsd-license.php, BSD Style)
- * 
- */
-module dwt.internal.c.gl;
-
-alias uint GLenum;
-alias ubyte GLboolean;
-alias uint GLbitfield;
-alias byte GLbyte;
-alias short GLshort;
-alias int GLint;
-alias int GLsizei;
-alias ubyte GLubyte;
-alias ushort GLushort;
-alias uint GLuint;
-alias float GLfloat;
-alias float GLclampf;
-alias double GLdouble;
-alias double GLclampd;
-alias void GLvoid;
-
-alias int GLintptr;
-alias int GLsizeiptr;
\ No newline at end of file
--- a/dwt/internal/cocoa/NSDatePicker.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/internal/cocoa/NSDatePicker.d	Thu Jan 15 23:08:54 2009 +0100
@@ -69,25 +69,8 @@
     return cast(objc.Class) OS.objc_msgSend(OS.class_NSDatePicker, OS.sel_cellClass);
 }
 
-public static void setCellClass(int /*long*/ factoryId) {
+public static void setCellClass(objc.Class factoryId) {
     OS.objc_msgSend(OS.class_NSDatePicker, OS.sel_setCellClass_, factoryId);
 }
 
 }
-
-enum NSDatePickerElementFlags : NSUInteger
-{
-    NSHourMinuteDatePickerElementFlag = 0x000c,
-    NSHourMinuteSecondDatePickerElementFlag = 0x000e,
-    NSTimeZoneDatePickerElementFlag = 0x0010,
-    NSYearMonthDatePickerElementFlag = 0x00c0,
-    NSYearMonthDayDatePickerElementFlag = 0x00e0,
-    NSEraDatePickerElementFlag = 0x0100,
-}
-
-enum NSDatePickerStyle : NSUInteger
-{
-    NSTextFieldAndStepperDatePickerStyle = 0,
-    NSClockAndCalendarDatePickerStyle = 1,
-    NSTextFieldDatePickerStyle = 2
-}
\ No newline at end of file
--- a/dwt/internal/cocoa/NSFileManager.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/internal/cocoa/NSFileManager.d	Thu Jan 15 23:08:54 2009 +0100
@@ -52,8 +52,8 @@
     return result !is null ? new NSDirectoryEnumerator(result) : null;
 }
 
-public bool removeItemAtPath(NSString path, objc.id* error) {
-    return OS.objc_msgSend_bool(this.id, OS.sel_removeItemAtPath_error_, path !is null ? path.id : null, error !is null ? error : null);
+public bool removeItemAtPath(NSString path, /*NSError** */ objc.id** error) {
+    return OS.objc_msgSend_bool(this.id, OS.sel_removeItemAtPath_error_, path !is null ? path.id : null, error);
 }
 
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwt/internal/cocoa/NSImageCell.d	Thu Jan 15 23:08:54 2009 +0100
@@ -0,0 +1,21 @@
+/**
+ * Copyright: Copyright (c) 2008 Jacob Carlborg. All rights reserved.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Nov 28, 2008
+ * License: $(LINK2 http://opensource.org/licenses/bsd-license.php, BSD Style)
+ * 
+ */
+module dwt.internal.cocoa.NSImageCell;
+
+enum NSImageAlignment
+{
+    NSImageAlignCenter = 0,
+    NSImageAlignTop,
+    NSImageAlignTopLeft,
+    NSImageAlignTopRight,
+    NSImageAlignLeft,
+    NSImageAlignBottom,
+    NSImageAlignBottomLeft,
+    NSImageAlignBottomRight,
+    NSImageAlignRight
+} 
\ No newline at end of file
--- a/dwt/internal/cocoa/NSImageView.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/internal/cocoa/NSImageView.d	Thu Jan 15 23:08:54 2009 +0100
@@ -18,6 +18,7 @@
 import dwt.internal.cocoa.NSCell;
 import dwt.internal.cocoa.NSControl;
 import dwt.internal.cocoa.NSImage;
+import dwt.internal.cocoa.NSImageCell;
 import dwt.internal.cocoa.OS;
 import dwt.internal.objc.cocoa.Cocoa;
 import objc = dwt.internal.objc.runtime;
--- a/dwt/internal/cocoa/NSKeyValueObserving.d	Wed Dec 31 21:01:13 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/**
- * Copyright: Copyright (c) 2008 Jacob Carlborg. All rights reserved.
- * Authors: Jacob Carlborg
- * Version: Initial created: Jul 31, 2008
- * License: $(LINK2 http://opensource.org/licenses/bsd-license.php, BSD Style)
- * 
- */
-module dwt.internal.cocoa.NSKeyValueObserving;
-
-import dwt.internal.cocoa.NSInteger;
-
-enum NSKeyValueObservingOptions : NSUInteger {
-    NSKeyValueObservingOptionNew = 0x01,
-    NSKeyValueObservingOptionOld = 0x02,
-    NSKeyValueObservingOptionInitial = 0x04,
-    NSKeyValueObservingOptionPrior = 0x08
-}
-
-alias NSKeyValueObservingOptions.NSKeyValueObservingOptionNew NSKeyValueObservingOptionNew;
-alias NSKeyValueObservingOptions.NSKeyValueObservingOptionOld NSKeyValueObservingOptionOld;
-alias NSKeyValueObservingOptions.NSKeyValueObservingOptionInitial NSKeyValueObservingOptionInitial;
-alias NSKeyValueObservingOptions.NSKeyValueObservingOptionPrior NSKeyValueObservingOptionPrior;
-
-enum NSKeyValueChange : NSUInteger {
-    NSKeyValueChangeSetting = 1,
-    NSKeyValueChangeInsertion = 2,
-    NSKeyValueChangeRemoval = 3,
-    NSKeyValueChangeReplacement = 4
-}
-
-alias NSKeyValueChange.NSKeyValueChangeSetting NSKeyValueChangeSetting;
-alias NSKeyValueChange.NSKeyValueChangeInsertion NSKeyValueChangeInsertion;
-alias NSKeyValueChange.NSKeyValueChangeRemoval NSKeyValueChangeRemoval;
-alias NSKeyValueChange.NSKeyValueChangeReplacement NSKeyValueChangeReplacement;
-
-enum NSKeyValueSetMutationKind : NSUInteger {
-    NSKeyValueUnionSetMutation = 1,
-    NSKeyValueMinusSetMutation = 2,
-    NSKeyValueIntersectSetMutation = 3,
-    NSKeyValueSetSetMutation = 4
-}
-
-alias NSKeyValueSetMutationKind.NSKeyValueUnionSetMutation NSKeyValueUnionSetMutation;
-alias NSKeyValueSetMutationKind.NSKeyValueMinusSetMutation NSKeyValueMinusSetMutation;
-alias NSKeyValueSetMutationKind.NSKeyValueIntersectSetMutation NSKeyValueIntersectSetMutation;
-alias NSKeyValueSetMutationKind.NSKeyValueSetSetMutation NSKeyValueSetSetMutation;
\ No newline at end of file
--- a/dwt/internal/cocoa/NSNumberFormatter.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/internal/cocoa/NSNumberFormatter.d	Thu Jan 15 23:08:54 2009 +0100
@@ -23,16 +23,6 @@
 import dwt.internal.objc.cocoa.Cocoa;
 import objc = dwt.internal.objc.runtime;
 
-enum NSNumberFormatterStyle
-{
-    NSNumberFormatterNoStyle = kCFNumberFormatterNoStyle,
-    NSNumberFormatterDecimalStyle = kCFNumberFormatterDecimalStyle,
-    NSNumberFormatterCurrencyStyle = kCFNumberFormatterCurrencyStyle,
-    NSNumberFormatterPercentStyle = kCFNumberFormatterPercentStyle,
-    NSNumberFormatterScientificStyle = kCFNumberFormatterScientificStyle,
-    NSNumberFormatterSpellOutStyle = kCFNumberFormatterSpellOutStyle
-}
-
 public class NSNumberFormatter : NSFormatter {
 
 public this() {
--- a/dwt/internal/cocoa/NSPrintPanel.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/internal/cocoa/NSPrintPanel.d	Thu Jan 15 23:08:54 2009 +0100
@@ -21,17 +21,6 @@
 import dwt.internal.objc.cocoa.Cocoa;
 import objc = dwt.internal.objc.runtime;
 
-enum NSPrintPanelOptions : NSInteger
-{
-    NSPrintPanelShowsCopies = 0x01,
-    NSPrintPanelShowsPageRange = 0x02,
-    NSPrintPanelShowsPaperSize = 0x04,
-    NSPrintPanelShowsOrientation = 0x08,
-    NSPrintPanelShowsScaling = 0x10,
-    NSPrintPanelShowsPageSetupAccessory = 0x100,
-    NSPrintPanelShowsPreview = 0x20000
-}
-
 public class NSPrintPanel : NSObject {
 
 public this() {
--- a/dwt/internal/cocoa/NSPropertyListFormat.d	Wed Dec 31 21:01:13 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-/**
- * Copyright: Copyright (c) 2008 Jacob Carlborg. All rights reserved.
- * Authors: Jacob Carlborg
- * Version: Initial created: Jul 28, 2008
- * License: $(LINK2 http://opensource.org/licenses/bsd-license.php, BSD Style)
- * 
- */
-module dwt.internal.cocoa.NSPropertyListFormat;
-
-import dwt.internal.cocoa.CFPropertyList;
-
-enum NSPropertyListFormat {
-    NSPropertyListOpenStepFormat = kCFPropertyListOpenStepFormat,
-    NSPropertyListXMLFormat_v1_0 = kCFPropertyListXMLFormat_v1_0,
-    NSPropertyListBinaryFormat_v1_0 = kCFPropertyListBinaryFormat_v1_0
-}
-
-alias NSPropertyListFormat.NSPropertyListOpenStepFormat NSPropertyListOpenStepFormat;
-alias NSPropertyListFormat.NSPropertyListXMLFormat_v1_0 NSPropertyListXMLFormat_v1_0;
-alias NSPropertyListFormat.NSPropertyListBinaryFormat_v1_0 NSPropertyListBinaryFormat_v1_0;
\ No newline at end of file
--- a/dwt/internal/cocoa/NSTabView.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/internal/cocoa/NSTabView.d	Thu Jan 15 23:08:54 2009 +0100
@@ -25,17 +25,6 @@
 import dwt.internal.objc.cocoa.Cocoa;
 import objc = dwt.internal.objc.runtime;
 
-enum NSTabViewType
-{
-    NSTopTabsBezelBorder     = 0,
-    NSLeftTabsBezelBorder    = 1,
-    NSBottomTabsBezelBorder  = 2,
-    NSRightTabsBezelBorder   = 3,
-    NSNoTabsBezelBorder      = 4,
-    NSNoTabsLineBorder       = 5,
-    NSNoTabsNoBorder         = 6
-}
-
 public class NSTabView : NSView {
 
 public this() {
--- a/dwt/internal/cocoa/NSTabViewItem.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/internal/cocoa/NSTabViewItem.d	Thu Jan 15 23:08:54 2009 +0100
@@ -37,7 +37,7 @@
     
 public cocoa.id initWithIdentifier(cocoa.id identifier) {
     objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithIdentifier_, identifier !is null ? identifier.id : null);
-    return result !is null ? new id(result) : null;
+    return result !is null ? new cocoa.id(result) : null;
 }
 
 public void setLabel(NSString label) {
--- a/dwt/internal/cocoa/NSTableView.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/internal/cocoa/NSTableView.d	Thu Jan 15 23:08:54 2009 +0100
@@ -30,16 +30,6 @@
 import dwt.internal.objc.cocoa.Cocoa;
 import objc = dwt.internal.objc.runtime;
 
-enum NSTableViewColumnAutoresizingStyle : NSUInteger
-{
-    NSTableViewNoColumnAutoresizing = 0,
-    NSTableViewUniformColumnAutoresizingStyle,
-    NSTableViewSequentialColumnAutoresizingStyle,
-    NSTableViewReverseSequentialColumnAutoresizingStyle,
-    NSTableViewLastColumnOnlyAutoresizingStyle,
-    NSTableViewFirstColumnOnlyAutoresizingStyle
-}
-
 public class NSTableView : NSControl {
 
 public this() {
--- a/dwt/internal/cocoa/NSWorkspace.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/internal/cocoa/NSWorkspace.d	Thu Jan 15 23:08:54 2009 +0100
@@ -59,7 +59,7 @@
 }
 
 public bool getInfoForFile(NSString fullPath, ref objc.id appName, ref objc.id type) {
-    return OS.objc_msgSend_bool(this.id, OS.sel_getInfoForFile_application_type_, fullPath !is null ? fullPath.id : null, &appName, &type);
+    return OS.objc_msgSend_bool(this.id, OS.sel_getInfoForFile_application_type_, fullPath !is null ? fullPath.id : null, appName, type);
 }
 
 public NSImage iconForFile(NSString fullPath) {
@@ -84,7 +84,7 @@
     return OS.objc_msgSend_bool(this.id, OS.sel_openURL_, url !is null ? url.id : null);
 }
 
-public bool openURLs(NSArray urls, NSString bundleIdentifier, NSWorkspaceLaunchOptions options, NSAppleEventDescriptor descriptor, objc.id* identifiers) {
+public bool openURLs(NSArray urls, NSString bundleIdentifier, NSWorkspaceLaunchOptions options, NSAppleEventDescriptor descriptor, /*NSArray** */ objc.id** identifiers) {
     return OS.objc_msgSend_bool(this.id, OS.sel_openURLs_withAppBundleIdentifier_options_additionalEventParamDescriptor_launchIdentifiers_, urls !is null ? urls.id : null, bundleIdentifier !is null ? bundleIdentifier.id : null, options, descriptor !is null ? descriptor.id : null, identifiers);
 }
 
--- a/dwt/internal/cocoa/OS.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/internal/cocoa/OS.d	Thu Jan 15 23:08:54 2009 +0100
@@ -10,26 +10,7 @@
  *******************************************************************************/
 module dwt.internal.cocoa.OS;
 
-// CFString.h
-enum CFStringEncoding // CFStringBuiltInEncodings
-{
-    kCFStringEncodingMacRoman = 0,
-    kCFStringEncodingWindowsLatin1 = 0x0500,
-    kCFStringEncodingISOLatin1 = 0x0201,
-    kCFStringEncodingNextStepLatin = 0x0B01,
-    kCFStringEncodingASCII = 0x0600,
-    kCFStringEncodingUnicode = 0x0100,
-    kCFStringEncodingUTF8 = 0x08000100,
-    kCFStringEncodingNonLossyASCII = 0x0BFF,
-
-    kCFStringEncodingUTF16 = 0x0100,
-    kCFStringEncodingUTF16BE = 0x10000100,
-    kCFStringEncodingUTF16LE = 0x14000100,
-    kCFStringEncodingUTF32 = 0x0c000100,
-    kCFStringEncodingUTF32BE = 0x18000100,
-    kCFStringEncodingUTF32LE = 0x1c000100
-}
-
+// These enums need to be up here otherwise they'll cause forward reference errors
 // NSScroller.h
 enum NSScrollerPart
 {
@@ -51,35 +32,6 @@
     NSGrooveBorder = 3
 }
 
-enum NSSearchPathDirectory
-{
-NSApplicationDirectory = 1,
-NSDemoApplicationDirectory,
-NSDeveloperApplicationDirectory,
-NSAdminApplicationDirectory,
-NSLibraryDirectory,
-NSDeveloperDirectory,
-NSUserDirectory,
-NSDocumentationDirectory,
-NSDocumentDirectory,
-NSCoreServiceDirectory,
-NSDesktopDirectory = 12,
-NSCachesDirectory = 13,
-NSApplicationSupportDirectory = 14,
-NSDownloadsDirectory = 15,
-NSAllApplicationsDirectory = 100,
-NSAllLibrariesDirectory = 101
-}
-
-enum NSSearchPathDomainMask
-{
-NSUserDomainMask = 1,
-NSLocalDomainMask = 2,
-NSNetworkDomainMask = 4,
-NSSystemDomainMask = 8,
-NSAllDomainsMask = 0x0ffff,
-}
-
 import dwt.dwthelper.utils;
 
 import dwt.internal.C;
@@ -101,23 +53,19 @@
 import dwt.internal.cocoa.NSBox;
 import dwt.internal.cocoa.NSButtonCell;
 import dwt.internal.cocoa.NSCell;
-import dwt.internal.cocoa.NSDatePicker;
 import dwt.internal.cocoa.NSEvent;
 import dwt.internal.cocoa.NSGradient;
 import dwt.internal.cocoa.NSGraphicsContext;
 import dwt.internal.cocoa.NSImage;
-import dwt.internal.cocoa.NSNumberFormatter;
+import dwt.internal.cocoa.NSImageCell;
 import dwt.internal.cocoa.NSParagraphStyle;
 import dwt.internal.cocoa.NSPoint;
-import dwt.internal.cocoa.NSPrintPanel;
 import dwt.internal.cocoa.NSRange;
 import dwt.internal.cocoa.NSRect;
 import dwt.internal.cocoa.NSScrollView;
 import dwt.internal.cocoa.NSScroller;
 import dwt.internal.cocoa.NSSize;
 import dwt.internal.cocoa.NSString;
-import dwt.internal.cocoa.NSTabView;
-import dwt.internal.cocoa.NSTableView;
 import dwt.internal.cocoa.NSText;
 import dwt.internal.cocoa.NSView;
 import NSWindowTypes = dwt.internal.cocoa.NSWindow;
@@ -2751,7 +2699,7 @@
 alias Cocoa.NSBitmapFormat.NSAlphaFirstBitmapFormat NSAlphaFirstBitmapFormat;
 alias Cocoa.NSBitmapFormat.NSAlphaNonpremultipliedBitmapFormat NSAlphaNonpremultipliedBitmapFormat;
 public static const int NSAlphaShiftKeyMask = 65536;
-public static const Cocoa.NSUInteger NSAlternateKeyMask = 524288;
+public static const int NSAlternateKeyMask = 524288;
 public static const int NSAnimationBlocking = 0;
 public static const int NSAnimationEaseIn = 1;
 public static const int NSAnimationEaseInOut = 0;
@@ -2815,12 +2763,12 @@
 public static const int NSBlueControlTint = 1;
 public static const int NSBoldFontMask = 2;
 alias Cocoa.NSBorderlessWindowMask NSBorderlessWindowMask;
-alias NSTabViewType.NSBottomTabsBezelBorder NSBottomTabsBezelBorder;
+alias Cocoa.NSTabViewType.NSBottomTabsBezelBorder NSBottomTabsBezelBorder;
 public static const int NSBoxCustom = 4;
 public static const int NSBoxOldStyle = 3;
 public static const int NSBoxPrimary = 0;
 public static const int NSBoxSecondary = 1;
-public static const NSBoxType NSBoxSeparator = 2;
+public static const int NSBoxSeparator = 2;
 public static const int NSBreakFunctionKey = 63282;
 public static const int NSBrowserAutoColumnResizing = 1;
 public static const int NSBrowserDropAbove = 1;
@@ -2869,7 +2817,7 @@
 public static const int NSClearDisplayFunctionKey = 63290;
 public static const int NSClearLineFunctionKey = 63289;
 public static const int NSClipPagination = 2;
-alias NSDatePickerStyle.NSClockAndCalendarDatePickerStyle NSClockAndCalendarDatePickerStyle;
+alias Cocoa.NSDatePickerStyle.NSClockAndCalendarDatePickerStyle NSClockAndCalendarDatePickerStyle;
 public static const int NSClosableWindowMask = 2;
 alias Cocoa.NSBezierPathElement.NSClosePathBezierPathElement NSClosePathBezierPathElement;
 public static const int NSColorListModeColorPanel = 5;
@@ -2887,7 +2835,7 @@
 public static const int NSColorRenderingIntentPerceptual = 3;
 public static const int NSColorRenderingIntentRelativeColorimetric = 2;
 public static const int NSColorRenderingIntentSaturation = 4;
-public static const Cocoa.NSUInteger NSCommandKeyMask = 1048576;
+public static const int NSCommandKeyMask = 1048576;
 alias Cocoa.NSCompositingOperation.NSCompositeClear NSCompositeClear;
 public static const int NSCompositeCopy = 1;
 public static const int NSCompositeDestinationAtop = 9;
@@ -2907,7 +2855,7 @@
 public static const int NSContentsCellMask = 1;
 public static const int NSContinuousCapacityLevelIndicatorStyle = 1;
 public static const int NSControlGlyph = 16777215;
-public static const Cocoa.NSUInteger NSControlKeyMask = 262144;
+public static const int NSControlKeyMask = 262144;
 public static const int NSCrayonModeColorPanel = 7;
 alias Cocoa.NSAlertStyle.NSCriticalAlertStyle NSCriticalAlertStyle;
 public static const int NSCriticalRequest = 0;
@@ -2933,24 +2881,24 @@
 public static const int NSDocModalWindowMask = 64;
 public static const int NSDockWindowLevel = 20;
 public static const int NSDoubleType = 6;
-public static const wchar NSDownArrowFunctionKey = 63233;
+public static const int NSDownArrowFunctionKey = 63233;
 public static const int NSDownTextMovement = 22;
-alias Cocoa.NSDragOperation.NSDragOperationAll_Obsolete NSDragOperationAll;
-alias Cocoa.NSDragOperation.NSDragOperationAll_Obsolete NSDragOperationAll_Obsolete;
-alias Cocoa.NSDragOperation.NSDragOperationCopy NSDragOperationCopy;
-alias Cocoa.NSDragOperation.NSDragOperationDelete NSDragOperationDelete;
-alias Cocoa.NSDragOperation.NSDragOperationEvery NSDragOperationEvery;
-alias Cocoa.NSDragOperation.NSDragOperationGeneric NSDragOperationGeneric;
-alias Cocoa.NSDragOperation.NSDragOperationLink NSDragOperationLink;
-alias Cocoa.NSDragOperation.NSDragOperationMove NSDragOperationMove;
-alias Cocoa.NSDragOperation.NSDragOperationNone NSDragOperationNone;
-alias Cocoa.NSDragOperation.NSDragOperationPrivate NSDragOperationPrivate;
+public static const int NSDragOperationAll = 15;
+public static const int NSDragOperationAll_Obsolete = 15;
+public static const int NSDragOperationCopy = 1;
+public static const int NSDragOperationDelete = 32;
+public static const int NSDragOperationEvery = -1;
+public static const int NSDragOperationGeneric = 4;
+public static const int NSDragOperationLink = 2;
+public static const int NSDragOperationMove = 16;
+public static const int NSDragOperationNone = 0;
+public static const int NSDragOperationPrivate = 8;
 public static const int NSDrawerClosedState = 0;
 public static const int NSDrawerClosingState = 3;
 public static const int NSDrawerOpenState = 2;
 public static const int NSDrawerOpeningState = 1;
 public static const int NSEndFunctionKey = 63275;
-public static const wchar NSEnterCharacter = 3;
+public static const int NSEnterCharacter = 3;
 public static const int NSEraDatePickerElementFlag = 256;
 public static const int NSEraserPointingDevice = 3;
 alias Cocoa.NSWindingRule.NSEvenOddWindingRule NSEvenOddWindingRule;
@@ -3001,7 +2949,7 @@
 public static const int NSFPSizeField = 129;
 public static const int NSFPSizeTitle = 133;
 public static const int NSFileHandlingPanelCancelButton = 0;
-public static const Cocoa.NSInteger NSFileHandlingPanelOKButton = 1;
+public static const int NSFileHandlingPanelOKButton = 1;
 public static const int NSFindFunctionKey = 63301;
 public static const int NSFindPanelActionNext = 2;
 public static const int NSFindPanelActionPrevious = 3;
@@ -3097,20 +3045,20 @@
 public static const int NSHighlightModeMatrix = 1;
 public static const int NSHomeFunctionKey = 63273;
 public static const int NSHorizontalRuler = 0;
-alias NSDatePickerElementFlags.NSHourMinuteDatePickerElementFlag NSHourMinuteDatePickerElementFlag;
-alias NSDatePickerElementFlags.NSHourMinuteSecondDatePickerElementFlag NSHourMinuteSecondDatePickerElementFlag;
+alias Cocoa.NSDatePickerElementFlags.NSHourMinuteDatePickerElementFlag NSHourMinuteDatePickerElementFlag;
+alias Cocoa.NSDatePickerElementFlags.NSHourMinuteSecondDatePickerElementFlag NSHourMinuteSecondDatePickerElementFlag;
 public static const int NSIdentityMappingCharacterCollection = 0;
 public static const int NSIllegalTextMovement = 0;
 alias Cocoa.NSCellImagePosition.NSImageAbove NSImageAbove;
-alias Cocoa.NSImageAlignment.NSImageAlignBottom NSImageAlignBottom;
-alias Cocoa.NSImageAlignment.NSImageAlignBottomLeft NSImageAlignBottomLeft;
-alias Cocoa.NSImageAlignment.NSImageAlignBottomRight NSImageAlignBottomRight;
-alias Cocoa.NSImageAlignment.NSImageAlignCenter NSImageAlignCenter;
-alias Cocoa.NSImageAlignment.NSImageAlignLeft NSImageAlignLeft;
-alias Cocoa.NSImageAlignment.NSImageAlignRight NSImageAlignRight;
-public static const int NSImageAlignTop = 1;
-public static const int NSImageAlignTopLeft = 2;
-public static const int NSImageAlignTopRight = 3;
+alias NSImageAlignment.NSImageAlignBottom NSImageAlignBottom;
+alias NSImageAlignment.NSImageAlignBottomLeft NSImageAlignBottomLeft;
+alias NSImageAlignment.NSImageAlignBottomRight NSImageAlignBottomRight;
+alias NSImageAlignment.NSImageAlignCenter NSImageAlignCenter;
+alias NSImageAlignment.NSImageAlignLeft NSImageAlignLeft;
+alias NSImageAlignment.NSImageAlignRight NSImageAlignRight;
+alias NSImageAlignment.NSImageAlignTop NSImageAlignTop;
+alias NSImageAlignment.NSImageAlignTopLeft NSImageAlignTopLeft;
+alias NSImageAlignment.NSImageAlignTopRight NSImageAlignTopRight;
 public static const int NSImageBelow = 4;
 public static const int NSImageCacheAlways = 1;
 public static const int NSImageCacheBySize = 2;
@@ -3220,7 +3168,7 @@
 public static const int NSNarrowFontMask = 16;
 public static const int NSNativeShortGlyphPacking = 5;
 public static const int NSNaturalTextAlignment = 4;
-public static const wchar NSNewlineCharacter = 10;
+public static const int NSNewlineCharacter = 10;
 public static const int NSNextFunctionKey = 63296;
 public static const int NSNextStepInterfaceStyle = 1;
 alias NSBorderType.NSNoBorder NSNoBorder;
@@ -3263,7 +3211,7 @@
 public static const int NSOpenGLPFAAccumSize = 14;
 public static const int NSOpenGLPFAAllRenderers = 1;
 public static const int NSOpenGLPFAAllowOfflineRenderers = 96;
-alias Cocoa.NSOpenGLPixelFormatAttribute.NSOpenGLPFAAlphaSize NSOpenGLPFAAlphaSize;
+public static const int NSOpenGLPFAAlphaSize = 11;
 public static const int NSOpenGLPFAAuxBuffers = 7;
 public static const int NSOpenGLPFAAuxDepthStencil = 57;
 public static const int NSOpenGLPFABackingStore = 76;
@@ -3271,8 +3219,8 @@
 public static const int NSOpenGLPFAColorFloat = 58;
 public static const int NSOpenGLPFAColorSize = 8;
 public static const int NSOpenGLPFACompliant = 83;
-alias Cocoa.NSOpenGLPixelFormatAttribute.NSOpenGLPFADepthSize NSOpenGLPFADepthSize;
-alias Cocoa.NSOpenGLPixelFormatAttribute.NSOpenGLPFADoubleBuffer NSOpenGLPFADoubleBuffer;
+public static const int NSOpenGLPFADepthSize = 12;
+public static const int NSOpenGLPFADoubleBuffer = 5;
 public static const int NSOpenGLPFAFullScreen = 54;
 public static const int NSOpenGLPFAMPSafe = 78;
 public static const int NSOpenGLPFAMaximumPolicy = 52;
@@ -3285,12 +3233,12 @@
 public static const int NSOpenGLPFARendererID = 70;
 public static const int NSOpenGLPFARobust = 75;
 public static const int NSOpenGLPFASampleAlpha = 61;
-alias Cocoa.NSOpenGLPixelFormatAttribute.NSOpenGLPFASampleBuffers NSOpenGLPFASampleBuffers;
-alias Cocoa.NSOpenGLPixelFormatAttribute.NSOpenGLPFASamples NSOpenGLPFASamples;
+public static const int NSOpenGLPFASampleBuffers = 55;
+public static const int NSOpenGLPFASamples = 56;
 public static const int NSOpenGLPFAScreenMask = 84;
 public static const int NSOpenGLPFASingleRenderer = 71;
-alias Cocoa.NSOpenGLPixelFormatAttribute.NSOpenGLPFAStencilSize NSOpenGLPFAStencilSize;
-alias Cocoa.NSOpenGLPixelFormatAttribute.NSOpenGLPFAStereo NSOpenGLPFAStereo;
+public static const int NSOpenGLPFAStencilSize = 13;
+public static const int NSOpenGLPFAStereo = 6;
 public static const int NSOpenGLPFASupersample = 60;
 public static const int NSOpenGLPFAVirtualScreenCount = 128;
 public static const int NSOpenGLPFAWindow = 80;
@@ -3303,8 +3251,8 @@
 public static const int NSOtherTextMovement = 0;
 public static const int NSOutlineViewDropOnItemIndex = -1;
 public static const int NSPNGFileType = 4;
-public static const wchar NSPageDownFunctionKey = 63277;
-public static const wchar NSPageUpFunctionKey = 63276;
+public static const int NSPageDownFunctionKey = 63277;
+public static const int NSPageUpFunctionKey = 63276;
 public static const int NSParagraphSeparatorCharacter = 8233;
 public static const int NSPathStyleNavigationBar = 1;
 public static const int NSPathStylePopUp = 2;
@@ -3334,7 +3282,7 @@
 public static const int NSPrintPanelShowsCopies = 1;
 public static const int NSPrintPanelShowsOrientation = 8;
 public static const int NSPrintPanelShowsPageRange = 2;
-alias NSPrintPanelOptions.NSPrintPanelShowsPageSetupAccessory NSPrintPanelShowsPageSetupAccessory;
+alias Cocoa.NSPrintPanelOptions.NSPrintPanelShowsPageSetupAccessory NSPrintPanelShowsPageSetupAccessory;
 public static const int NSPrintPanelShowsPaperSize = 4;
 public static const int NSPrintPanelShowsPreview = 131072;
 public static const int NSPrintPanelShowsScaling = 16;
@@ -3403,7 +3351,7 @@
 public static const int NSSaveAsOperation = 1;
 public static const int NSSaveOperation = 0;
 public static const int NSSaveToOperation = 2;
-alias Cocoa.NSImageScaling.NSImageScaleNone NSScaleNone;
+alias Cocoa.NSImageScaling.NSScaleNone NSScaleNone;
 public static const int NSScaleProportionally = 0;
 public static const int NSScaleToFit = 1;
 public static const int NSScreenChangedEventType = 8;
@@ -3456,7 +3404,7 @@
 public static const int NSServiceMiscellaneousError = 66800;
 public static const int NSServiceRequestTimedOutError = 66562;
 alias Cocoa.NSBezelStyle.NSShadowlessSquareBezelStyle NSShadowlessSquareBezelStyle;
-public static const Cocoa.NSUInteger NSShiftKeyMask = 131072;
+public static const int NSShiftKeyMask = 131072;
 public static const int NSShowControlGlyphs = 1;
 public static const int NSShowInvisibleGlyphs = 2;
 public static const int NSSingleDateMode = 0;
@@ -3510,7 +3458,7 @@
 public static const int NSTableViewFirstColumnOnlyAutoresizingStyle = 5;
 public static const int NSTableViewGridNone = 0;
 public static const int NSTableViewLastColumnOnlyAutoresizingStyle = 4;
-alias NSTableViewColumnAutoresizingStyle.NSTableViewNoColumnAutoresizing NSTableViewNoColumnAutoresizing;
+alias Cocoa.NSTableViewColumnAutoresizingStyle.NSTableViewNoColumnAutoresizing NSTableViewNoColumnAutoresizing;
 public static const int NSTableViewReverseSequentialColumnAutoresizingStyle = 3;
 public static const int NSTableViewSelectionHighlightStyleRegular = 0;
 public static const int NSTableViewSelectionHighlightStyleSourceList = 1;
@@ -3543,7 +3491,7 @@
 public static const int NSTextBlockTopAlignment = 0;
 public static const int NSTextBlockWidth = 0;
 public static const int NSTextCellType = 1;
-alias NSDatePickerStyle.NSTextFieldAndStepperDatePickerStyle NSTextFieldAndStepperDatePickerStyle;
+alias Cocoa.NSDatePickerStyle.NSTextFieldAndStepperDatePickerStyle NSTextFieldAndStepperDatePickerStyle;
 public static const int NSTextFieldDatePickerStyle = 2;
 public static const int NSTextFieldRoundedBezel = 1;
 public static const int NSTextFieldSquareBezel = 0;
@@ -3621,7 +3569,7 @@
 public static const int NSUnknownPageOrder = 2;
 public static const int NSUnknownPointingDevice = 0;
 public static const int NSUnscaledWindowMask = 2048;
-public static const wchar NSUpArrowFunctionKey = 63232;
+public static const int NSUpArrowFunctionKey = 63232;
 public static const int NSUpTextMovement = 21;
 public static const int NSUpdateWindowsRunLoopOrdering = 500000;
 public static const int NSUserFunctionKey = 63286;
@@ -3673,14 +3621,14 @@
 public static const int NSWritingDirectionLeftToRight = 0;
 public static const int NSWritingDirectionNatural = -1;
 public static const int NSWritingDirectionRightToLeft = 1;
-alias NSDatePickerElementFlags.NSYearMonthDatePickerElementFlag NSYearMonthDatePickerElementFlag;
-alias NSDatePickerElementFlags.NSYearMonthDayDatePickerElementFlag NSYearMonthDayDatePickerElementFlag;
-alias CFStringEncoding.kCFStringEncodingUTF8 kCFStringEncodingUTF8;
+alias Cocoa.NSDatePickerElementFlags.NSYearMonthDatePickerElementFlag NSYearMonthDatePickerElementFlag;
+alias Cocoa.NSDatePickerElementFlags.NSYearMonthDayDatePickerElementFlag NSYearMonthDayDatePickerElementFlag;
+public static const int kCFStringEncodingUTF8 = 134217984;
 public static const int NSASCIIStringEncoding = 1;
 public static const int NSAdminApplicationDirectory = 4;
 public static const int NSAggregateExpressionType = 14;
-alias NSSearchPathDirectory.NSAllApplicationsDirectory NSAllApplicationsDirectory;
-alias NSSearchPathDomainMask.NSAllDomainsMask NSAllDomainsMask;
+alias Cocoa.NSSearchPathDirectory.NSAllApplicationsDirectory NSAllApplicationsDirectory;
+alias Cocoa.NSSearchPathDomainMask.NSAllDomainsMask NSAllDomainsMask;
 public static const int NSAllLibrariesDirectory = 101;
 public static const int NSAllPredicateModifier = 1;
 public static const int NSAnchoredSearch = 8;
@@ -3913,7 +3861,7 @@
 public static const int NSNumberFormatterBehavior10_4 = 1040;
 public static const int NSNumberFormatterBehaviorDefault = 0;
 public static const int NSNumberFormatterCurrencyStyle = 2;
-alias NSNumberFormatterStyle.NSNumberFormatterDecimalStyle NSNumberFormatterDecimalStyle;
+alias Cocoa.NSNumberFormatterStyle.NSNumberFormatterDecimalStyle NSNumberFormatterDecimalStyle;
 public static const int NSNumberFormatterNoStyle = 0;
 public static const int NSNumberFormatterPadAfterPrefix = 1;
 public static const int NSNumberFormatterPadAfterSuffix = 3;
--- a/dwt/internal/cocoa/SWTDragSourceDelegate.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/internal/cocoa/SWTDragSourceDelegate.d	Thu Jan 15 23:08:54 2009 +0100
@@ -15,6 +15,7 @@
 
 import dwt.dwthelper.utils;
 import dwt.internal.cocoa.NSObject;
+import objc = dwt.internal.objc.runtime;
 
 public class SWTDragSourceDelegate : NSObject {
 
--- a/dwt/internal/objc/cocoa/Cocoa.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/internal/objc/cocoa/Cocoa.d	Thu Jan 15 23:08:54 2009 +0100
@@ -8,8 +8,42 @@
 module dwt.internal.objc.cocoa.Cocoa;
 
 import tango.stdc.config;
+
+import dwt.internal.c.Carbon;
+import dwt.internal.objc.runtime;
+
+// NSPathUtilities.h
+enum NSSearchPathDirectory
+{
+    NSApplicationDirectory = 1,
+    NSDemoApplicationDirectory,
+    NSDeveloperApplicationDirectory,
+    NSAdminApplicationDirectory,
+    NSLibraryDirectory,
+    NSDeveloperDirectory,
+    NSUserDirectory,
+    NSDocumentationDirectory,
+    NSDocumentDirectory,
+    NSCoreServiceDirectory,
+    NSDesktopDirectory = 12,
+    NSCachesDirectory = 13,
+    NSApplicationSupportDirectory = 14,
+    NSDownloadsDirectory = 15,
+    NSAllApplicationsDirectory = 100,
+    NSAllLibrariesDirectory = 101
+}
+
+enum NSSearchPathDomainMask
+{
+    NSUserDomainMask = 1,
+    NSLocalDomainMask = 2,
+    NSNetworkDomainMask = 4,
+    NSSystemDomainMask = 8,
+    NSAllDomainsMask = 0x0ffff,
+}
+
+// This needs to be down here otherwise the above enums will cause forward reference errors
 import bindings = dwt.internal.objc.cocoa.bindings;
-import dwt.internal.objc.runtime;
 
 extern (C)
 {
@@ -149,6 +183,7 @@
 
 
 
+
 //NSAccessibility.h
 alias bindings.NSAccessibilityActionDescription NSAccessibilityActionDescription;
 alias bindings.NSAccessibilityPostNotification NSAccessibilityPostNotification;
@@ -273,7 +308,12 @@
     NSImageScaleProportionallyDown = 0,
     NSImageScaleAxesIndependently,
     NSImageScaleNone,
-    NSImageScaleProportionallyUpOrDown
+    NSImageScaleProportionallyUpOrDown,
+
+    // Deprecated, only for dwt compatibility
+    NSScaleProportionally = NSImageScaleProportionallyDown,
+    NSScaleToFit = NSImageScaleAxesIndependently,
+    NSScaleNone = NSImageScaleNone
 }
 
 enum NSCellImagePosition : NSUInteger
@@ -289,6 +329,26 @@
 
 
 
+// NSDatePicker.h
+enum NSDatePickerElementFlags : NSUInteger
+{
+    NSHourMinuteDatePickerElementFlag = 0x000c,
+    NSHourMinuteSecondDatePickerElementFlag = 0x000e,
+    NSTimeZoneDatePickerElementFlag = 0x0010,
+    NSYearMonthDatePickerElementFlag = 0x00c0,
+    NSYearMonthDayDatePickerElementFlag = 0x00e0,
+    NSEraDatePickerElementFlag = 0x0100,
+}
+
+enum NSDatePickerStyle : NSUInteger
+{
+    NSTextFieldAndStepperDatePickerStyle = 0,
+    NSClockAndCalendarDatePickerStyle = 1,
+    NSTextFieldDatePickerStyle = 2
+}
+
+
+
 // NSDragging.h
 enum NSDragOperation : uint
 {
@@ -429,22 +489,6 @@
 
 
 
-// NSImageCell.h
-enum NSImageAlignment
-{
-    NSImageAlignCenter = 0,
-    NSImageAlignTop,
-    NSImageAlignTopLeft,
-    NSImageAlignTopRight,
-    NSImageAlignLeft,
-    NSImageAlignBottom,
-    NSImageAlignBottomLeft,
-    NSImageAlignBottomRight,
-    NSImageAlignRight
-}
-
-
-
 // NSBitmapImageRep.h
 enum NSTIFFCompression : NSUInteger {
     NSTIFFCompressionNone = 1,
@@ -464,6 +508,18 @@
 }
 
 
+// NSNumberFormatter.h
+enum NSNumberFormatterStyle
+{
+    NSNumberFormatterNoStyle = kCFNumberFormatterNoStyle,
+    NSNumberFormatterDecimalStyle = kCFNumberFormatterDecimalStyle,
+    NSNumberFormatterCurrencyStyle = kCFNumberFormatterCurrencyStyle,
+    NSNumberFormatterPercentStyle = kCFNumberFormatterPercentStyle,
+    NSNumberFormatterScientificStyle = kCFNumberFormatterScientificStyle,
+    NSNumberFormatterSpellOutStyle = kCFNumberFormatterSpellOutStyle
+}
+
+
 
 // NSObjCRuntime.h
 alias bindings.NSGetSizeAndAlignment NSGetSizeAndAlignment;
@@ -538,14 +594,56 @@
 
 
 
-// NSPathUtilities.h 
+// NSPathUtilities.h
+//enum NSSearchPathDirectory
+//{
+//    NSApplicationDirectory = 1,
+//    NSDemoApplicationDirectory,
+//    NSDeveloperApplicationDirectory,
+//    NSAdminApplicationDirectory,
+//    NSLibraryDirectory,
+//    NSDeveloperDirectory,
+//    NSUserDirectory,
+//    NSDocumentationDirectory,
+//    NSDocumentDirectory,
+//    NSCoreServiceDirectory,
+//    NSDesktopDirectory = 12,
+//    NSCachesDirectory = 13,
+//    NSApplicationSupportDirectory = 14,
+//    NSDownloadsDirectory = 15,
+//    NSAllApplicationsDirectory = 100,
+//    NSAllLibrariesDirectory = 101
+//}
+//
+//enum NSSearchPathDomainMask
+//{
+//    NSUserDomainMask = 1,
+//    NSLocalDomainMask = 2,
+//    NSNetworkDomainMask = 4,
+//    NSSystemDomainMask = 8,
+//    NSAllDomainsMask = 0x0ffff,
+//}
+
 alias bindings.NSSearchPathForDirectoriesInDomains NSSearchPathForDirectoriesInDomains;
 alias bindings.NSTemporaryDirectory NSTemporaryDirectory;
 
 
 
+// NSPrintPanle.h
+enum NSPrintPanelOptions : NSInteger
+{
+    NSPrintPanelShowsCopies = 0x01,
+    NSPrintPanelShowsPageRange = 0x02,
+    NSPrintPanelShowsPaperSize = 0x04,
+    NSPrintPanelShowsOrientation = 0x08,
+    NSPrintPanelShowsScaling = 0x10,
+    NSPrintPanelShowsPageSetupAccessory = 0x100,
+    NSPrintPanelShowsPreview = 0x20000
+}
+
+
+
 // NSString.h
-
 enum NSStringEncoding : NSUInteger
 {
     NSASCIIStringEncoding = 1,
@@ -575,6 +673,33 @@
 
 
 
+// NSTableView.h
+enum NSTableViewColumnAutoresizingStyle : NSUInteger
+{
+    NSTableViewNoColumnAutoresizing = 0,
+    NSTableViewUniformColumnAutoresizingStyle,
+    NSTableViewSequentialColumnAutoresizingStyle,
+    NSTableViewReverseSequentialColumnAutoresizingStyle,
+    NSTableViewLastColumnOnlyAutoresizingStyle,
+    NSTableViewFirstColumnOnlyAutoresizingStyle
+}
+
+
+
+// NSTabView.h
+enum NSTabViewType
+{
+    NSTopTabsBezelBorder     = 0,
+    NSLeftTabsBezelBorder    = 1,
+    NSBottomTabsBezelBorder  = 2,
+    NSRightTabsBezelBorder   = 3,
+    NSNoTabsBezelBorder      = 4,
+    NSNoTabsLineBorder       = 5,
+    NSNoTabsNoBorder         = 6
+}
+
+
+
 // NSText.h
 enum NSTextAlignment
 {
--- a/dwt/internal/objc/cocoa/bindings.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/internal/objc/cocoa/bindings.d	Thu Jan 15 23:08:54 2009 +0100
@@ -12,7 +12,6 @@
 import dwt.internal.c.Carbon;
 import dwt.internal.cocoa.NSRect;
 import dwt.internal.objc.cocoa.Cocoa;
-import dwt.internal.cocoa.OS;
 import dwt.internal.objc.runtime;
 
 alias c_long NSInteger;
@@ -53,5 +52,5 @@
 
 
 // NSPathUtilities.h 
-id NSSearchPathForDirectoriesInDomains (NSSearchPathDirectory directory,NSSearchPathDomainMask domainMask,BOOL expandTilde);
+id NSSearchPathForDirectoriesInDomains (NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask,BOOL expandTilde);
 id NSTemporaryDirectory ();
\ No newline at end of file
--- a/dwt/widgets/Button.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Button.d	Thu Jan 15 23:08:54 2009 +0100
@@ -79,6 +79,10 @@
  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
  */
 public class Button : Control {
+
+    alias Control.setBackground setBackground;
+    alias Control.setForeground setForeground;
+    
     String text = "";
     Image image;
     bool grayed;
--- a/dwt/widgets/Combo.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Combo.d	Thu Jan 15 23:08:54 2009 +0100
@@ -7,7 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
-  *     
+ *     
  * Port to the D programming language:
  *     Jacob Carlborg <doob@me.com>
  *******************************************************************************/
@@ -93,7 +93,7 @@
     bool receivingFocus;
     NSRange* selectionRange;
     NSRange selectionRangeStruct;
-
+    
     /**
      * the operating system limit for the number of characters
      * that the text field in an instance of this class can hold
@@ -101,15 +101,15 @@
     public static const int LIMIT;
     
     /*
-    * These values can be different on different platforms.
-    * Therefore they are not initialized in the declaration
-    * to stop the compiler from inlining.
-    */
+     * These values can be different on different platforms.
+     * Therefore they are not initialized in the declaration
+     * to stop the compiler from inlining.
+     */
     static this () {
         LIMIT = 0x7FFFFFFF;
     }
     
-
+    
 /**
  * Constructs a new instance of this class given its parent
  * and a style value describing its behavior and appearance.
@@ -310,26 +310,26 @@
 
 static int checkStyle (int style) {
     /*
-    * Feature in Windows.  It is not possible to create
-    * a combo box that has a border using Windows style
-    * bits.  All combo boxes draw their own border and
-    * do not use the standard Windows border styles.
-    * Therefore, no matter what style bits are specified,
-    * clear the BORDER bits so that the DWT style will
-    * match the Windows widget.
-    *
-    * The Windows behavior is currently implemented on
-    * all platforms.
-    */
+     * Feature in Windows.  It is not possible to create
+     * a combo box that has a border using Windows style
+     * bits.  All combo boxes draw their own border and
+     * do not use the standard Windows border styles.
+     * Therefore, no matter what style bits are specified,
+     * clear the BORDER bits so that the DWT style will
+     * match the Windows widget.
+     *
+     * The Windows behavior is currently implemented on
+     * all platforms.
+     */
     style &= ~DWT.BORDER;
-
+    
     /*
-    * Even though it is legal to create this widget
-    * with scroll bars, they serve no useful purpose
-    * because they do not automatically scroll the
-    * widget's client area.  The fix is to clear
-    * the DWT style.
-    */
+     * Even though it is legal to create this widget
+     * with scroll bars, they serve no useful purpose
+     * because they do not automatically scroll the
+     * widget's client area.  The fix is to clear
+     * the DWT style.
+     */
     style &= ~(DWT.H_SCROLL | DWT.V_SCROLL);
     style = checkBits (style, DWT.DROP_DOWN, DWT.SIMPLE, 0, 0, 0, 0);
     if ((style & DWT.SIMPLE) !is 0) return style & ~DWT.READ_ONLY;
@@ -380,12 +380,12 @@
     width = cast(int)Math.ceil (size.width);
     height = cast(int)Math.ceil (size.height);
     /*
-    * Feature in Cocoa.  Attempting to create an NSComboBox with a
-    * height > 27 spews a very long warning message to stdout and
-    * often draws the combo incorrectly.  The workaround is to limit
-    * the returned height of editable Combos to the height that is
-    * required to display their text, even if a larger hHint is specified.
-    */
+     * Feature in Cocoa.  Attempting to create an NSComboBox with a
+     * height > 27 spews a very long warning message to stdout and
+     * often draws the combo incorrectly.  The workaround is to limit
+     * the returned height of editable Combos to the height that is
+     * required to display their text, even if a larger hHint is specified.
+     */
     if (hHint !is DWT.DEFAULT) {
         if ((style & DWT.READ_ONLY) !is 0 || hHint < height) height = hHint;
     }
@@ -802,7 +802,7 @@
         return cast(int)/*64*/(cast(NSComboBox)view).numberOfVisibleItems();
     }
 }
-    
+
 /**
  * Searches the receiver's list starting at the first item
  * (index 0) until an item is found that is equal to the 
@@ -1571,12 +1571,12 @@
 
 NSRange textView_willChangeSelectionFromCharacterRange_toCharacterRange(objc.id id, objc.SEL sel, objc.id aTextView, objc.id oldSelectedCharRange, objc.id newSelectedCharRange) {
     /*
-    * If the selection is changing as a result of the receiver getting focus
-    * then return the receiver's last selection range, otherwise the full
-    * text will be automatically selected.
-    */
+     * If the selection is changing as a result of the receiver getting focus
+     * then return the receiver's last selection range, otherwise the full
+     * text will be automatically selected.
+     */
     if (receivingFocus && selectionRange !is null) return selectionRangeStruct;
-
+    
     /* allow the selection change to proceed */
     NSRange result = NSRange();
     OS.memmove(&result, newSelectedCharRange, NSRange.sizeof);
--- a/dwt/widgets/Control.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Control.d	Thu Jan 15 23:08:54 2009 +0100
@@ -2565,10 +2565,10 @@
 //  redrawWidget (handle, false);
 }
 
-void setBackground (float [] color) {
+void setBackground (Carbon.CGFloat [] color) {
 }
 
-void setBackground (int control, float [] color) {
+void setBackground (int control, Carbon.CGFloat [] color) {
 //  ControlFontStyleRec fontStyle = new ControlFontStyleRec ();
 //  OS.GetControlData (control, cast(short) OS.kControlEntireControl, OS.kControlFontStyleTag, ControlFontStyleRec.sizeof, fontStyle, null);
 //  if (color !is null) {
--- a/dwt/widgets/CoolBar.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/CoolBar.d	Thu Jan 15 23:08:54 2009 +0100
@@ -124,15 +124,15 @@
         }
     };
     int[] events = [
-        DWT.Dispose, 
-        DWT.MouseDown,
-        DWT.MouseExit, 
-        DWT.MouseMove, 
-        DWT.MouseUp, 
-        DWT.MouseDoubleClick,
-        DWT.Paint,
-        DWT.Resize
-    ];
+                    DWT.Dispose, 
+                    DWT.MouseDown,
+                    DWT.MouseExit, 
+                    DWT.MouseMove, 
+                    DWT.MouseUp, 
+                    DWT.MouseDoubleClick,
+                    DWT.Paint,
+                    DWT.Resize
+                    ];
     for (int i = 0; i < events.length; i++) {
         addListener(events[i], listener);   
     }
@@ -343,7 +343,7 @@
     newRow[index] = item;
     System.arraycopy(items[rowIndex], index, newRow, index + 1, oldLength - index);
     items[rowIndex] = newRow;
-
+    
     /* Adjust the width of the item to the left. */
     if (index > 0) {
         CoolItem left = items[rowIndex][index - 1];
@@ -434,7 +434,7 @@
     newOriginals [index] = item;
     originalItems = newOriginals;
     layoutItems();
-
+    
 }
 void destroyItem(CoolItem item) {
     if (inDispose) return;
@@ -512,7 +512,7 @@
     int width = bounds.width + (bounds.x - x);
     item.setBounds(x, bounds.y, width, bounds.height);
     item.requestedWidth = width;
-
+    
     int damagedWidth = bounds.x - x + CoolItem.MINIMUM_WIDTH;
     if (damagedWidth > CoolItem.MINIMUM_WIDTH) {
         internalRedraw(x, bounds.y, damagedWidth, bounds.height);
@@ -737,23 +737,23 @@
                     int grabberHeight = bounds.height - (2 * grabberTrim) - 1;
                     gc.setForeground(shadowColor);
                     rect = fixRectangle(
-                            bounds.x + CoolItem.MARGIN_WIDTH, 
-                            bounds.y + grabberTrim, 
-                            2, 
-                            grabberHeight);
+                                        bounds.x + CoolItem.MARGIN_WIDTH, 
+                                        bounds.y + grabberTrim, 
+                                        2, 
+                                        grabberHeight);
                     gc.drawRectangle(rect);
                     gc.setForeground(highlightColor);
                     rect = fixRectangle(
-                            bounds.x + CoolItem.MARGIN_WIDTH, 
-                            bounds.y + grabberTrim + 1, 
-                            bounds.x + CoolItem.MARGIN_WIDTH, 
-                            bounds.y + grabberTrim + grabberHeight - 1);
+                                        bounds.x + CoolItem.MARGIN_WIDTH, 
+                                        bounds.y + grabberTrim + 1, 
+                                        bounds.x + CoolItem.MARGIN_WIDTH, 
+                                        bounds.y + grabberTrim + grabberHeight - 1);
                     gc.drawLine(rect.x, rect.y, rect.width, rect.height);
                     rect = fixRectangle(
-                            bounds.x + CoolItem.MARGIN_WIDTH, 
-                            bounds.y + grabberTrim, 
-                            bounds.x + CoolItem.MARGIN_WIDTH + 1, 
-                            bounds.y + grabberTrim);
+                                        bounds.x + CoolItem.MARGIN_WIDTH, 
+                                        bounds.y + grabberTrim, 
+                                        bounds.x + CoolItem.MARGIN_WIDTH + 1, 
+                                        bounds.y + grabberTrim);
                     gc.drawLine(rect.x, rect.y, rect.width, rect.height);
                 }
             }
@@ -846,7 +846,7 @@
     for (int row = 0; row < items.length; row++) {
         int count = items[row].length;
         int x = 0;
-
+        
         /* determine the height and the available width for the row */
         int rowHeight = 0;
         int available = width;
@@ -856,7 +856,7 @@
             available -= item.internalGetMinimumWidth();    
         }
         if (row > 0) y += rowSpacing;
-    
+        
         /* lay the items out */
         for (int i = 0; i < count; i++) {
             CoolItem child = items[row][i];
@@ -956,7 +956,7 @@
     if (itemOrder is null) error(DWT.ERROR_NULL_ARGUMENT);
     int count = originalItems.length;
     if (itemOrder.length !is count) error(DWT.ERROR_INVALID_ARGUMENT);
-
+    
     /* Ensure that itemOrder does not contain any duplicates. */    
     bool [] set = new bool [count];
     for (int i = 0; i < set.length; i++) set [i] = false;
--- a/dwt/widgets/CoolItem.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/CoolItem.d	Thu Jan 15 23:08:54 2009 +0100
@@ -37,7 +37,7 @@
 import dwt.widgets.ToolBar;
 import dwt.widgets.ToolItem;
 import dwt.widgets.TypedListener;
- 
+
 /**
  * Instances of this class are selectable user interface
  * objects that represent the dynamically positionable
@@ -281,7 +281,7 @@
     ImageData imageData = new ImageData (width, height, 4, palette);
     imageData.transparentPixel = 1;
     Image image = new Image (display, imageData);
-        
+    
     GC gc = new GC (image, parent.getStyle() & DWT.RIGHT_TO_LEFT);
     gc.setBackground (background);
     gc.fillRectangle (0, 0, width, height);
@@ -641,10 +641,10 @@
                 chevron = new ToolBar (parent, DWT.FLAT | DWT.NO_FOCUS);
                 ToolItem toolItem = new ToolItem (chevron, DWT.PUSH);
                 toolItem.addListener (DWT.Selection, new class () Listener {
-                    public void handleEvent (Event event) {
-                        this.outer.onSelection (event);
-                    }
-                });
+                                      public void handleEvent (Event event) {
+                                      this.outer.onSelection (event);
+                                      }
+                                      });
             }
             int controlHeight, currentImageHeight = 0;
             if ((parent.style & DWT.VERTICAL) !is 0) {
@@ -664,10 +664,10 @@
             }
             chevron.setBackground (parent.getBackground());
             chevron.setBounds (parent.fixRectangle (
-                itemBounds.x + width - CHEVRON_LEFT_MARGIN - CHEVRON_IMAGE_WIDTH - CHEVRON_HORIZONTAL_TRIM,
-                itemBounds.y,
-                CHEVRON_IMAGE_WIDTH + CHEVRON_HORIZONTAL_TRIM,
-                height));
+                                                    itemBounds.x + width - CHEVRON_LEFT_MARGIN - CHEVRON_IMAGE_WIDTH - CHEVRON_HORIZONTAL_TRIM,
+                                                    itemBounds.y,
+                                                    CHEVRON_IMAGE_WIDTH + CHEVRON_HORIZONTAL_TRIM,
+                                                    height));
             chevron.setVisible(true);
         } else {
             if (chevron !is null) {
--- a/dwt/widgets/DateTime.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/DateTime.d	Thu Jan 15 23:08:54 2009 +0100
@@ -32,6 +32,7 @@
 import tango.text.convert.Format;
 
 import Carbon = dwt.internal.c.Carbon;
+import dwt.internal.objc.cocoa.Cocoa;
 import dwt.widgets.Composite;
 import dwt.widgets.TypedListener;
 
@@ -63,7 +64,7 @@
  * @since 3.3
  */
 public class DateTime : Composite {
-
+    
 /**
  * Constructs a new instance of this class given its parent
  * and a style value describing its behavior and appearance.
@@ -100,12 +101,12 @@
 
 static int checkStyle (int style) {
     /*
-    * Even though it is legal to create this widget
-    * with scroll bars, they serve no useful purpose
-    * because they do not automatically scroll the
-    * widget's client area.  The fix is to clear
-    * the DWT style.
-    */
+     * Even though it is legal to create this widget
+     * with scroll bars, they serve no useful purpose
+     * because they do not automatically scroll the
+     * widget's client area.  The fix is to clear
+     * the DWT style.
+     */
     style &= ~(DWT.H_SCROLL | DWT.V_SCROLL);
     style = checkBits (style, DWT.MEDIUM, DWT.SHORT, DWT.LONG, 0, 0, 0);
     return checkBits (style, DWT.DATE, DWT.TIME, DWT.CALENDAR, 0, 0, 0);
@@ -271,7 +272,7 @@
 
 String getNameText() {
     return (style & DWT.TIME) !is 0 ? Format("{}{}{}{}{}", getHours() , ":" , getMinutes() , ":" , getSeconds())
-            : Format("{}{}{}{}{}", (getMonth() + 1) , "/" , getDay() , "/" , getYear());
+    : Format("{}{}{}{}{}", (getMonth() + 1) , "/" , getDay() , "/" , getYear());
 }
 
 /**
@@ -371,7 +372,7 @@
     checkWidget ();
     NSCalendarDate date = getCalendarDate();
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(year, month + 1, day,
-            date.hourOfDay(), date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
+                                                         date.hourOfDay(), date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
     if (newDate.yearOfCommonEra() is year && newDate.monthOfYear() is month + 1 && newDate.dayOfMonth() is day) {
         (cast(NSDatePicker)view).setDateValue(newDate);
     }
@@ -394,7 +395,7 @@
     checkWidget ();
     NSCalendarDate date = getCalendarDate();
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), date.monthOfYear(), day,
-            date.hourOfDay(), date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
+                                                         date.hourOfDay(), date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
     if (newDate.yearOfCommonEra() is date.yearOfCommonEra() && newDate.monthOfYear() is date.monthOfYear() && newDate.dayOfMonth() is day) {
         (cast(NSDatePicker)view).setDateValue(newDate);
     }
@@ -428,7 +429,7 @@
     if (hours < 0 || hours > 23) return;
     NSCalendarDate date = getCalendarDate();
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), date.monthOfYear(), date.dayOfMonth(),
-            hours, date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
+                                                         hours, date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
     (cast(NSDatePicker)view).setDateValue(newDate);
 }
 
@@ -450,7 +451,7 @@
     if (minutes < 0 || minutes > 59) return;
     NSCalendarDate date = getCalendarDate();
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), date.monthOfYear(), date.dayOfMonth(),
-            date.hourOfDay(), minutes, date.secondOfMinute(), date.timeZone());
+                                                         date.hourOfDay(), minutes, date.secondOfMinute(), date.timeZone());
     (cast(NSDatePicker)view).setDateValue(newDate);
 }
 
@@ -471,7 +472,7 @@
     checkWidget ();
     NSCalendarDate date = getCalendarDate();
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), month + 1, date.dayOfMonth(),
-            date.hourOfDay(), date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
+                                                         date.hourOfDay(), date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
     if (newDate.yearOfCommonEra() is date.yearOfCommonEra() && newDate.monthOfYear() is month + 1 && newDate.dayOfMonth() is date.dayOfMonth()) {
         (cast(NSDatePicker)view).setDateValue(newDate);
     }
@@ -495,7 +496,7 @@
     if (seconds < 0 || seconds > 59) return;
     NSCalendarDate date = getCalendarDate();
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), date.monthOfYear(), date.dayOfMonth(),
-            date.hourOfDay(), date.minuteOfHour(), seconds, date.timeZone());
+                                                         date.hourOfDay(), date.minuteOfHour(), seconds, date.timeZone());
     (cast(NSDatePicker)view).setDateValue(newDate);
 }
 
@@ -518,7 +519,7 @@
     if (hours < 0 || hours > 23 || minutes < 0 || minutes > 59 || seconds < 0 || seconds > 59) return;
     NSCalendarDate date = getCalendarDate();
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), date.monthOfYear(), date.dayOfMonth(),
-            hours, minutes, seconds, date.timeZone());
+                                                         hours, minutes, seconds, date.timeZone());
     (cast(NSDatePicker)view).setDateValue(newDate);
 }
 
@@ -539,7 +540,7 @@
     checkWidget ();
     NSCalendarDate date = getCalendarDate();
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(year, date.monthOfYear(), date.dayOfMonth(),
-            date.hourOfDay(), date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
+                                                         date.hourOfDay(), date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
     if (newDate.yearOfCommonEra() is year && newDate.monthOfYear() is date.monthOfYear() && newDate.dayOfMonth() is date.dayOfMonth()) {
         (cast(NSDatePicker)view).setDateValue(newDate);
     }
--- a/dwt/widgets/DirectoryDialog.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/DirectoryDialog.d	Thu Jan 15 23:08:54 2009 +0100
@@ -47,7 +47,7 @@
  */
 public class DirectoryDialog : Dialog {
     String message = "", filterPath = "";
-
+    
 /**
  * Constructs a new instance of this class given only its parent.
  *
@@ -142,7 +142,7 @@
         NSString filename = panel.filename();
         directoryPath = filterPath = filename.getString();
     }
-//  options.optionFlags = OS.kNavSupportPackages | OS.kNavAllowOpenPackages | OS.kNavAllowInvisibleFiles;
+    //  options.optionFlags = OS.kNavSupportPackages | OS.kNavAllowOpenPackages | OS.kNavAllowInvisibleFiles;
     return directoryPath;
 }
 
--- a/dwt/widgets/Display.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Display.d	Thu Jan 15 23:08:54 2009 +0100
@@ -563,7 +563,7 @@
             cascade = &NSPoint();
             cascade.x = frame.x;
             cascade.y = frame.y + frame.height;
-        }
+         }
         screenCascade[index] = &window.cascadeTopLeftFromPoint(*cascade);
     }
     
@@ -1768,17 +1768,17 @@
         initClasses ();
         
         if (!isEmbedded) {
-            initApplicationDelegate();	
+            initApplicationDelegate();  
             application.finishLaunching();
-        }
-		
-        timerDelegate = cast(SWTWindowDelegate)(new SWTWindowDelegate()).alloc().init();
-        
-        NSTextView textView = cast(NSTextView)(new NSTextView()).alloc();
-        textView.initWithFrame (NSRect ());
-        markedAttributes = textView.markedTextAttributes ();
-        markedAttributes.retain ();
-        textView.release ();
+         }
+         
+         timerDelegate = cast(SWTWindowDelegate)(new SWTWindowDelegate()).alloc().init();
+         
+         NSTextView textView = cast(NSTextView)(new NSTextView()).alloc();
+         textView.initWithFrame (NSRect ());
+         markedAttributes = textView.markedTextAttributes ();
+         markedAttributes.retain ();
+         textView.release ();
     }
     
     void initApplicationDelegate() {
--- a/dwt/widgets/ExpandBar.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/ExpandBar.d	Thu Jan 15 23:08:54 2009 +0100
@@ -104,7 +104,7 @@
 public this (Composite parent, int style) {
     super (parent, checkStyle (style));
     items = new ExpandItem [4]; 
-
+    
     listener = new class () Listener {
         public void handleEvent (Event event) {
             switch (event.type) {
@@ -134,10 +134,10 @@
     ScrollBar verticalBar = getVerticalBar ();
     if (verticalBar !is null) {
         verticalBar.addListener (DWT.Selection, new class () Listener {
-            public void handleEvent (Event event) {
-                onScroll (event);
-            }
-        });
+                                 public void handleEvent (Event event) {
+                                 onScroll (event);
+                                 }
+                                 });
     }
 }
 
@@ -419,7 +419,7 @@
     ExpandItem item = items [itemCount - 1];
     int maxHeight = item.y + getBandHeight () + spacing;
     if (item.expanded) maxHeight += item.height;
-
+    
     //claim bottom free space
     if (yCurrentScroll > 0 && height > maxHeight) {
         yCurrentScroll = Math.max (0, yCurrentScroll + maxHeight - height);
@@ -523,7 +523,7 @@
             }
             break;
         }
-        
+            
         default:
     }
 }
--- a/dwt/widgets/ExpandItem.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/ExpandItem.d	Thu Jan 15 23:08:54 2009 +0100
@@ -55,7 +55,7 @@
     static const int TEXT_INSET = 6;
     static const int BORDER = 1;
     static const int CHEVRON_SIZE = 24;
-
+    
 /**
  * Constructs a new instance of this class given its parent
  * and a style value describing its behavior and appearance.
@@ -143,22 +143,22 @@
         int px = x + 4 + 5;
         int py = y + 4 + 7;
         polyline1 = [
-                px,py, px+1,py, px+1,py-1, px+2,py-1, px+2,py-2, px+3,py-2, px+3,py-3,
-                px+3,py-2, px+4,py-2, px+4,py-1, px+5,py-1, px+5,py, px+6,py];
+                     px,py, px+1,py, px+1,py-1, px+2,py-1, px+2,py-2, px+3,py-2, px+3,py-3,
+                     px+3,py-2, px+4,py-2, px+4,py-1, px+5,py-1, px+5,py, px+6,py];
         py += 4;
         polyline2 = [
-                px,py, px+1,py, px+1,py-1, px+2,py-1, px+2,py-2, px+3,py-2, px+3,py-3,
-                px+3,py-2, px+4,py-2, px+4,py-1,  px+5,py-1, px+5,py, px+6,py];
+                     px,py, px+1,py, px+1,py-1, px+2,py-1, px+2,py-2, px+3,py-2, px+3,py-3,
+                     px+3,py-2, px+4,py-2, px+4,py-1,  px+5,py-1, px+5,py, px+6,py];
     } else {
         int px = x + 4 + 5;
         int py = y + 4 + 4;
         polyline1 = [
-                px,py, px+1,py, px+1,py+1, px+2,py+1, px+2,py+2, px+3,py+2, px+3,py+3,
-                px+3,py+2, px+4,py+2, px+4,py+1,  px+5,py+1, px+5,py, px+6,py];
+                     px,py, px+1,py, px+1,py+1, px+2,py+1, px+2,py+2, px+3,py+2, px+3,py+3,
+                     px+3,py+2, px+4,py+2, px+4,py+1,  px+5,py+1, px+5,py, px+6,py];
         py += 4;
         polyline2 = [
-                px,py, px+1,py, px+1,py+1, px+2,py+1, px+2,py+2, px+3,py+2, px+3,py+3,
-                px+3,py+2, px+4,py+2, px+4,py+1,  px+5,py+1, px+5,py, px+6,py];
+                     px,py, px+1,py, px+1,py+1, px+2,py+1, px+2,py+2, px+3,py+2, px+3,py+3,
+                     px+3,py+2, px+4,py+2, px+4,py+1,  px+5,py+1, px+5,py, px+6,py];
     }
     gc.setForeground (display.getSystemColor (DWT.COLOR_TITLE_FOREGROUND));
     gc.drawPolyline (polyline1);
--- a/dwt/widgets/FileDialog.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/FileDialog.d	Thu Jan 15 23:08:54 2009 +0100
@@ -15,7 +15,7 @@
 
 import dwt.dwthelper.utils;
 
- 
+
 import dwt.DWT;
 import dwt.DWTException;
 import dwt.internal.cocoa.NSArray;
@@ -56,7 +56,7 @@
     int filterIndex = -1;
     bool overwrite = true; //TODO: if setOverwrite(false) is implemented, change default to false for consistency
     static final char EXTENSION_SEPARATOR = ';';
-
+    
 /**
  * Constructs a new instance of this class given only its parent.
  *
@@ -237,7 +237,7 @@
                 if (i is 0) {
                     /* Filter path */
                     filterPath = pathOnly.getString();
-
+                    
                     /* File name */
                     fileName = fileNames [0] = filenameOnly.getString();
                 } else {                                    
--- a/dwt/widgets/Group.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Group.d	Thu Jan 15 23:08:54 2009 +0100
@@ -97,12 +97,12 @@
 static int checkStyle (int style) {
     style |= DWT.NO_FOCUS;
     /*
-    * Even though it is legal to create this widget
-    * with scroll bars, they serve no useful purpose
-    * because they do not automatically scroll the
-    * widget's client area.  The fix is to clear
-    * the DWT style.
-    */
+     * Even though it is legal to create this widget
+     * with scroll bars, they serve no useful purpose
+     * because they do not automatically scroll the
+     * widget's client area.  The fix is to clear
+     * the DWT style.
+     */
     return style & ~(DWT.H_SCROLL | DWT.V_SCROLL);
 }
 
@@ -138,7 +138,7 @@
     widget.setTitlePosition(OS.NSNoTitle);
     NSView contentWidget = cast(NSView)(new SWTView()).alloc();
     contentWidget.initWithFrame(NSRect());
-//  contentWidget.setDrawsBackground(false);
+    //  contentWidget.setDrawsBackground(false);
     widget.setContentView(contentWidget);
     contentView_ = contentWidget;
     view = widget;
--- a/dwt/widgets/Label.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Label.d	Thu Jan 15 23:08:54 2009 +0100
@@ -86,7 +86,7 @@
     bool isImage;
     NSTextField textView;
     NSImageView imageView;
-
+    
 /**
  * Constructs a new instance of this class given its parent
  * and a style value describing its behavior and appearance.
@@ -138,14 +138,14 @@
             extraAttributes.addObject(OS.NSAccessibilityHelpAttribute);
             extraAttributes.addObject(OS.NSAccessibilityDescriptionAttribute);
             extraAttributes.addObject(OS.NSAccessibilityTitleAttribute);
-
+            
             for (int i = extraAttributes.count() - 1; i >= 0; i--) {
                 NSString attribute = new NSString(extraAttributes.objectAtIndex(i).id);
                 if (accessible.internal_accessibilityAttributeValue(attribute, ACC.CHILDID_SELF) is null) {
                     extraAttributes.removeObjectAtIndex(i);
                 }
             }
-
+            
             if (extraAttributes.count() > 0) {
                 objc.id superResult = super.accessibilityAttributeNames(id, sel);
                 NSArray baseAttributes = new NSArray(superResult);
@@ -163,7 +163,7 @@
             }
         }
     }
-
+    
     return super.accessibilityAttributeNames(id, sel);
 }
 
@@ -230,7 +230,7 @@
         widget.setBoxType (OS.NSBoxCustom);
         NSSize offsetSize = NSSize ();
         widget.setContentViewMargins (offsetSize);
-
+        
         NSImageView imageWidget = cast(NSImageView) (new SWTImageView ()).alloc ();
         imageWidget.initWithFrame(NSRect ());
         imageWidget.setImageScaling (OS.NSScaleNone);
@@ -266,7 +266,7 @@
     char [] chars = new char [text.length ()];
     text.getChars (0, chars.length, chars, 0);
     int length = fixMnemonic (chars);
-
+    
     NSString str = NSString.stringWithCharacters(chars.toString16().ptr, length);
     NSAttributedString attribStr = (cast(NSAttributedString)(new NSAttributedString()).alloc()).initWithString(str, dict);
     attribStr.autorelease();
--- a/dwt/widgets/Link.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Link.d	Thu Jan 15 23:08:54 2009 +0100
@@ -159,7 +159,7 @@
     int border = getBorderWidth ();
     width += border * 2;
     height += border * 2;
-
+    
     // TODO is this true?  if so, can this rounding be turned off?
     /*
      * Bug in Cocoa.  NSTextStorage.size() seems to return a width
@@ -176,7 +176,7 @@
     scrollWidget.initWithFrame(NSRect ());
     scrollWidget.setDrawsBackground(false);
     scrollWidget.setBorderType(hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder);
-
+    
     NSTextView widget = cast(NSTextView)(new SWTTextView()).alloc();
     widget.initWithFrame(NSRect());
     widget.setEditable(false);
--- a/dwt/widgets/List.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/List.d	Thu Jan 15 23:08:54 2009 +0100
@@ -73,11 +73,18 @@
  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
  */
 public class List : Scrollable {
+
+    alias Scrollable.computeSize computeSize;
+    alias Scrollable.dragDetect dragDetect;
+    alias Scrollable.setBackground setBackground;
+    alias Scrollable.setBounds setBounds;
+    alias Scrollable.setFont setFont;
+
     NSTableColumn column;
     String [] items;
     int itemCount;
     bool ignoreSelect;
-
+    
 /**
  * Constructs a new instance of this class given its parent
  * and a style value describing its behavior and appearance.
@@ -126,17 +133,17 @@
     if (attributeName.isEqualToString (OS.NSAccessibilityDescriptionAttribute)) {
         return NSString.stringWith("").id;
     }
-
-//  if (attributeName.isEqualToString(OS.NSAccessibilityHeaderAttribute)) {
-//      /*
-//      * Bug in the Macintosh.  Even when the header is not visible,
-//      * VoiceOver still reports each column header's role for every row.
-//      * This is confusing and overly verbose.  The fix is to return
-//      * "no header" when the screen reader asks for the header, by
-//      * returning noErr without setting the event parameter.
-//      */
-//      return 0;
-//  }
+    
+    //  if (attributeName.isEqualToString(OS.NSAccessibilityHeaderAttribute)) {
+    //      /*
+    //      * Bug in the Macintosh.  Even when the header is not visible,
+    //      * VoiceOver still reports each column header's role for every row.
+    //      * This is confusing and overly verbose.  The fix is to return
+    //      * "no header" when the screen reader asks for the header, by
+    //      * returning noErr without setting the event parameter.
+    //      */
+    //      return 0;
+    //  }
     
     return super.accessibilityAttributeValue(id, sel, arg0);
 }
@@ -253,7 +260,7 @@
             width = Math.max (width, extent.x);
         }
         gc.dispose ();
-//      width += EXTRA_WIDTH;
+        //      width += EXTRA_WIDTH;
     } else {
         width = wHint;
     }
@@ -1034,13 +1041,14 @@
     bool result = super.sendKeyEvent (nsEvent, type);
     if (!result) return result;
     if (type !is DWT.KeyDown) return result;
-    short keyCode = nsEvent.keyCode ();
+    ushort keyCode = nsEvent.keyCode ();
     switch (keyCode) {
         case 76: /* KP Enter */
         case 36: { /* Return */
             postEvent (DWT.DefaultSelection);
             break;
         }
+        default:
     }
     return result;
 }
@@ -1135,7 +1143,7 @@
 }
 
 void setSelection (int index, bool notify) {
-//  checkWidget();
+    //  checkWidget();
     if (0 <= index && index < itemCount) {
         int [] ids = [index + 1];
         select (ids, ids.length, true);
--- a/dwt/widgets/ProgressBar.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/ProgressBar.d	Thu Jan 15 23:08:54 2009 +0100
@@ -247,7 +247,7 @@
  */
 public void setSelection (int value) {
     checkWidget();
-   (cast(NSProgressIndicator)view).setDoubleValue(value);
+    (cast(NSProgressIndicator)view).setDoubleValue(value);
 }
 
 /**
--- a/dwt/widgets/Sash.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Sash.d	Thu Jan 15 23:08:54 2009 +0100
@@ -126,7 +126,7 @@
         ourAttributes.addObject(OS.NSAccessibilityNextContentsAttribute);
         ourAttributes.addObject(OS.NSAccessibilityPreviousContentsAttribute);
         ourAttributes.addObject(OS.NSAccessibilityOrientationAttribute);
-
+        
         if (accessible !is null) {
             // See if the accessible will override or augment the standard list.
             // Help, title, and description can be overridden.
@@ -134,7 +134,7 @@
             extraAttributes.addObject(OS.NSAccessibilityHelpAttribute);
             extraAttributes.addObject(OS.NSAccessibilityDescriptionAttribute);
             extraAttributes.addObject(OS.NSAccessibilityTitleAttribute);
-
+            
             for (int i = extraAttributes.count() - 1; i >= 0; i--) {
                 NSString attribute = new NSString(extraAttributes.objectAtIndex(i).id);
                 if (accessible.internal_accessibilityAttributeValue(attribute, ACC.CHILDID_SELF) !is null) {
@@ -142,7 +142,7 @@
                 }
             }
         }
-
+        
         accessibilityAttributes = ourAttributes;
         accessibilityAttributes.retain();
     }
@@ -159,12 +159,12 @@
         
         if (returnObject !is null) returnValue = returnObject.id;
     }
-
+    
     if (returnValue !is null) return returnValue;
-
+    
     if (attributeName.isEqualToString (OS.NSAccessibilityRoleAttribute) || attributeName.isEqualToString (OS.NSAccessibilityRoleDescriptionAttribute)) {
         NSString roleText = OS.NSAccessibilitySplitterRole;
-
+        
         if (attributeName.isEqualToString (OS.NSAccessibilityRoleAttribute)) {
             return roleText.id;
         } else { // NSAccessibilityRoleDescriptionAttribute
@@ -182,8 +182,8 @@
     } else if (attributeName.isEqualToString (OS.NSAccessibilityMaxValueAttribute)) {
         NSRect parentBounds = view.bounds();
         float maxValue = (style & DWT.VERTICAL) !is 0 ?
-                parentBounds.width :
-                parentBounds.height;
+        parentBounds.width :
+        parentBounds.height;
         return NSNumber.numberWithInt(cast(int)maxValue).id;
     } else if (attributeName.isEqualToString (OS.NSAccessibilityMinValueAttribute)) {
         return NSNumber.numberWithInt(0).id;
@@ -220,7 +220,7 @@
         else
             return NSArray.array().id;
     }
-
+    
     return super.accessibilityAttributeValue(id, sel, arg0);
 }
 
@@ -263,8 +263,8 @@
 
 static int checkStyle (int style) {
     /*
-    * Macintosh only supports smooth dragging.
-    */
+     * Macintosh only supports smooth dragging.
+     */
     style |= DWT.SMOOTH;
     return checkBits (style, DWT.HORIZONTAL, DWT.VERTICAL, 0, 0, 0, 0);
 }
@@ -372,7 +372,7 @@
 
 void mouseDown(objc.id id, objc.SEL sel, objc.id theEvent) {
     //TODO use sendMouseEvent
-//  super.mouseDown(id, sel, theEvent);
+    //  super.mouseDown(id, sel, theEvent);
     NSEvent nsEvent = new NSEvent(theEvent);
     if (nsEvent.clickCount() !is 1) return;
     NSPoint location = nsEvent.locationInWindow();
@@ -397,7 +397,7 @@
 
 void mouseDragged(objc.id id, objc.SEL sel, objc.id theEvent) {
     //TODO use sendMouseEvent
-//  super.mouseDragged(id, sel, theEvent);
+    //  super.mouseDragged(id, sel, theEvent);
     if (!dragging) return;
     NSEvent nsEvent = new NSEvent(theEvent);
     NSPoint location = nsEvent.locationInWindow();
@@ -427,7 +427,7 @@
 
 void mouseUp(objc.id id, objc.SEL sel, objc.id theEvent) {
     //TODO use sendMouseEvent
-//  super.mouseUp(id, sel, theEvent);
+    //  super.mouseUp(id, sel, theEvent);
     if (!dragging) return;
     dragging = false;
     NSRect frame = view.frame();
--- a/dwt/widgets/Scale.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Scale.d	Thu Jan 15 23:08:54 2009 +0100
@@ -55,7 +55,7 @@
 public class Scale : Control {
     int increment = 1;
     int pageIncrement = 10;
-
+    
 /**
  * Constructs a new instance of this class given its parent
  * and a style value describing its behavior and appearance.
@@ -144,8 +144,8 @@
 void createHandle () {
     NSSlider widget = cast(NSSlider)(new SWTSlider()).alloc();
     NSRect rect = NSRect();
-        rect.width = 1;
-        rect.height = 1;
+    rect.width = 1;
+    rect.height = 1;
     widget.initWithFrame(rect);
     widget.setMaxValue(100);
     view = widget;
@@ -233,12 +233,12 @@
  */
 public int getSelection () {
     checkWidget();
-//  int value = OS.GetControl32BitValue (handle);
-//  if ((style & DWT.VERTICAL) !is 0) {
-//      int minimum = OS.GetControl32BitMinimum (handle);
-//      int maximum = OS.GetControl32BitMaximum (handle);
-//      value = maximum - value + minimum;
-//  }
+    //  int value = OS.GetControl32BitValue (handle);
+    //  if ((style & DWT.VERTICAL) !is 0) {
+    //      int minimum = OS.GetControl32BitMinimum (handle);
+    //      int maximum = OS.GetControl32BitMaximum (handle);
+    //      value = maximum - value + minimum;
+    //  }
     return cast(int)(cast(NSSlider)view).doubleValue();
 }
 
--- a/dwt/widgets/Scrollable.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Scrollable.d	Thu Jan 15 23:08:54 2009 +0100
@@ -50,6 +50,9 @@
  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
  */
 public abstract class Scrollable : Control {
+    
+    alias Widget.setInputState setInputState;
+    
     NSScrollView scrollView;
     ScrollBar horizontalBar, verticalBar;
     
--- a/dwt/widgets/Shell.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Shell.d	Thu Jan 15 23:08:54 2009 +0100
@@ -155,6 +155,13 @@
  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
  */
 public class Shell : Decorations {
+
+    alias Decorations.createHandle createHandle;
+    alias Decorations.setBounds setBounds;
+    alias Decorations.setCursor setCursor;
+    alias Decorations.setToolTipText setToolTipText;
+    alias Decorations.setZOrder setZOrder;
+
     NSWindow window;
     SWTWindowDelegate windowDelegate;
     NSBezierPath regionPath;
--- a/dwt/widgets/Slider.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Slider.d	Thu Jan 15 23:08:54 2009 +0100
@@ -15,7 +15,7 @@
 
 import dwt.dwthelper.utils;
 
- 
+
 import dwt.DWT;
 import dwt.DWTException;
 import dwt.events.SelectionEvent;
@@ -88,7 +88,7 @@
     int minimum, maximum, thumb;
     int increment = 1;
     int pageIncrement = 10;
-
+    
 /**
  * Constructs a new instance of this class given its parent
  * and a style value describing its behavior and appearance.
--- a/dwt/widgets/Spinner.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Spinner.d	Thu Jan 15 23:08:54 2009 +0100
@@ -80,7 +80,7 @@
     int digits = 0;
     
     static int GAP = 0;
-
+    
 /**
  * Constructs a new instance of this class given its parent
  * and a style value describing its behavior and appearance.
@@ -205,12 +205,12 @@
 
 static int checkStyle (int style) {
     /*
-    * Even though it is legal to create this widget
-    * with scroll bars, they serve no useful purpose
-    * because they do not automatically scroll the
-    * widget's client area.  The fix is to clear
-    * the DWT style.
-    */
+     * Even though it is legal to create this widget
+     * with scroll bars, they serve no useful purpose
+     * because they do not automatically scroll the
+     * widget's client area.  The fix is to clear
+     * the DWT style.
+     */
     return style & ~(DWT.H_SCROLL | DWT.V_SCROLL);
 }
 
@@ -264,25 +264,25 @@
  */
 public void copy () {
     checkWidget ();
-//  short [] selection = new short [2];
-//  if (OS.GetControlData (textHandle, cast(short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection, null) !is OS.noErr) return;
-//  if (selection [0] is selection [1]) return;
-//  int [] actualSize = new int [1];
-//  int [] ptr = new int [1];
-//  if (OS.GetControlData (textHandle, cast(short)OS.kControlEntireControl, OS.kControlEditTextCFStringTag, 4, ptr, actualSize) !is OS.noErr) return;
-//  CFRange range = new CFRange ();
-//  range.location = selection [0];
-//  range.length = selection [1] - selection [0];
-//  char [] buffer= new char [range.length];
-//  OS.CFStringGetCharacters (ptr [0], range, buffer);
-//  OS.CFRelease (ptr [0]);
-//  copyToClipboard (buffer);
+    //  short [] selection = new short [2];
+    //  if (OS.GetControlData (textHandle, cast(short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection, null) !is OS.noErr) return;
+    //  if (selection [0] is selection [1]) return;
+    //  int [] actualSize = new int [1];
+    //  int [] ptr = new int [1];
+    //  if (OS.GetControlData (textHandle, cast(short)OS.kControlEntireControl, OS.kControlEditTextCFStringTag, 4, ptr, actualSize) !is OS.noErr) return;
+    //  CFRange range = new CFRange ();
+    //  range.location = selection [0];
+    //  range.length = selection [1] - selection [0];
+    //  char [] buffer= new char [range.length];
+    //  OS.CFStringGetCharacters (ptr [0], range, buffer);
+    //  OS.CFRelease (ptr [0]);
+    //  copyToClipboard (buffer);
 }
 
 void createHandle () {
     NSView widget = cast(NSView)(new SWTView()).alloc();
     widget.initWithFrame(NSRect());
-//  widget.setDrawsBackground(false);
+    //  widget.setDrawsBackground(false);
     NSStepper buttonWidget = cast(NSStepper)(new SWTStepper()).alloc();
     buttonWidget.initWithFrame(NSRect());
     buttonWidget.setValueWraps((style & DWT.WRAP) !is 0);
@@ -290,7 +290,7 @@
     buttonWidget.setAction(OS.sel_sendSelection);
     NSTextField textWidget = cast(NSTextField)(new SWTTextField()).alloc();
     textWidget.initWithFrame(NSRect());
-//  textWidget.setTarget(widget);
+    //  textWidget.setTarget(widget);
     textWidget.setEditable((style & DWT.READ_ONLY) is 0);
     textFormatter = new NSNumberFormatter();
     textFormatter.alloc().init(); //.autorelease();
@@ -319,13 +319,13 @@
 public void cut () {
     checkWidget ();
     if ((style & DWT.READ_ONLY) !is 0) return;
-//  short [] selection = new short [2];
-//  if (OS.GetControlData (textHandle, cast(short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection, null) !is OS.noErr) return;
-//  if (selection [0] is selection [1]) return;
-//  char [] buffer = setText ("", selection [0], selection [1], true);
-//  if (buffer !is null) {
-//      copyToClipboard (buffer);
-//  }
+    //  short [] selection = new short [2];
+    //  if (OS.GetControlData (textHandle, cast(short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection, null) !is OS.noErr) return;
+    //  if (selection [0] is selection [1]) return;
+    //  char [] buffer = setText ("", selection [0], selection [1], true);
+    //  if (buffer !is null) {
+    //      copyToClipboard (buffer);
+    //  }
 }
 
 void deregister () {
@@ -488,11 +488,11 @@
     
     int delta = 0;
     wchar keyChar = 0;
-
+    
     if (chars.length() !is 1) return;
     
     keyChar = chars.characterAtIndex(0);
-
+    
     switch (keyChar) {
         case OS.NSEnterCharacter: /* KP Enter */
         case OS.NSNewlineCharacter: /* Return */
@@ -502,7 +502,7 @@
         case OS.NSPageDownFunctionKey: delta = -pageIncrement; break;
         case OS.NSDownArrowFunctionKey: delta = -getIncrement(); break;
         case OS.NSUpArrowFunctionKey: delta = getIncrement(); break;
-        
+            
         default: {
             NSCharacterSet numbers = new NSCharacterSet(NSCharacterSet.decimalDigitCharacterSet().id);
             bool isANumber = numbers.characterIsMember(cast(short) keyChar);
@@ -511,7 +511,7 @@
             if (isANumber || (isSeparator && digits > 0) || isMathSymbol) super.keyDown(id, sel, theEvent);
         }
     }
-
+    
     if (delta !is 0) {
         bool [] parseFail = new bool [1];
         int value = getSelectionText (parseFail);
@@ -553,10 +553,10 @@
 public void paste () {
     checkWidget ();
     if ((style & DWT.READ_ONLY) !is 0) return;
-//  String text = getClipboardText ();
-//  short [] selection = new short [2];
-//  if (OS.GetControlData (textHandle, cast(short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection, null) !is OS.noErr) return;
-//  setText (text, selection [0], selection [1], true);
+    //  String text = getClipboardText ();
+    //  short [] selection = new short [2];
+    //  if (OS.GetControlData (textHandle, cast(short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection, null) !is OS.noErr) return;
+    //  setText (text, selection [0], selection [1], true);
 }
 
 void register () {
--- a/dwt/widgets/TabFolder.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/TabFolder.d	Thu Jan 15 23:08:54 2009 +0100
@@ -15,7 +15,7 @@
 
 import dwt.dwthelper.utils;
 
- 
+
 import dwt.DWT;
 import dwt.DWTException;
 import dwt.events.SelectionEvent;
@@ -140,12 +140,12 @@
 static int checkStyle (int style) {
     style = checkBits (style, DWT.TOP, DWT.BOTTOM, 0, 0, 0, 0);
     /*
-    * Even though it is legal to create this widget
-    * with scroll bars, they serve no useful purpose
-    * because they do not automatically scroll the
-    * widget's client area.  The fix is to clear
-    * the DWT style.
-    */
+     * Even though it is legal to create this widget
+     * with scroll bars, they serve no useful purpose
+     * because they do not automatically scroll the
+     * widget's client area.  The fix is to clear
+     * the DWT style.
+     */
     return style & ~(DWT.H_SCROLL | DWT.V_SCROLL);
 }
 
@@ -623,10 +623,10 @@
     for (int i = 0; i < itemCount; i++) {
         TabItem item = items [i];
         /*
-        * Feature in Cocoa.  For some reason the control on a tab being
-        * deselected has its parent removed natively.  The fix is to
-        * re-set the control's parent.
-        */
+         * Feature in Cocoa.  For some reason the control on a tab being
+         * deselected has its parent removed natively.  The fix is to
+         * re-set the control's parent.
+         */
         Control control = item.control;
         if (control !is null) {
             NSView topView = control.topView ();
--- a/dwt/widgets/TabItem.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/TabItem.d	Thu Jan 15 23:08:54 2009 +0100
@@ -55,7 +55,7 @@
     Control control;
     String toolTipText;
     NSTabViewItem nsItem;
-
+    
 /**
  * Constructs a new instance of this class given its parent
  * (which must be a <code>TabFolder</code>) and a style value
--- a/dwt/widgets/Table.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Table.d	Thu Jan 15 23:08:54 2009 +0100
@@ -119,6 +119,10 @@
  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
  */
 public class Table : Composite {
+
+    alias Composite.setBackground setBackground;
+    alias Composite.setFont setFont;
+
     TableItem [] items;
     TableColumn [] columns;
     TableColumn sortColumn;
@@ -128,7 +132,7 @@
     NSBrowserCell dataCell;
     int columnCount, itemCount, lastIndexOf, sortDirection;
     bool ignoreSelect;
-
+    
 /**
  * Constructs a new instance of this class given its parent
  * and a style value describing its behavior and appearance.
@@ -240,7 +244,7 @@
         currentItem = null;
         if (isDisposed () || item.isDisposed ()) return false;
         if (redraw) {
-//          if (!setScrollWidth (item)) item.redraw (OS.kDataBrowserNoItem);
+            //          if (!setScrollWidth (item)) item.redraw (OS.kDataBrowserNoItem);
         }
     }
     return true;
@@ -248,14 +252,14 @@
 
 static int checkStyle (int style) {
     /*
-    * Feature in Windows.  Even when WS_HSCROLL or
-    * WS_VSCROLL is not specified, Windows creates
-    * trees and tables with scroll bars.  The fix
-    * is to set H_SCROLL and V_SCROLL.
-    * 
-    * NOTE: This code appears on all platforms so that
-    * applications have consistent scroll bar behavior.
-    */
+     * Feature in Windows.  Even when WS_HSCROLL or
+     * WS_VSCROLL is not specified, Windows creates
+     * trees and tables with scroll bars.  The fix
+     * is to set H_SCROLL and V_SCROLL.
+     * 
+     * NOTE: This code appears on all platforms so that
+     * applications have consistent scroll bar behavior.
+     */
     if ((style & DWT.NO_SCROLL) is 0) {
         style |= DWT.H_SCROLL | DWT.V_SCROLL;
     }
@@ -455,10 +459,10 @@
     widget.setDelegate(widget);
     widget.setDoubleAction(OS.sel_sendDoubleSelection);
     if (!hasBorder()) widget.setFocusRingType(OS.NSFocusRingTypeNone);
-
+    
     headerView = cast(NSTableHeaderView)(new SWTTableHeaderView ()).alloc ().init ();
     widget.setHeaderView (null);
-
+    
     NSString str = NSString.stringWith("");
     if ((style & DWT.CHECK) !is 0) {
         checkColumn = cast(NSTableColumn)(new NSTableColumn()).alloc();
@@ -475,7 +479,7 @@
         checkColumn.setResizingMask(OS.NSTableColumnNoResizing);
         checkColumn.setEditable(false);
     }
-
+    
     firstColumn = cast(NSTableColumn)(new NSTableColumn()).alloc();
     firstColumn.initWithIdentifier(firstColumn);
     firstColumn.setMinWidth(0);
@@ -483,7 +487,7 @@
     dataCell = cast(NSBrowserCell)(new SWTBrowserCell ()).alloc ().init ();
     firstColumn.setDataCell (dataCell);
     widget.addTableColumn (firstColumn);
-
+    
     scrollView = scrollWidget;
     view = widget;
 }
@@ -765,9 +769,9 @@
             }
         }
     }
-
+    
     NSInteger oldIndex = (cast(NSTableView)view).columnWithIdentifier (column.nsColumn);
-
+    
     if (columnCount is 1) {
         //TODO - reset attributes
         firstColumn = column.nsColumn;
@@ -777,7 +781,7 @@
     }
     System.arraycopy (columns, index + 1, columns, index, --columnCount - index);
     columns [columnCount] = null;
-
+    
     NSArray array = (cast(NSTableView)view).tableColumns ();
     NSUInteger arraySize = array.count ();
     for (NSUInteger i = oldIndex; i < arraySize; i++) {
@@ -804,14 +808,14 @@
     if (itemCount is 0) {
         setTableEmpty ();
     } else {
-//      fixScrollBar ();
+        //      fixScrollBar ();
     }
 }
 
 void drawInteriorWithFrame_inView (objc.id id, objc.SEL sel, objc.id cellFrame, objc.id view) {
     NSRect rect = NSRect ();
     OS.memmove (&rect, cellFrame, NSRect.sizeof);
-
+    
     NSTableView tableView = cast(NSTableView)this.view;
     NSBrowserCell cell = new NSBrowserCell (id);
     NSRange rowsRange = tableView.rowsInRect (rect);
@@ -831,14 +835,14 @@
             }
         }
     }
-
+    
     Color background = item.cellBackground !is null ? item.cellBackground [columnIndex] : null;
     if (background is null) background = item.background;
     bool drawBackground = background !is null;
     bool drawForeground = true;
     bool isSelected = tableView.isRowSelected (rowIndex);
     bool drawSelection = isSelected;
-
+    
     NSColor nsSelectionBackground = null;
     NSColor nsSelectionForeground = null;
     if (isSelected) {
@@ -851,7 +855,7 @@
         nsSelectionBackground = cell.highlightColorInView (tableView);
         nsSelectionBackground = nsSelectionBackground.colorUsingColorSpace (NSColorSpace.deviceRGBColorSpace ());
     }
-
+    
     NSRect fullRect = NSRect ();
     fullRect.x = rect.x; fullRect.y = rect.y; fullRect.height = rect.height;
     if (columnCount is 0) {
@@ -865,7 +869,7 @@
         NSSize spacing = tableView.intercellSpacing ();
         fullRect.width = rect.width + spacing.width;
     }
-
+    
     if (hooks (DWT.EraseItem)) {
         NSRect eraseItemRect;
         // TODO how to handle rearranged columns?  The third clause below ensures that
@@ -896,7 +900,7 @@
             gc.setForeground (item.getForeground (columnIndex));
             gc.setBackground (item.getBackground (columnIndex));
         }
-
+        
         Event event = new Event ();
         event.item = item;
         event.gc = gc;
@@ -918,7 +922,7 @@
             drawForeground = (event.detail & DWT.FOREGROUND) !is 0;
             drawSelection = drawSelection && (event.detail & DWT.SELECTED) !is 0;           
         }
-
+        
         if (drawSelection) {
             NSRect selectionRect = NSRect ();
             selectionRect.y = rect.y; selectionRect.height = rect.height;
@@ -939,7 +943,7 @@
             callSuper (tableView.id, OS.sel_highlightSelectionInClipRect_, selectionRect);
         }   
     }
-
+    
     if (drawBackground && !drawSelection) {
         NSGraphicsContext context = NSGraphicsContext.currentContext ();
         context.saveGraphicsState ();
@@ -949,16 +953,16 @@
         NSBezierPath.fillRect (fullRect);
         context.restoreGraphicsState ();
     }
-
+    
     if (drawForeground) {
         cell.setHighlighted (false);
         callSuper (id, sel, rect, view);
     }
-
+    
     if (hooks (DWT.PaintItem)) {
         NSRect contentRect = cell.titleRectForBounds (rect);
         NSSize contentSize = cell.cellSizeForBounds (rect);
-
+        
         GCData data = new GCData ();
         // TODO how to handle rearranged columns?  The third clause below ensures that
         // there are either 0 columns or that column 0 is still the first physical column.
@@ -989,7 +993,7 @@
             gc.setForeground (item.getForeground (columnIndex));
             gc.setBackground (item.getBackground (columnIndex));
         }
-
+        
         Event event = new Event ();
         event.item = item;
         event.gc = gc;
@@ -1701,7 +1705,7 @@
     if (itemCount is 0) {
         setTableEmpty ();
     } else {
-//      fixScrollBar ();
+        //      fixScrollBar ();
     }
 }
 
@@ -2121,7 +2125,7 @@
     if (itemHeight is -1) {
         //TODO - reset item height, ensure other API's such as setFont don't do this
     } else {
-//      OS.SetDataBrowserTableViewRowHeight (handle, cast(short) itemHeight);
+        //      OS.SetDataBrowserTableViewRowHeight (handle, cast(short) itemHeight);
     }
 }
 
@@ -2165,7 +2169,7 @@
 bool setScrollWidth (TableItem items[], bool callMeasureItem) {
     if (columnCount !is 0) return false;
     if (currentItem !is null) {
-//      if (currentItem !is item) fixScrollWidth = true;
+        //      if (currentItem !is item) fixScrollWidth = true;
         return false;
     }
     if (/*ignoreRedraw ||*/ drawCount !is 0) return false;
@@ -2216,7 +2220,7 @@
 }
 
 void setSelection (int index, bool notify) {
-//  checkWidget ();
+    //  checkWidget ();
     if (0 <= index && index < itemCount) {
         select (index);
         showIndex (index);
@@ -2578,14 +2582,14 @@
     cocoa.id columnId = userInfo.valueForKey (NSString.stringWith ("NSTableColumn")); //$NON-NLS-1$
     TableColumn column = getColumn (columnId);
     if (column is null) return; /* either CHECK column or firstColumn in 0-column Table */
-
+    
     column.sendEvent (DWT.Resize);
     if (isDisposed ()) return;
-
+    
     NSTableView tableView = cast(NSTableView)view;
     int index = cast(int)/*64*/tableView.columnWithIdentifier (columnId);
     if (index is -1) return; /* column was disposed in Resize callback */
-
+    
     NSArray nsColumns = tableView.tableColumns ();
     int columnCount = cast(int)/*64*/tableView.numberOfColumns ();
     for (int i = index + 1; i < columnCount; i++) {
@@ -2671,14 +2675,14 @@
     cell.setFont (item.getFont (columnIndex).handle);
     cell.setImage (image !is null ? image.handle : null);
     cell.setLeaf (true);
-
+    
     if (hooks (DWT.MeasureItem)) {
         NSTableView tableView = cast(NSTableView)this.view;
         NSInteger nsColumnIndex = tableView.columnWithIdentifier (new cocoa.id (aTableColumn));
         NSRect rect = tableView.frameOfCellAtColumn (nsColumnIndex, cast(NSInteger) rowIndex);
         NSRect contentRect = cell.titleRectForBounds (rect);
         NSSize contentSize = cell.cellSizeForBounds (rect);
-
+        
         GCData data = new GCData ();
         data.paintRectStruct = tableView.frame ();
         data.paintRect = &data.paintRectStruct;
--- a/dwt/widgets/TableColumn.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/TableColumn.d	Thu Jan 15 23:08:54 2009 +0100
@@ -66,9 +66,9 @@
     Table parent;
     NSTableColumn nsColumn;
     String toolTipText, displayText;
-
+    
     static const int MARGIN = 2;
-
+    
 /**
  * Constructs a new instance of this class given its parent
  * (which must be a <code>Table</code>) and a style value
@@ -230,7 +230,7 @@
 void drawInteriorWithFrame_inView (objc.id id, objc.SEL sel, objc.id cellFrame, objc.id view) {
     NSRect cellRect = NSRect ();
     OS.memmove (&cellRect, cellFrame, NSRect.sizeof);
-
+    
     /*
      * Feature in Cocoa.  When the last column in a table does not reach the
      * rightmost edge of the table view, the cell that draws the rightmost-
@@ -242,10 +242,10 @@
     NSInteger columnIndex = tableView.columnWithIdentifier (nsColumn);
     NSRect headerRect = parent.headerView.headerRectOfColumn (columnIndex);
     if (headerRect.x !is cellRect.x || headerRect.width !is cellRect.width) return;
-
+    
     NSGraphicsContext context = NSGraphicsContext.currentContext ();
     context.saveGraphicsState ();
-
+    
     int contentWidth = 0;
     NSSize stringSize, imageSize;
     NSAttributedString attrString = null;
@@ -267,7 +267,7 @@
         imageSize = image.handle.size ();
         contentWidth += Math.ceil (imageSize.width);
     }
-
+    
     if (parent.sortColumn is this && parent.sortDirection !is DWT.NONE) {
         bool ascending = parent.sortDirection is DWT.UP;
         headerCell.drawSortIndicatorWithFrame (cellRect, new NSView(view), ascending, 0);
@@ -275,7 +275,7 @@
         NSRect sortRect = headerCell.sortIndicatorRectForBounds (cellRect);
         cellRect.width = Math.max (0, sortRect.x - cellRect.x);
     }
-
+    
     int drawX = 0;
     if ((style & DWT.CENTER) !is 0) {
         drawX = cast(int)(cellRect.x + Math.max (MARGIN, ((cellRect.width - contentWidth) / 2)));
@@ -284,7 +284,7 @@
     } else {
         drawX = cast(int)cellRect.x + MARGIN;
     }
-
+    
     if (image !is null) {
         NSRect destRect = NSRect ();
         destRect.x = drawX;
@@ -306,7 +306,7 @@
         if (isFlipped) context.restoreGraphicsState ();
         drawX += destRect.width;
     }
-
+    
     if (displayText !is null && displayText.length () > 0) {
         if (image !is null) drawX += MARGIN; /* space between image and text */
         NSRect destRect = NSRect ();
@@ -317,7 +317,7 @@
         attrString.drawInRect (destRect);
         attrString.release ();
     }
-
+    
     context.restoreGraphicsState ();
 }
 
@@ -382,9 +382,9 @@
  */
 public bool getMoveable () {
     checkWidget ();
-//  int [] flags = new int [1];
-//  OS.GetDataBrowserPropertyFlags (parent.handle, id, flags);
-//  return (flags [0] & OS.kDataBrowserListViewMovableColumn) !is 0;
+    //  int [] flags = new int [1];
+    //  OS.GetDataBrowserPropertyFlags (parent.handle, id, flags);
+    //  return (flags [0] & OS.kDataBrowserListViewMovableColumn) !is 0;
     return false;
 }
 
@@ -451,9 +451,9 @@
  */
 public void pack () {
     checkWidget ();
-
+    
     int width = 0;
-
+    
     /* compute header width */
     if (displayText !is null) {
         NSMutableDictionary dict = NSMutableDictionary.dictionaryWithCapacity (4);
@@ -479,7 +479,7 @@
         NSRect sortRect = headerCell.sortIndicatorRectForBounds (rect);
         width += Math.ceil (sortRect.width);
     }
-
+    
     /* compute item widths down column */
     GC gc = new GC (parent);
     int index = parent.indexOf (this);
@@ -637,14 +637,14 @@
     if (moveable) {
         (cast(NSTableView)parent.view).setAllowsColumnReordering (true);
     }
-//  int [] flags = new int [1];
-//  OS.GetDataBrowserPropertyFlags (parent.handle, id, flags);
-//  if (moveable) {
-//      flags [0] |= OS.kDataBrowserListViewMovableColumn;
-//  } else {
-//      flags [0] &= ~OS.kDataBrowserListViewMovableColumn;
-//  }
-//  OS.SetDataBrowserPropertyFlags (parent.handle, id, flags [0]);
+    //  int [] flags = new int [1];
+    //  OS.GetDataBrowserPropertyFlags (parent.handle, id, flags);
+    //  if (moveable) {
+    //      flags [0] |= OS.kDataBrowserListViewMovableColumn;
+    //  } else {
+    //      flags [0] &= ~OS.kDataBrowserListViewMovableColumn;
+    //  }
+    //  OS.SetDataBrowserPropertyFlags (parent.handle, id, flags [0]);
 }
 
 /**
--- a/dwt/widgets/TableItem.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/TableItem.d	Thu Jan 15 23:08:54 2009 +0100
@@ -151,7 +151,7 @@
 
 int calculateWidth (int columnIndex, GC gc, bool callMeasureItem) {
     if (!callMeasureItem && customWidth !is -1) return customWidth;
-
+    
     NSBrowserCell cell = parent.dataCell;
     cell.setFont (getFont (columnIndex).handle);
     cell.setTitle (NSString.stringWith (getText (columnIndex)));
@@ -161,7 +161,7 @@
     rect.width = rect.height = Float.MAX_VALUE;
     NSSize size = cell.cellSizeForBounds (rect);
     int width = cast(int)Math.ceil (size.width);
-
+    
     if (callMeasureItem && parent.hooks (DWT.MeasureItem)) {
         NSTableView tableView = cast(NSTableView)parent.view;
         NSInteger nsColumnIndex = 0;
@@ -241,7 +241,7 @@
             paragraphStyle.setAlignment (OS.NSRightTextAlignment);
         }
     }
-
+    
     String text = getText (index);
     size_t length_ = text.length ();
     char[] chars = new char [length_];
@@ -334,7 +334,7 @@
     checkWidget ();
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
     if (!(0 <= index && index < Math.max (1, parent.columnCount))) return new Rectangle (0, 0, 0, 0);
-
+    
     NSTableView tableView = cast(NSTableView) parent.view;
     if (parent.columnCount is 0) {
         index = (parent.style & DWT.CHECK) !is 0 ? 1 : 0;
@@ -512,7 +512,7 @@
     checkWidget ();
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
     if (!(0 <= index && index < Math.max (1, parent.columnCount))) return new Rectangle (0, 0, 0, 0);
-
+    
     NSTableView tableView = cast(NSTableView) parent.view;
     Image image = index is 0 ? this.image : (images !is null) ? images [index] : null;
     if (parent.columnCount is 0) {
@@ -616,7 +616,7 @@
     checkWidget ();
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
     if (!(0 <= index && index < Math.max (1, parent.columnCount))) return new Rectangle (0, 0, 0, 0);
-
+    
     NSTableView tableView = cast(NSTableView) parent.view;
     Image image = index is 0 ? this.image : (images !is null) ? images [index] : null;
     if (parent.columnCount is 0) {
@@ -636,7 +636,7 @@
 }
 
 void redraw () {
-//  0[aTableView setNeedsDisplayInRect:[aTableView rectOfRow:row]];
+    //  0[aTableView setNeedsDisplayInRect:[aTableView rectOfRow:row]];
     (cast(NSTableView) parent.view).reloadData ();
     (cast(NSTableView) parent.view).tile ();
 }
@@ -648,7 +648,7 @@
 
 void releaseParent () {
     super.releaseParent ();
-//  parent.checkItems (true);
+    //  parent.checkItems (true);
 }
 
 void releaseWidget () {
@@ -727,7 +727,7 @@
     cellBackground [index] = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true;
-
+    
     NSTableView tableView = cast(NSTableView) parent.view;
     NSRect rect;
     if (parent.hooks (DWT.MeasureItem) || parent.hooks (DWT.EraseItem) || parent.hooks (DWT.PaintItem)) {
@@ -833,7 +833,7 @@
     cellFont [index] = font;
     if (oldFont !is null && oldFont.equals (font)) return;
     cached = true;
-
+    
     NSTableView tableView = cast(NSTableView) parent.view;
     NSRect rect;
     if (parent.hooks (DWT.MeasureItem) || parent.hooks (DWT.EraseItem) || parent.hooks (DWT.PaintItem)) {
@@ -916,7 +916,7 @@
     cellForeground [index] = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true;
-
+    
     NSTableView tableView = cast(NSTableView) parent.view;
     NSRect rect;
     if (parent.hooks (DWT.MeasureItem) || parent.hooks (DWT.EraseItem) || parent.hooks (DWT.PaintItem)) {
@@ -998,9 +998,9 @@
     }
     int itemIndex = parent.indexOf (this);
     if (itemIndex is -1) return;
-//  if (parent.imageBounds is null && image !is null) {
-//      parent.setItemHeight (image);
-//  }
+    //  if (parent.imageBounds is null && image !is null) {
+    //      parent.setItemHeight (image);
+    //  }
     if (index is 0)  {
         if (image !is null && image.type is DWT.ICON) {
             if (image.equals (this.image)) return;
@@ -1016,8 +1016,8 @@
         }
         images [index] = image; 
     }
-//  cached = true;
-//  if (index is 0) parent.setScrollWidth (this);
+    //  cached = true;
+    //  if (index is 0) parent.setScrollWidth (this);
     
     NSTableView tableView = cast(NSTableView) parent.view;
     NSRect rect;
@@ -1112,7 +1112,7 @@
     }
     cached = true;
     if (index is 0) parent.setScrollWidth (this, true);
-
+    
     NSTableView tableView = cast(NSTableView) parent.view;
     NSRect rect;
     if (parent.hooks (DWT.MeasureItem) || parent.hooks (DWT.EraseItem) || parent.hooks (DWT.PaintItem)) {
--- a/dwt/widgets/Text.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Text.d	Thu Jan 15 23:08:54 2009 +0100
@@ -87,6 +87,11 @@
  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
  */
 public class Text : Scrollable {
+
+    alias Scrollable.setBackground setBackground;
+    alias Scrollable.setFont setFont;
+    alias Scrollable.setForeground setForeground;
+
     int textLimit, tabs = 8;
     char echoCharacter;
     bool doubleClick, receivingFocus;
@@ -94,33 +99,33 @@
     NSRange* selectionRange;
     NSRange selectionRangeStruct;
     
-    /**
-    * The maximum number of characters that can be entered
-    * into a text widget.
-    * <p>
-    * Note that this value is platform dependent, based upon
-    * the native widget implementation.
-    * </p>
-    */
-    public static const int LIMIT;
-    
-    /**
-    * The delimiter used by multi-line text widgets.  When text
-    * is queried and from the widget, it will be delimited using
-    * this delimiter.
-    */
-    public static const String DELIMITER;
-    static const wchar PASSWORD = '\u2022';
+/**
+ * The maximum number of characters that can be entered
+ * into a text widget.
+ * <p>
+ * Note that this value is platform dependent, based upon
+ * the native widget implementation.
+ * </p>
+ */
+public static const int LIMIT;
 
-    /*
-    * These values can be different on different platforms.
-    * Therefore they are not initialized in the declaration
-    * to stop the compiler from inlining.
-    */
-    static this () {
-        LIMIT = 0x7FFFFFFF;
-        DELIMITER = "\r";
-    }
+/**
+ * The delimiter used by multi-line text widgets.  When text
+ * is queried and from the widget, it will be delimited using
+ * this delimiter.
+ */
+public static const String DELIMITER;
+static const wchar PASSWORD = '\u2022';
+
+/*
+ * These values can be different on different platforms.
+ * Therefore they are not initialized in the declaration
+ * to stop the compiler from inlining.
+ */
+static this () {
+    LIMIT = 0x7FFFFFFF;
+    DELIMITER = "\r";
+}
 
 /**
  * Constructs a new instance of this class given its parent
@@ -158,15 +163,15 @@
     
     super (parent, checkStyle (style));
     if ((style & DWT.SEARCH) !is 0) {
-//      int inAttributesToSet = (style & DWT.CANCEL) !is 0 ? OS.kHISearchFieldAttributesCancel : 0;
-//      OS.HISearchFieldChangeAttributes (handle, inAttributesToSet, 0);
+        //      int inAttributesToSet = (style & DWT.CANCEL) !is 0 ? OS.kHISearchFieldAttributesCancel : 0;
+        //      OS.HISearchFieldChangeAttributes (handle, inAttributesToSet, 0);
         /*
-        * Ensure that DWT.CANCEL is set.
-        * NOTE: CANCEL has the same value as H_SCROLL so it is
-        * necessary to first clear these bits to avoid a scroll
-        * bar and then reset the bit using the original style
-        * supplied by the programmer.
-        */
+         * Ensure that DWT.CANCEL is set.
+         * NOTE: CANCEL has the same value as H_SCROLL so it is
+         * necessary to first clear these bits to avoid a scroll
+         * bar and then reset the bit using the original style
+         * supplied by the programmer.
+         */
         if ((style & DWT.CANCEL) !is 0) this.style |= DWT.CANCEL;
     }
 }
@@ -428,8 +433,8 @@
         if ((style & DWT.CENTER) !is 0) align_ = OS.NSCenterTextAlignment;
         if ((style & DWT.RIGHT) !is 0) align_ = OS.NSRightTextAlignment;
         widget.setAlignment (align_);
-//      widget.setTarget(widget);
-//      widget.setAction(OS.sel_sendSelection);
+        //      widget.setTarget(widget);
+        //      widget.setAction(OS.sel_sendSelection);
         view = widget;
     } else {
         NSScrollView scrollWidget = cast(NSScrollView) (new SWTScrollView ()).alloc ();
@@ -447,7 +452,7 @@
         size.width = size.height = Float.MAX_VALUE;
         widget.setMaxSize (size);
         widget.setAutoresizingMask (OS.NSViewWidthSizable | OS.NSViewHeightSizable);
-
+        
         if ((style & DWT.WRAP) is 0) {
             NSTextContainer textContainer = widget.textContainer ();
             widget.setHorizontallyResizable (true);
@@ -456,14 +461,14 @@
             csize.width = csize.height = Float.MAX_VALUE;
             textContainer.setContainerSize (csize);
         }
-
+        
         NSTextAlignment align_ = OS.NSLeftTextAlignment;
         if ((style & DWT.CENTER) !is 0) align_ = OS.NSCenterTextAlignment;
         if ((style & DWT.RIGHT) !is 0) align_ = OS.NSRightTextAlignment;
         widget.setAlignment (align_);
-
-//      widget.setTarget(widget);
-//      widget.setAction(OS.sel_sendSelection);
+        
+        //      widget.setTarget(widget);
+        //      widget.setAction(OS.sel_sendSelection);
         widget.setRichText (false);
         widget.setDelegate(widget);
         
@@ -598,8 +603,8 @@
         //TODO - caret location for unicode text
         return new Point (0, 0);
     }
-//  NSText
-//  NSRange range = (cast(NSTextView)view).selectedRange();
+    //  NSText
+    //  NSRange range = (cast(NSTextView)view).selectedRange();
     return null;
 }
 
@@ -710,7 +715,7 @@
     } else {
         str = (cast(NSTextView)view).textStorage().string();
     }
-
+    
     NSUInteger length_ = str.length ();
     char [] buffer = new char [length_];
     if (hiddenText !is null) {
@@ -730,7 +735,7 @@
     } else {
         str = (cast(NSTextView)view).textStorage().string();
     }
-
+    
     int length = cast(int)/*64*/str.length ();
     end = Math.min (end, length - 1);
     if (start > end) return new char [0];
@@ -839,7 +844,7 @@
 }
 
 int getPosition (int x, int y) {
-//  checkWidget ();
+    //  checkWidget ();
     //TODO 
     return 0;
 }
@@ -1436,17 +1441,17 @@
 public void setEchoChar (char echo) {
     checkWidget ();
     if ((style & DWT.MULTI) !is 0) return;
-//  if (txnObject is 0) {
-//      if ((style & DWT.PASSWORD) is 0) {
-//          Point selection = getSelection ();
-//          String text = getText ();
-//          echoCharacter = echo;
-//          setEditText (text);
-//          setSelection (selection);
-//      }
-//  } else {
-//      OS.TXNEchoMode (txnObject, echo, OS.kTextEncodingMacUnicode, echo !is '\0');
-//  }
+    //  if (txnObject is 0) {
+    //      if ((style & DWT.PASSWORD) is 0) {
+    //          Point selection = getSelection ();
+    //          String text = getText ();
+    //          echoCharacter = echo;
+    //          setEditText (text);
+    //          setSelection (selection);
+    //      }
+    //  } else {
+    //      OS.TXNEchoMode (txnObject, echo, OS.kTextEncodingMacUnicode, echo !is '\0');
+    //  }
     echoCharacter = echo;
 }
 
@@ -1559,14 +1564,14 @@
     checkWidget ();
     //if (message is null) error (DWT.ERROR_NULL_ARGUMENT);
     this.message = message;
-//  if ((style & DWT.SEARCH) !is 0) {
-//      char [] buffer = new char [message.length ()];
-//      message.getChars (0, buffer.length, buffer, 0);
-//      int ptr = OS.CFStringCreateWithCharacters (OS.kCFAllocatorDefault, buffer, buffer.length);
-//      if (ptr is 0) error (DWT.ERROR_CANNOT_SET_TEXT);
-//      OS.HISearchFieldSetDescriptiveText (handle, ptr);
-//      OS.CFRelease (ptr);
-//  }
+    //  if ((style & DWT.SEARCH) !is 0) {
+    //      char [] buffer = new char [message.length ()];
+    //      message.getChars (0, buffer.length, buffer, 0);
+    //      int ptr = OS.CFStringCreateWithCharacters (OS.kCFAllocatorDefault, buffer, buffer.length);
+    //      if (ptr is 0) error (DWT.ERROR_CANNOT_SET_TEXT);
+    //      OS.HISearchFieldSetDescriptiveText (handle, ptr);
+    //      OS.CFRelease (ptr);
+    //  }
 }
 
 /**
@@ -1702,14 +1707,14 @@
 public void setTabs (int tabs) {
     checkWidget ();
     if (this.tabs is tabs) return;
-//  if (txnObject is 0) return;
-//  this.tabs = tabs;
-//  TXNTab tab = new TXNTab ();
-//  tab.value = cast(short) (textExtent (new char[]{' '}, 0).x * tabs);
-//  int [] tags = new int [] {OS.kTXNTabSettingsTag};
-//  int [] datas = new int [1];
-//  OS.memmove (datas, tab, TXNTab.sizeof);
-//  OS.TXNSetTXNObjectControls (txnObject, false, tags.length, tags, datas);
+    //  if (txnObject is 0) return;
+    //  this.tabs = tabs;
+    //  TXNTab tab = new TXNTab ();
+    //  tab.value = cast(short) (textExtent (new char[]{' '}, 0).x * tabs);
+    //  int [] tags = new int [] {OS.kTXNTabSettingsTag};
+    //  int [] datas = new int [1];
+    //  OS.memmove (datas, tab, TXNTab.sizeof);
+    //  OS.TXNSetTXNObjectControls (txnObject, false, tags.length, tags, datas);
 }
 
 /**
@@ -1789,10 +1794,10 @@
     checkWidget ();
     if ((style & DWT.SINGLE) !is 0) return;
     //TODO no working
-//  NSTextView widget = cast(NSTextView) view;
-//  NSRange range = NSRange ();
-//  NSRect rect = widget.firstRectForCharacterRange (range);
-//  view.scrollRectToVisible (rect);
+    //  NSTextView widget = cast(NSTextView) view;
+    //  NSRange range = NSRange ();
+    //  NSRect rect = widget.firstRectForCharacterRange (range);
+    //  view.scrollRectToVisible (rect);
 }
 
 /**
@@ -1831,12 +1836,12 @@
 
 NSRange textView_willChangeSelectionFromCharacterRange_toCharacterRange (objc.id id, objc.SEL sel, objc.id aTextView, objc.id oldSelectedCharRange, objc.id newSelectedCharRange) {
     /*
-    * If the selection is changing as a result of the receiver getting focus
-    * then return the receiver's last selection range, otherwise the full
-    * text will be automatically selected.
-    */
+     * If the selection is changing as a result of the receiver getting focus
+     * then return the receiver's last selection range, otherwise the full
+     * text will be automatically selected.
+     */
     if (receivingFocus && selectionRange !is null) return selectionRangeStruct;
-
+    
     /* allow the selection change to proceed */
     NSRange result = NSRange ();
     OS.memmove(&result, newSelectedCharRange, NSRange.sizeof);
--- a/dwt/widgets/ToolBar.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/ToolBar.d	Thu Jan 15 23:08:54 2009 +0100
@@ -15,7 +15,7 @@
 
 import dwt.dwthelper.utils;
 
- 
+
 import dwt.DWT;
 import dwt.DWTException;
 import dwt.accessibility.ACC;
@@ -114,13 +114,13 @@
     super (parent, checkStyle (style));
     
     /*
-    * Ensure that either of HORIZONTAL or VERTICAL is set.
-    * NOTE: HORIZONTAL and VERTICAL have the same values
-    * as H_SCROLL and V_SCROLL so it is necessary to first
-    * clear these bits to avoid scroll bars and then reset
-    * the bits using the original style supplied by the
-    * programmer.
-    */
+     * Ensure that either of HORIZONTAL or VERTICAL is set.
+     * NOTE: HORIZONTAL and VERTICAL have the same values
+     * as H_SCROLL and V_SCROLL so it is necessary to first
+     * clear these bits to avoid scroll bars and then reset
+     * the bits using the original style supplied by the
+     * programmer.
+     */
     if ((style & DWT.VERTICAL) !is 0) {
         this.style |= DWT.VERTICAL;
     } else {
@@ -143,7 +143,7 @@
         ourAttributes.addObject(OS.NSAccessibilityEnabledAttribute);
         ourAttributes.addObject(OS.NSAccessibilityFocusedAttribute);
         ourAttributes.addObject(OS.NSAccessibilityChildrenAttribute);
-
+        
         if (accessible !is null) {
             // See if the accessible will override or augment the standard list.
             // Help, title, and description can be overridden.
@@ -151,7 +151,7 @@
             extraAttributes.addObject(OS.NSAccessibilityHelpAttribute);
             extraAttributes.addObject(OS.NSAccessibilityDescriptionAttribute);
             extraAttributes.addObject(OS.NSAccessibilityTitleAttribute);
-
+            
             for (int i = extraAttributes.count() - 1; i >= 0; i--) {
                 NSString attribute = new NSString(extraAttributes.objectAtIndex(i).id);
                 if (accessible.internal_accessibilityAttributeValue(attribute, ACC.CHILDID_SELF) !is null) {
@@ -177,7 +177,7 @@
     
     if (nsAttributeName.isEqualToString (OS.NSAccessibilityRoleAttribute) || nsAttributeName.isEqualToString (OS.NSAccessibilityRoleDescriptionAttribute)) {
         NSString role = OS.NSAccessibilityToolbarRole;
-
+        
         if (nsAttributeName.isEqualToString (OS.NSAccessibilityRoleAttribute))
             return role.id;
         else {
@@ -201,12 +201,12 @@
 
 static int checkStyle (int style) {
     /*
-    * Even though it is legal to create this widget
-    * with scroll bars, they serve no useful purpose
-    * because they do not automatically scroll the
-    * widget's client area.  The fix is to clear
-    * the DWT style.
-    */
+     * Even though it is legal to create this widget
+     * with scroll bars, they serve no useful purpose
+     * because they do not automatically scroll the
+     * widget's client area.  The fix is to clear
+     * the DWT style.
+     */
     return style & ~(DWT.H_SCROLL | DWT.V_SCROLL);
 }
 
@@ -229,7 +229,7 @@
 void createHandle () {
     NSView widget = cast(NSView)(new SWTView()).alloc();
     widget.initWithFrame(NSRect());
-//  widget.setDrawsBackground(false);
+    //  widget.setDrawsBackground(false);
     view = widget;
 }
 
--- a/dwt/widgets/ToolItem.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/ToolItem.d	Thu Jan 15 23:08:54 2009 +0100
@@ -80,13 +80,13 @@
     String toolTipText;
     Control control;
     bool selection;
-
+    
     static const int DEFAULT_WIDTH = 24;
     static const int DEFAULT_HEIGHT = 22;
     static const int DEFAULT_SEPARATOR_WIDTH = 6;
     static const int INSET = 3;
     static const int ARROW_WIDTH = 5;
-
+    
 /**
  * Constructs a new instance of this class given its parent
  * (which must be a <code>ToolBar</code>) and a style value
@@ -171,13 +171,13 @@
 
 objc.id accessibilityAttributeValue(objc.id id, objc.SEL sel, objc.id arg0) {
     NSString nsAttributeName = new NSString(arg0);
-
+    
     if (nsAttributeName.isEqualToString (OS.NSAccessibilityRoleAttribute) || nsAttributeName.isEqualToString (OS.NSAccessibilityRoleDescriptionAttribute)) {
         NSString roleText = ((style & DWT.PUSH) !is 0) ? OS.NSAccessibilityButtonRole
-                : ((style & DWT.RADIO) !is 0) ? OS.NSAccessibilityRadioButtonRole
-                : ((style & DWT.CHECK) !is 0) ? OS.NSAccessibilityCheckBoxRole
-                : ((style & DWT.DROP_DOWN) !is 0) ? OS.NSAccessibilityMenuButtonRole
-                : null; // SEPARATOR
+        : ((style & DWT.RADIO) !is 0) ? OS.NSAccessibilityRadioButtonRole
+        : ((style & DWT.CHECK) !is 0) ? OS.NSAccessibilityCheckBoxRole
+        : ((style & DWT.DROP_DOWN) !is 0) ? OS.NSAccessibilityMenuButtonRole
+        : null; // SEPARATOR
         if (roleText !is null) {
             if (nsAttributeName.isEqualToString (OS.NSAccessibilityRoleAttribute)) {
                 return roleText.id;
@@ -203,7 +203,7 @@
         NSNumber value = NSNumber.numberWithInt(getEnabled() ? 1 : 0);
         return value.id;
     }
-
+    
     return super.accessibilityAttributeValue(id, sel, arg0);
 }
 
@@ -324,7 +324,7 @@
     char [] chars = new char [text.length ()];
     text.getChars (0, chars.length, chars, 0);
     int length = fixMnemonic (chars);
-
+    
     NSMutableParagraphStyle pStyle = cast(NSMutableParagraphStyle)(new NSMutableParagraphStyle()).alloc().init();
     pStyle.autorelease();
     pStyle.setAlignment(OS.NSCenterTextAlignment);
--- a/dwt/widgets/ToolTip.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/ToolTip.d	Thu Jan 15 23:08:54 2009 +0100
@@ -83,578 +83,578 @@
     static final int IMAGE_SIZE = 16;
     static final int DELAY = 10000;
     
-    /**
-     * Constructs a new instance of this class given its parent
-     * and a style value describing its behavior and appearance.
-     * <p>
-     * The style value is either one of the style constants defined in
-     * class <code>DWT</code> which is applicable to instances of this
-     * class, or must be built by <em>bitwise OR</em>'ing together 
-     * (that is, using the <code>int</code> "|" operator) two or more
-     * of those <code>DWT</code> style constants. The class description
-     * lists the style constants that are applicable to the class.
-     * Style bits are also inherited from superclasses.
-     * </p>
-     *
-     * @param parent a composite control which will be the parent of the new instance (cannot be null)
-     * @param style the style of control to construct
-     *
-     * @exception IllegalArgumentException <ul>
-     *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
-     * </ul>
-     * @exception DWTException <ul>
-     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
-     *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
-     * </ul>
-     *
-     * @see DWT#ICON_ERROR
-     * @see DWT#ICON_INFORMATION
-     * @see DWT#ICON_WARNING
-     * @see Widget#checkSubclass
-     * @see Widget#getStyle
-     */
-    public this (Shell parent, int style) {
-        super (parent, checkStyle (style));
-        this.parent = parent;
-        this.autohide = true;
-        x = y = -1; 
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>DWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together 
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>DWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception DWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see DWT#ICON_ERROR
+ * @see DWT#ICON_INFORMATION
+ * @see DWT#ICON_WARNING
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Shell parent, int style) {
+    super (parent, checkStyle (style));
+    this.parent = parent;
+    this.autohide = true;
+    x = y = -1; 
+    Display display = getDisplay ();
+    tip = new Shell (parent, DWT.ON_TOP | DWT.NO_TRIM);
+    Color background = display.getSystemColor (DWT.COLOR_INFO_BACKGROUND);
+    tip.setBackground (background);
+    listener = new class Listener {
+        public void handleEvent (Event event) {
+            switch (event.type) {
+                case DWT.Dispose: onDispose (event); break;
+                case DWT.Paint: onPaint (event); break;
+                case DWT.MouseDown: onMouseDown (event); break;
+                default:
+                    assert(false);
+            }
+        }
+        };
+    addListener (DWT.Dispose, listener);
+    tip.addListener (DWT.Paint, listener);
+    tip.addListener (DWT.MouseDown, listener);
+}
+
+static int checkStyle (int style) {
+    int mask = DWT.ICON_ERROR | DWT.ICON_INFORMATION | DWT.ICON_WARNING;
+    if ((style & mask) is 0) return style;
+    return checkBits (style, DWT.ICON_INFORMATION, DWT.ICON_WARNING, DWT.ICON_ERROR, 0, 0, 0);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the receiver is selected.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the receiver is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception DWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (DWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (DWT.Selection,typedListener);
+    addListener (DWT.DefaultSelection,typedListener);
+}
+
+void configure () {
+    Display display = parent.getDisplay ();
+    int x = this.x;
+    int y = this.y;
+    if (x is -1 || y is -1) {
+    Point point;
+    if (item !is null) {
+        point = item.getLocation ();
+    } else {
+        point = display.getCursorLocation ();
+    }
+        x = point.x;
+        y = point.y;
+    }
+    dwt.widgets.Monitor.Monitor monitor = parent.getMonitor ();
+    Rectangle dest = monitor.getBounds ();
+    Point size = getSize (dest.width / 4);
+    int w = size.x;
+    int h = size.y;
+    int t = (style & DWT.BALLOON) !is 0 ? TIP_HEIGHT : 0;
+    int i = (style & DWT.BALLOON) !is 0 ? 16 : 0;
+    tip.setSize (w, h + t);
+    int [] polyline;
+    spikeAbove = dest.height >= y + size.y + t;
+    if (dest.width >= x + size.x) {
+        if (dest.height >= y + size.y + t) {
+            polyline = [
+                        0, 5+t, 1, 5+t, 1, 3+t, 3, 1+t, 5, 1+t, 5, t, 
+                        16, t, 16, 0, 35, t,
+                        w-5, t, w-5, 1+t, w-3, 1+t, w-1, 3+t, w-1, 5+t, w, 5+t,
+                        w, h-5+t, w-1, h-5+t, w-1, h-3+t, w-2, h-3+t, w-2, h-2+t, w-3, h-2+t, w-3, h-1+t, w-5, h-1+t, w-5, h+t,
+                        5, h+t, 5, h-1+t, 3, h-1+t, 3, h-2+t, 2, h-2+t, 2, h-3+t, 1, h-3+t, 1, h-5+t, 0, h-5+t, 
+                        0, 5+t];
+            borderPolygon = [
+                             0, 5+t, 1, 4+t, 1, 3+t, 3, 1+t,  4, 1+t, 5, t, 
+                             16, t, 16, 1, 35, t,
+                             w-6, 0+t, w-5, 1+t, w-4, 1+t, w-2, 3+t, w-2, 4+t, w-1, 5+t,
+                             w-1, h-6+t, w-2, h-5+t, w-2, h-4+t, w-4, h-2+t, w-5, h-2+t, w-6, h-1+t,
+                             5, h-1+t, 4, h-2+t, 3, h-2+t, 1, h-4+t, 1, h-5+t, 0, h-6+t, 
+                             0, 5+t];
+            tip.setLocation (Math.max (0, x - i), y);
+        } else {
+            polyline = [
+                        0, 5, 1, 5, 1, 3, 3, 1, 5, 1, 5, 0, 
+                        w-5, 0, w-5, 1, w-3, 1, w-1, 3, w-1, 5, w, 5,
+                        w, h-5, w-1, h-5, w-1, h-3, w-2, h-3, w-2, h-2, w-3, h-2, w-3, h-1, w-5, h-1, w-5, h,
+                        35, h, 16, h+t, 16, h,
+                        5, h, 5, h-1, 3, h-1, 3, h-2, 2, h-2, 2, h-3, 1, h-3, 1, h-5, 0, h-5, 
+                        0, 5];
+            borderPolygon = [
+                             0, 5, 1, 4, 1, 3, 3, 1,  4, 1, 5, 0, 
+                             w-6, 0, w-5, 1, w-4, 1, w-2, 3, w-2, 4, w-1, 5,
+                             w-1, h-6, w-2, h-5, w-2, h-4, w-4, h-2, w-5, h-2, w-6, h-1,
+                             36, h-1, 16, h+t-1, 16, h-1,
+                             5, h-1, 4, h-2, 3, h-2, 1, h-4, 1, h-5, 0, h-6, 
+                             0, 5];
+            tip.setLocation (Math.max (0, x - i), y - size.y - t);
+        }
+    } else {
+        if (dest.height >= y + size.y + t) {
+            polyline = [
+                        0, 5+t, 1, 5+t, 1, 3+t, 3, 1+t, 5, 1+t, 5, t, 
+                        w-35, t, w-16, 0, w-16, t,
+                        w-5, t, w-5, 1+t, w-3, 1+t, w-1, 3+t, w-1, 5+t, w, 5+t,
+                        w, h-5+t, w-1, h-5+t, w-1, h-3+t, w-2, h-3+t, w-2, h-2+t, w-3, h-2+t, w-3, h-1+t, w-5, h-1+t, w-5, h+t,
+                        5, h+t, 5, h-1+t, 3, h-1+t, 3, h-2+t, 2, h-2+t, 2, h-3+t, 1, h-3+t, 1, h-5+t, 0, h-5+t, 
+                        0, 5+t];
+            borderPolygon = [
+                             0, 5+t, 1, 4+t, 1, 3+t, 3, 1+t,  4, 1+t, 5, t, 
+                             w-35, t, w-17, 2, w-17, t,
+                             w-6, t, w-5, 1+t, w-4, 1+t, w-2, 3+t, w-2, 4+t, w-1, 5+t,
+                             w-1, h-6+t, w-2, h-5+t, w-2, h-4+t, w-4, h-2+t, w-5, h-2+t, w-6, h-1+t,
+                             5, h-1+t, 4, h-2+t, 3, h-2+t, 1, h-4+t, 1, h-5+t, 0, h-6+t, 
+                             0, 5+t];
+            tip.setLocation (Math.min (dest.width - size.x, x - size.x + i), y);
+        } else {
+            polyline = [
+                        0, 5, 1, 5, 1, 3, 3, 1, 5, 1, 5, 0, 
+                        w-5, 0, w-5, 1, w-3, 1, w-1, 3, w-1, 5, w, 5,
+                        w, h-5, w-1, h-5, w-1, h-3, w-2, h-3, w-2, h-2, w-3, h-2, w-3, h-1, w-5, h-1, w-5, h,
+                        w-16, h, w-16, h+t, w-35, h,
+                        5, h, 5, h-1, 3, h-1, 3, h-2, 2, h-2, 2, h-3, 1, h-3, 1, h-5, 0, h-5, 
+                        0, 5];
+            borderPolygon = [
+                             0, 5, 1, 4, 1, 3, 3, 1,  4, 1, 5, 0, 
+                             w-6, 0, w-5, 1, w-4, 1, w-2, 3, w-2, 4, w-1, 5,
+                             w-1, h-6, w-2, h-5, w-2, h-4, w-4, h-2, w-5, h-2, w-6, h-1,
+                             w-17, h-1, w-17, h+t-2, w-36, h-1,
+                             5, h-1, 4, h-2, 3, h-2, 1, h-4, 1, h-5, 0, h-6, 
+                             0, 5];
+            tip.setLocation (Math.min (dest.width - size.x, x - size.x + i), y - size.y - t);
+        }
+    }   
+    if ((style & DWT.BALLOON) !is 0) {
+        if (region !is null) region.dispose ();
+        region = new Region (display);
+        region.add (polyline);
+        tip.setRegion (region);
+    }
+}
+
+/**
+ * Returns <code>true</code> if the receiver is automatically
+ * hidden by the platform, and <code>false</code> otherwise.
+ *
+ * @return the receiver's auto hide state
+ *
+ * @exception DWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ */
+public bool getAutoHide () {
+    checkWidget ();
+    return autohide;
+}
+
+Point getSize (int maxWidth) {
+    int textWidth = 0, messageWidth = 0;
+    if (layoutText !is null) {
+        layoutText.setWidth (-1);
+        textWidth = layoutText.getBounds ().width;
+    }
+    if (layoutMessage !is null) {
+        layoutMessage.setWidth (-1);
+        messageWidth = layoutMessage.getBounds ().width;
+    }
+    int messageTrim = 2 * INSET + 2 * BORDER + 2 * PADDING;
+bool hasImage =     layoutText !is null && (style & DWT.BALLOON) !is 0 && (style & (DWT.ICON_ERROR | DWT.ICON_INFORMATION | DWT.ICON_WARNING)) !is 0;
+    int textTrim = messageTrim + (hasImage ? IMAGE_SIZE : 0);
+    int width = Math.min (maxWidth, Math.max (textWidth + textTrim, messageWidth + messageTrim));
+    int textHeight = 0, messageHeight = 0;
+    if (layoutText !is null) {
+        layoutText.setWidth (maxWidth - textTrim);  
+        textHeight = layoutText.getBounds ().height;
+    }
+    if (layoutMessage !is null) {
+        layoutMessage.setWidth (maxWidth - messageTrim);
+        messageHeight = layoutMessage.getBounds ().height;
+    }
+    int height = 2 * BORDER + 2 * PADDING + messageHeight;
+    if (layoutText !is null) height += Math.max (IMAGE_SIZE, textHeight) + 2 * PADDING;
+    return new Point (width, height);
+}
+
+/**
+ * Returns the receiver's message, which will be an empty
+ * string if it has never been set.
+ *
+ * @return the receiver's message
+ *
+ * @exception DWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getMessage () {
+    checkWidget ();
+    return layoutMessage !is null ? layoutMessage.getText() : "";
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Shell</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception DWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Shell getParent () {
+    checkWidget ();
+    return parent;
+}
+
+/**
+ * Returns the receiver's text, which will be an empty
+ * string if it has never been set.
+ *
+ * @return the receiver's text
+ *
+ * @exception DWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+    checkWidget ();
+    return layoutText !is null ? layoutText.getText() : "";
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible, and
+ * <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception DWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getVisible () {
+    checkWidget ();
+    return tip.getVisible ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible and all
+ * of the receiver's ancestors are visible and <code>false</code>
+ * otherwise.
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception DWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getVisible
+ */
+public bool isVisible () {
+    checkWidget ();
+    return getVisible ();
+}
+
+void onDispose (Event event) {
+    removeListener (DWT.Dispose, listener);
+    notifyListeners (DWT.Dispose, event);
+    event.type = DWT.None;
+    
+    if (runnable !is null) {
         Display display = getDisplay ();
-        tip = new Shell (parent, DWT.ON_TOP | DWT.NO_TRIM);
-        Color background = display.getSystemColor (DWT.COLOR_INFO_BACKGROUND);
-        tip.setBackground (background);
-        listener = new class Listener {
-            public void handleEvent (Event event) {
-                switch (event.type) {
-                    case DWT.Dispose: onDispose (event); break;
-                    case DWT.Paint: onPaint (event); break;
-                    case DWT.MouseDown: onMouseDown (event); break;
-                    default:
-                        assert(false);
-                }
+        display.timerExec (-1, runnable);
+    }
+    runnable = null;
+    tip.dispose ();
+    tip = null;
+    if (region !is null) region.dispose ();
+    region = null;
+    if (layoutText !is null) layoutText.dispose ();
+    layoutText = null;
+    if (layoutMessage !is null) layoutMessage.dispose ();
+    layoutMessage = null;
+    if (boldFont !is null) boldFont.dispose ();
+    boldFont = null;
+    borderPolygon = null;
+}
+
+void onMouseDown (Event event) {
+    notifyListeners (DWT.Selection, new Event ());
+    setVisible (false);
+}
+
+void onPaint (Event event) {
+    GC gc = event.gc;
+    int x = BORDER + PADDING;
+    int y = BORDER + PADDING;
+    if ((style & DWT.BALLOON) !is 0) {
+        if (spikeAbove) y += TIP_HEIGHT;
+        gc.drawPolygon (borderPolygon);
+    } else {
+        Rectangle rect = tip.getClientArea ();
+        gc.drawRectangle(rect.x, rect.y, rect.width - 1, rect.height -1);
+    } 
+    if (layoutText !is null) {
+        int id = style & (DWT.ICON_ERROR | DWT.ICON_INFORMATION | DWT.ICON_WARNING);
+        if ((style & DWT.BALLOON) !is 0 && id !is 0) {
+            Display display = getDisplay ();
+            Image image = display.getSystemImage (id);
+            Rectangle rect = image.getBounds ();
+            gc.drawImage (image, 0, 0, rect.width, rect.height, x, y, IMAGE_SIZE, IMAGE_SIZE);
+            x += IMAGE_SIZE;
+        }
+        x += INSET;
+        layoutText.draw (gc, x, y);
+        y += 2 * PADDING + Math.max (IMAGE_SIZE, layoutText.getBounds ().height);
+    }
+    if (layoutMessage !is null) {
+        x = BORDER + PADDING + INSET;
+        layoutMessage.draw (gc, x, y);
+    }
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the receiver is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception DWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (DWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (DWT.Selection, listener);
+    eventTable.unhook (DWT.DefaultSelection,listener);  
+}
+
+/**
+ * Makes the receiver hide automatically when <code>true</code>,
+ * and remain visible when <code>false</code>.
+ *
+ * @param autoHide the auto hide state
+ *
+ * @exception DWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @see #getVisible
+ * @see #setVisible
+ */
+public void setAutoHide (bool autohide) {
+    checkWidget ();
+    this.autohide = autohide;
+    //TODO - update when visible
+}
+
+/**
+ * Sets the location of the receiver, which must be a tooltip,
+ * to the point specified by the arguments which are relative
+ * to the display.
+ * <p>
+ * Note that this is different from most widgets where the
+ * location of the widget is relative to the parent.
+ * </p>
+ *
+ * @param x the new x coordinate for the receiver
+ * @param y the new y coordinate for the receiver
+ *
+ * @exception DWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLocation (int x, int y) {
+    checkWidget ();
+    if (this.x is x && this.y is y) return;
+    this.x = x;
+    this.y = y;
+    if (tip.getVisible ()) configure ();
+}
+
+/**
+ * Sets the location of the receiver, which must be a tooltip,
+ * to the point specified by the argument which is relative
+ * to the display.
+ * <p>
+ * Note that this is different from most widgets where the
+ * location of the widget is relative to the parent.
+ * </p><p>
+ * Note that the platform window manager ultimately has control
+ * over the location of tooltips.
+ * </p>
+ *
+ * @param location the new location for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception DWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLocation (Point location) {
+    checkWidget ();
+    if (location is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
+    setLocation (location.x, location.y);
+}
+
+/**
+ * Sets the receiver's message.
+ *
+ * @param string the new message
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the text is null</li>
+ * </ul>
+ * @exception DWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMessage (String string) {
+    checkWidget ();
+    if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
+    if (layoutMessage !is null) layoutMessage.dispose();
+    layoutMessage = null;
+    if (string.length () !is 0) {
+        Display display = getDisplay (); 
+        layoutMessage = new TextLayout (display);
+        layoutMessage.setText (string);
+    }
+    if (tip.getVisible ()) configure ();
+}
+
+/**
+ * Sets the receiver's text.
+ *
+ * @param string the new text
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the text is null</li>
+ * </ul>
+ * @exception DWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+    checkWidget ();
+    //if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
+    if (layoutText !is null) layoutText.dispose ();
+    layoutText = null;
+    if (boldFont !is null) boldFont.dispose ();
+    boldFont = null;
+    if (string.length () !is 0) {
+        Display display = getDisplay ();
+        layoutText = new TextLayout (display);
+        layoutText.setText (string);
+        Font font = display.getSystemFont ();
+        FontData data = font.getFontData () [0];
+        boldFont = new Font (cast(Device) display, data.getName (), data.getHeight (), DWT.BOLD);
+        TextStyle style = new TextStyle (boldFont, null, null);
+        layoutText.setStyle (style, 0, string.length ());
+    }
+    if (tip.getVisible ()) configure ();
+}
+
+/**
+ * Marks the receiver as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise. 
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param visible the new visibility state
+ *
+ * @exception DWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setVisible (bool visible) {
+    if (visible) configure ();
+    tip.setVisible (visible);
+    Display display = getDisplay ();
+    if (runnable !is null) display.timerExec (-1, runnable);
+    runnable = null;
+    if (autohide && visible) {
+        runnable = new class Runnable {
+            public void run () {
+                if (!isDisposed ()) setVisible (false);
             }
             };
-        addListener (DWT.Dispose, listener);
-        tip.addListener (DWT.Paint, listener);
-        tip.addListener (DWT.MouseDown, listener);
-    }
-    
-    static int checkStyle (int style) {
-        int mask = DWT.ICON_ERROR | DWT.ICON_INFORMATION | DWT.ICON_WARNING;
-        if ((style & mask) is 0) return style;
-        return checkBits (style, DWT.ICON_INFORMATION, DWT.ICON_WARNING, DWT.ICON_ERROR, 0, 0, 0);
-    }
-    
-    /**
-     * Adds the listener to the collection of listeners who will
-     * be notified when the receiver is selected by the user, by sending
-     * it one of the messages defined in the <code>SelectionListener</code>
-     * interface.
-     * <p>
-     * <code>widgetSelected</code> is called when the receiver is selected.
-     * <code>widgetDefaultSelected</code> is not called.
-     * </p>
-     *
-     * @param listener the listener which should be notified when the receiver is selected by the user
-     *
-     * @exception IllegalArgumentException <ul>
-     *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
-     * </ul>
-     * @exception DWTException <ul>
-     *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-     * </ul>
-     *
-     * @see SelectionListener
-     * @see #removeSelectionListener
-     * @see SelectionEvent
-     */
-    public void addSelectionListener (SelectionListener listener) {
-        checkWidget ();
-        if (listener is null) error (DWT.ERROR_NULL_ARGUMENT);
-        TypedListener typedListener = new TypedListener (listener);
-        addListener (DWT.Selection,typedListener);
-        addListener (DWT.DefaultSelection,typedListener);
-    }
-    
-    void configure () {
-        Display display = parent.getDisplay ();
-        int x = this.x;
-        int y = this.y;
-        if (x is -1 || y is -1) {
-        Point point;
-        if (item !is null) {
-            point = item.getLocation ();
-        } else {
-            point = display.getCursorLocation ();
-        }
-            x = point.x;
-            y = point.y;
-        }
-        dwt.widgets.Monitor.Monitor monitor = parent.getMonitor ();
-        Rectangle dest = monitor.getBounds ();
-        Point size = getSize (dest.width / 4);
-        int w = size.x;
-        int h = size.y;
-        int t = (style & DWT.BALLOON) !is 0 ? TIP_HEIGHT : 0;
-        int i = (style & DWT.BALLOON) !is 0 ? 16 : 0;
-        tip.setSize (w, h + t);
-        int [] polyline;
-        spikeAbove = dest.height >= y + size.y + t;
-        if (dest.width >= x + size.x) {
-            if (dest.height >= y + size.y + t) {
-                polyline = [
-                            0, 5+t, 1, 5+t, 1, 3+t, 3, 1+t, 5, 1+t, 5, t, 
-                            16, t, 16, 0, 35, t,
-                            w-5, t, w-5, 1+t, w-3, 1+t, w-1, 3+t, w-1, 5+t, w, 5+t,
-                            w, h-5+t, w-1, h-5+t, w-1, h-3+t, w-2, h-3+t, w-2, h-2+t, w-3, h-2+t, w-3, h-1+t, w-5, h-1+t, w-5, h+t,
-                            5, h+t, 5, h-1+t, 3, h-1+t, 3, h-2+t, 2, h-2+t, 2, h-3+t, 1, h-3+t, 1, h-5+t, 0, h-5+t, 
-                            0, 5+t];
-                borderPolygon = [
-                                 0, 5+t, 1, 4+t, 1, 3+t, 3, 1+t,  4, 1+t, 5, t, 
-                                 16, t, 16, 1, 35, t,
-                                 w-6, 0+t, w-5, 1+t, w-4, 1+t, w-2, 3+t, w-2, 4+t, w-1, 5+t,
-                                 w-1, h-6+t, w-2, h-5+t, w-2, h-4+t, w-4, h-2+t, w-5, h-2+t, w-6, h-1+t,
-                                 5, h-1+t, 4, h-2+t, 3, h-2+t, 1, h-4+t, 1, h-5+t, 0, h-6+t, 
-                                 0, 5+t];
-                tip.setLocation (Math.max (0, x - i), y);
-            } else {
-                polyline = [
-                            0, 5, 1, 5, 1, 3, 3, 1, 5, 1, 5, 0, 
-                            w-5, 0, w-5, 1, w-3, 1, w-1, 3, w-1, 5, w, 5,
-                            w, h-5, w-1, h-5, w-1, h-3, w-2, h-3, w-2, h-2, w-3, h-2, w-3, h-1, w-5, h-1, w-5, h,
-                            35, h, 16, h+t, 16, h,
-                            5, h, 5, h-1, 3, h-1, 3, h-2, 2, h-2, 2, h-3, 1, h-3, 1, h-5, 0, h-5, 
-                            0, 5];
-                borderPolygon = [
-                                 0, 5, 1, 4, 1, 3, 3, 1,  4, 1, 5, 0, 
-                                 w-6, 0, w-5, 1, w-4, 1, w-2, 3, w-2, 4, w-1, 5,
-                                 w-1, h-6, w-2, h-5, w-2, h-4, w-4, h-2, w-5, h-2, w-6, h-1,
-                                 36, h-1, 16, h+t-1, 16, h-1,
-                                 5, h-1, 4, h-2, 3, h-2, 1, h-4, 1, h-5, 0, h-6, 
-                                 0, 5];
-                tip.setLocation (Math.max (0, x - i), y - size.y - t);
-            }
-        } else {
-            if (dest.height >= y + size.y + t) {
-                polyline = [
-                            0, 5+t, 1, 5+t, 1, 3+t, 3, 1+t, 5, 1+t, 5, t, 
-                            w-35, t, w-16, 0, w-16, t,
-                            w-5, t, w-5, 1+t, w-3, 1+t, w-1, 3+t, w-1, 5+t, w, 5+t,
-                            w, h-5+t, w-1, h-5+t, w-1, h-3+t, w-2, h-3+t, w-2, h-2+t, w-3, h-2+t, w-3, h-1+t, w-5, h-1+t, w-5, h+t,
-                            5, h+t, 5, h-1+t, 3, h-1+t, 3, h-2+t, 2, h-2+t, 2, h-3+t, 1, h-3+t, 1, h-5+t, 0, h-5+t, 
-                            0, 5+t];
-                borderPolygon = [
-                                 0, 5+t, 1, 4+t, 1, 3+t, 3, 1+t,  4, 1+t, 5, t, 
-                                 w-35, t, w-17, 2, w-17, t,
-                                 w-6, t, w-5, 1+t, w-4, 1+t, w-2, 3+t, w-2, 4+t, w-1, 5+t,
-                                 w-1, h-6+t, w-2, h-5+t, w-2, h-4+t, w-4, h-2+t, w-5, h-2+t, w-6, h-1+t,
-                                 5, h-1+t, 4, h-2+t, 3, h-2+t, 1, h-4+t, 1, h-5+t, 0, h-6+t, 
-                                 0, 5+t];
-                tip.setLocation (Math.min (dest.width - size.x, x - size.x + i), y);
-            } else {
-                polyline = [
-                            0, 5, 1, 5, 1, 3, 3, 1, 5, 1, 5, 0, 
-                            w-5, 0, w-5, 1, w-3, 1, w-1, 3, w-1, 5, w, 5,
-                            w, h-5, w-1, h-5, w-1, h-3, w-2, h-3, w-2, h-2, w-3, h-2, w-3, h-1, w-5, h-1, w-5, h,
-                            w-16, h, w-16, h+t, w-35, h,
-                            5, h, 5, h-1, 3, h-1, 3, h-2, 2, h-2, 2, h-3, 1, h-3, 1, h-5, 0, h-5, 
-                            0, 5];
-                borderPolygon = [
-                                 0, 5, 1, 4, 1, 3, 3, 1,  4, 1, 5, 0, 
-                                 w-6, 0, w-5, 1, w-4, 1, w-2, 3, w-2, 4, w-1, 5,
-                                 w-1, h-6, w-2, h-5, w-2, h-4, w-4, h-2, w-5, h-2, w-6, h-1,
-                                 w-17, h-1, w-17, h+t-2, w-36, h-1,
-                                 5, h-1, 4, h-2, 3, h-2, 1, h-4, 1, h-5, 0, h-6, 
-                                 0, 5];
-                tip.setLocation (Math.min (dest.width - size.x, x - size.x + i), y - size.y - t);
-            }
-        }   
-        if ((style & DWT.BALLOON) !is 0) {
-            if (region !is null) region.dispose ();
-            region = new Region (display);
-            region.add (polyline);
-            tip.setRegion (region);
-        }
-    }
-    
-    /**
-     * Returns <code>true</code> if the receiver is automatically
-     * hidden by the platform, and <code>false</code> otherwise.
-     *
-     * @return the receiver's auto hide state
-     *
-     * @exception DWTException <ul>
-     *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-     * </ul>
-     * 
-     */
-    public bool getAutoHide () {
-        checkWidget ();
-        return autohide;
-    }
-    
-    Point getSize (int maxWidth) {
-        int textWidth = 0, messageWidth = 0;
-        if (layoutText !is null) {
-            layoutText.setWidth (-1);
-            textWidth = layoutText.getBounds ().width;
-        }
-        if (layoutMessage !is null) {
-            layoutMessage.setWidth (-1);
-            messageWidth = layoutMessage.getBounds ().width;
-        }
-        int messageTrim = 2 * INSET + 2 * BORDER + 2 * PADDING;
-    bool hasImage =     layoutText !is null && (style & DWT.BALLOON) !is 0 && (style & (DWT.ICON_ERROR | DWT.ICON_INFORMATION | DWT.ICON_WARNING)) !is 0;
-        int textTrim = messageTrim + (hasImage ? IMAGE_SIZE : 0);
-        int width = Math.min (maxWidth, Math.max (textWidth + textTrim, messageWidth + messageTrim));
-        int textHeight = 0, messageHeight = 0;
-        if (layoutText !is null) {
-            layoutText.setWidth (maxWidth - textTrim);  
-            textHeight = layoutText.getBounds ().height;
-        }
-        if (layoutMessage !is null) {
-            layoutMessage.setWidth (maxWidth - messageTrim);
-            messageHeight = layoutMessage.getBounds ().height;
-        }
-        int height = 2 * BORDER + 2 * PADDING + messageHeight;
-        if (layoutText !is null) height += Math.max (IMAGE_SIZE, textHeight) + 2 * PADDING;
-        return new Point (width, height);
-    }
-    
-    /**
-     * Returns the receiver's message, which will be an empty
-     * string if it has never been set.
-     *
-     * @return the receiver's message
-     *
-     * @exception DWTException <ul>
-     *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-     * </ul>
-     */
-    public String getMessage () {
-        checkWidget ();
-        return layoutMessage !is null ? layoutMessage.getText() : "";
-    }
-    
-    /**
-     * Returns the receiver's parent, which must be a <code>Shell</code>.
-     *
-     * @return the receiver's parent
-     *
-     * @exception DWTException <ul>
-     *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-     * </ul>
-     */
-    public Shell getParent () {
-        checkWidget ();
-        return parent;
-    }
-    
-    /**
-     * Returns the receiver's text, which will be an empty
-     * string if it has never been set.
-     *
-     * @return the receiver's text
-     *
-     * @exception DWTException <ul>
-     *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-     * </ul>
-     */
-    public String getText () {
-        checkWidget ();
-        return layoutText !is null ? layoutText.getText() : "";
-    }
-    
-    /**
-     * Returns <code>true</code> if the receiver is visible, and
-     * <code>false</code> otherwise.
-     * <p>
-     * If one of the receiver's ancestors is not visible or some
-     * other condition makes the receiver not visible, this method
-     * may still indicate that it is considered visible even though
-     * it may not actually be showing.
-     * </p>
-     *
-     * @return the receiver's visibility state
-     *
-     * @exception DWTException <ul>
-     *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-     * </ul>
-     */
-    public bool getVisible () {
-        checkWidget ();
-        return tip.getVisible ();
+        display.timerExec(DELAY, runnable);
     }
-    
-    /**
-     * Returns <code>true</code> if the receiver is visible and all
-     * of the receiver's ancestors are visible and <code>false</code>
-     * otherwise.
-     *
-     * @return the receiver's visibility state
-     *
-     * @exception DWTException <ul>
-     *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-     * </ul>
-     *
-     * @see #getVisible
-     */
-    public bool isVisible () {
-        checkWidget ();
-        return getVisible ();
-    }
-    
-    void onDispose (Event event) {
-        removeListener (DWT.Dispose, listener);
-        notifyListeners (DWT.Dispose, event);
-        event.type = DWT.None;
-        
-        if (runnable !is null) {
-            Display display = getDisplay ();
-            display.timerExec (-1, runnable);
-        }
-        runnable = null;
-        tip.dispose ();
-        tip = null;
-        if (region !is null) region.dispose ();
-        region = null;
-        if (layoutText !is null) layoutText.dispose ();
-        layoutText = null;
-        if (layoutMessage !is null) layoutMessage.dispose ();
-        layoutMessage = null;
-        if (boldFont !is null) boldFont.dispose ();
-        boldFont = null;
-        borderPolygon = null;
-    }
-    
-    void onMouseDown (Event event) {
-        notifyListeners (DWT.Selection, new Event ());
-        setVisible (false);
-    }
-    
-    void onPaint (Event event) {
-        GC gc = event.gc;
-        int x = BORDER + PADDING;
-        int y = BORDER + PADDING;
-        if ((style & DWT.BALLOON) !is 0) {
-            if (spikeAbove) y += TIP_HEIGHT;
-            gc.drawPolygon (borderPolygon);
-        } else {
-            Rectangle rect = tip.getClientArea ();
-            gc.drawRectangle(rect.x, rect.y, rect.width - 1, rect.height -1);
-        } 
-        if (layoutText !is null) {
-            int id = style & (DWT.ICON_ERROR | DWT.ICON_INFORMATION | DWT.ICON_WARNING);
-            if ((style & DWT.BALLOON) !is 0 && id !is 0) {
-                Display display = getDisplay ();
-                Image image = display.getSystemImage (id);
-                Rectangle rect = image.getBounds ();
-                gc.drawImage (image, 0, 0, rect.width, rect.height, x, y, IMAGE_SIZE, IMAGE_SIZE);
-                x += IMAGE_SIZE;
-            }
-            x += INSET;
-            layoutText.draw (gc, x, y);
-            y += 2 * PADDING + Math.max (IMAGE_SIZE, layoutText.getBounds ().height);
-        }
-        if (layoutMessage !is null) {
-            x = BORDER + PADDING + INSET;
-            layoutMessage.draw (gc, x, y);
-        }
-    }
-    
-    /**
-     * Removes the listener from the collection of listeners who will
-     * be notified when the receiver is selected by the user.
-     *
-     * @param listener the listener which should no longer be notified
-     *
-     * @exception IllegalArgumentException <ul>
-     *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
-     * </ul>
-     * @exception DWTException <ul>
-     *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-     * </ul>
-     *
-     * @see SelectionListener
-     * @see #addSelectionListener
-     */
-    public void removeSelectionListener (SelectionListener listener) {
-        checkWidget();
-        if (listener is null) error (DWT.ERROR_NULL_ARGUMENT);
-        if (eventTable is null) return;
-        eventTable.unhook (DWT.Selection, listener);
-        eventTable.unhook (DWT.DefaultSelection,listener);  
-    }
-    
-    /**
-     * Makes the receiver hide automatically when <code>true</code>,
-     * and remain visible when <code>false</code>.
-     *
-     * @param autoHide the auto hide state
-     *
-     * @exception DWTException <ul>
-     *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-     * </ul>
-     * 
-     * @see #getVisible
-     * @see #setVisible
-     */
-    public void setAutoHide (bool autohide) {
-        checkWidget ();
-        this.autohide = autohide;
-        //TODO - update when visible
-    }
-    
-    /**
-     * Sets the location of the receiver, which must be a tooltip,
-     * to the point specified by the arguments which are relative
-     * to the display.
-     * <p>
-     * Note that this is different from most widgets where the
-     * location of the widget is relative to the parent.
-     * </p>
-     *
-     * @param x the new x coordinate for the receiver
-     * @param y the new y coordinate for the receiver
-     *
-     * @exception DWTException <ul>
-     *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-     * </ul>
-     */
-    public void setLocation (int x, int y) {
-        checkWidget ();
-        if (this.x is x && this.y is y) return;
-        this.x = x;
-        this.y = y;
-        if (tip.getVisible ()) configure ();
-    }
-    
-    /**
-     * Sets the location of the receiver, which must be a tooltip,
-     * to the point specified by the argument which is relative
-     * to the display.
-     * <p>
-     * Note that this is different from most widgets where the
-     * location of the widget is relative to the parent.
-     * </p><p>
-     * Note that the platform window manager ultimately has control
-     * over the location of tooltips.
-     * </p>
-     *
-     * @param location the new location for the receiver
-     *
-     * @exception IllegalArgumentException <ul>
-     *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
-     * </ul>
-     * @exception DWTException <ul>
-     *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-     * </ul>
-     */
-    public void setLocation (Point location) {
-        checkWidget ();
-        if (location is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
-        setLocation (location.x, location.y);
-    }
-    
-    /**
-     * Sets the receiver's message.
-     *
-     * @param string the new message
-     *
-     * @exception IllegalArgumentException <ul>
-     *    <li>ERROR_NULL_ARGUMENT - if the text is null</li>
-     * </ul>
-     * @exception DWTException <ul>
-     *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-     * </ul>
-     */
-    public void setMessage (String string) {
-        checkWidget ();
-        if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
-        if (layoutMessage !is null) layoutMessage.dispose();
-        layoutMessage = null;
-        if (string.length () !is 0) {
-            Display display = getDisplay (); 
-            layoutMessage = new TextLayout (display);
-            layoutMessage.setText (string);
-        }
-        if (tip.getVisible ()) configure ();
-    }
-    
-    /**
-     * Sets the receiver's text.
-     *
-     * @param string the new text
-     *
-     * @exception IllegalArgumentException <ul>
-     *    <li>ERROR_NULL_ARGUMENT - if the text is null</li>
-     * </ul>
-     * @exception DWTException <ul>
-     *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-     * </ul>
-     */
-    public void setText (String string) {
-        checkWidget ();
-        //if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
-        if (layoutText !is null) layoutText.dispose ();
-        layoutText = null;
-        if (boldFont !is null) boldFont.dispose ();
-        boldFont = null;
-        if (string.length () !is 0) {
-            Display display = getDisplay ();
-            layoutText = new TextLayout (display);
-            layoutText.setText (string);
-            Font font = display.getSystemFont ();
-            FontData data = font.getFontData () [0];
-            boldFont = new Font (cast(Device) display, data.getName (), data.getHeight (), DWT.BOLD);
-            TextStyle style = new TextStyle (boldFont, null, null);
-            layoutText.setStyle (style, 0, string.length ());
-        }
-        if (tip.getVisible ()) configure ();
-    }
-    
-    /**
-     * Marks the receiver as visible if the argument is <code>true</code>,
-     * and marks it invisible otherwise. 
-     * <p>
-     * If one of the receiver's ancestors is not visible or some
-     * other condition makes the receiver not visible, marking
-     * it visible may not actually cause it to be displayed.
-     * </p>
-     *
-     * @param visible the new visibility state
-     *
-     * @exception DWTException <ul>
-     *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-     * </ul>
-     */
-    public void setVisible (bool visible) {
-        if (visible) configure ();
-        tip.setVisible (visible);
-        Display display = getDisplay ();
-        if (runnable !is null) display.timerExec (-1, runnable);
-        runnable = null;
-        if (autohide && visible) {
-            runnable = new class Runnable {
-                public void run () {
-                    if (!isDisposed ()) setVisible (false);
-                }
-                };
-            display.timerExec(DELAY, runnable);
-        }
-    }
-    
-    }
+}
+
+}
--- a/dwt/widgets/Tracker.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Tracker.d	Thu Jan 15 23:08:54 2009 +0100
@@ -15,7 +15,7 @@
 
 import dwt.dwthelper.utils;
 
- 
+
 import dwt.DWT;
 import dwt.DWTException;
 import dwt.events.ControlListener;
@@ -79,10 +79,10 @@
     bool inEvent = false;
     NSWindow window;
     int oldX, oldY;
-        
+    
     /*
-    * The following values mirror step sizes on Windows
-    */
+     * The following values mirror step sizes on Windows
+     */
     const static int STEPSIZE_SMALL = 1;
     const static int STEPSIZE_LARGE = 9;
     
@@ -246,7 +246,7 @@
 Point adjustResizeCursor (bool movePointer) {
     if (bounds is null) return null;
     int newX, newY;
-
+    
     if ((cursorOrientation & DWT.LEFT) !is 0) {
         newX = bounds.x;
     } else if ((cursorOrientation & DWT.RIGHT) !is 0) {
@@ -254,7 +254,7 @@
     } else {
         newX = bounds.x + bounds.width / 2;
     }
-
+    
     if ((cursorOrientation & DWT.UP) !is 0) {
         newY = bounds.y;
     } else if ((cursorOrientation & DWT.DOWN) !is 0) {
@@ -262,7 +262,7 @@
     } else {
         newY = bounds.y + bounds.height / 2;
     }
-
+    
     /*
      * Convert to screen coordinates if needed
      */
@@ -274,11 +274,11 @@
     if (movePointer) {
         display.setCursorLocation(newX, newY);
     }
-
+    
     /*
-    * If the client has not provided a custom cursor then determine
-    * the appropriate resize cursor.
-    */
+     * If the client has not provided a custom cursor then determine
+     * the appropriate resize cursor.
+     */
     if (clientCursor is null) {
         Cursor newCursor = null;
         switch (cursorOrientation) {
@@ -316,7 +316,7 @@
         }
         resizeCursor = newCursor;
     }
-        
+    
     return new Point (newX, newY);
 }
 
@@ -482,11 +482,11 @@
             sendEvent (DWT.Resize, event);
             inEvent = false;
             /*
-            * It is possible (but unlikely), that application
-            * code could have disposed the widget in the move
-            * event.  If this happens, return false to indicate
-            * that the tracking has failed.
-            */
+             * It is possible (but unlikely), that application
+             * code could have disposed the widget in the move
+             * event.  If this happens, return false to indicate
+             * that the tracking has failed.
+             */
             if (isDisposed ()) {
                 cancelled = true;
                 return;
@@ -529,11 +529,11 @@
             sendEvent (DWT.Move, event);
             inEvent = false;
             /*
-            * It is possible (but unlikely), that application
-            * code could have disposed the widget in the move
-            * event.  If this happens, return false to indicate
-            * that the tracking has failed.
-            */
+             * It is possible (but unlikely), that application
+             * code could have disposed the widget in the move
+             * event.  If this happens, return false to indicate
+             * that the tracking has failed.
+             */
             if (isDisposed ()) {
                 cancelled = true;
                 return;
@@ -578,7 +578,7 @@
 
 void key (NSEvent nsEvent) {
     //TODO send event
-//  if (!sendKeyEvent (DWT.KeyDown, theEvent)) return OS.noErr;
+    //  if (!sendKeyEvent (DWT.KeyDown, theEvent)) return OS.noErr;
     NSUInteger modifierFlags = nsEvent.modifierFlags();
     int stepSize = (modifierFlags & OS.NSControlKeyMask) !is 0 ? STEPSIZE_SMALL : STEPSIZE_LARGE;
     int xChange = 0, yChange = 0;
@@ -624,11 +624,11 @@
             sendEvent (DWT.Resize, event);
             inEvent = false;
             /*
-            * It is possible (but unlikely) that application
-            * code could have disposed the widget in the move
-            * event.  If this happens return false to indicate
-            * that the tracking has failed.
-            */
+             * It is possible (but unlikely) that application
+             * code could have disposed the widget in the move
+             * event.  If this happens return false to indicate
+             * that the tracking has failed.
+             */
             if (isDisposed ()) {
                 cancelled = true;
                 return;
@@ -666,11 +666,11 @@
             sendEvent (DWT.Move, event);
             inEvent = false;
             /*
-            * It is possible (but unlikely) that application
-            * code could have disposed the widget in the move
-            * event.  If this happens return false to indicate
-            * that the tracking has failed.
-            */
+             * It is possible (but unlikely) that application
+             * code could have disposed the widget in the move
+             * event.  If this happens return false to indicate
+             * that the tracking has failed.
+             */
             if (isDisposed ()) {
                 cancelled = true;
                 return;
@@ -773,13 +773,13 @@
     frame.x = frame.y = 0;
     NSBezierPath.fillRect(frame);
     window.orderFrontRegardless();
-
+    
     drawRectangles (window, rectangles, false);
     
     /*
-    * If exactly one of UP/DOWN is specified as a style then set the cursor
-    * orientation accordingly (the same is done for LEFT/RIGHT styles below).
-    */
+     * If exactly one of UP/DOWN is specified as a style then set the cursor
+     * orientation accordingly (the same is done for LEFT/RIGHT styles below).
+     */
     int vStyle = style & (DWT.UP | DWT.DOWN);
     if (vStyle is DWT.UP || vStyle is DWT.DOWN) {
         cursorOrientation |= vStyle;
@@ -813,7 +813,7 @@
         oldX = cursorPos.x;
         oldY = cursorPos.y;
     }
-
+    
     /* Tracker behaves like a Dialog with its own OS event loop. */
     while (tracking && !cancelled) {
         NSAutoreleasePool pool = cast(NSAutoreleasePool)(new NSAutoreleasePool()).alloc().init();
@@ -831,16 +831,16 @@
                 mouse(event);
                 break;
             case OS.NSKeyDown:
-//          case OS.NSKeyUp:
+                //          case OS.NSKeyUp:
             case OS.NSFlagsChanged:
                 key(event);
                 break;
             default:
         }
         /*
-        * Don't dispatch mouse and key events in general, EXCEPT once this
-        * tracker has finished its work.
-        */
+         * Don't dispatch mouse and key events in general, EXCEPT once this
+         * tracker has finished its work.
+         */
         bool dispatch = true;
         if (!(tracking && !cancelled)) {
             switch (type) {
@@ -943,9 +943,9 @@
     if (bounds is null) return false;
     bool orientationInit = false;
     /*
-    * If the cursor orientation has not been set in the orientation of
-    * this change then try to set it here.
-    */
+     * If the cursor orientation has not been set in the orientation of
+     * this change then try to set it here.
+     */
     if (xChange < 0 && ((style & DWT.LEFT) !is 0) && ((cursorOrientation & DWT.RIGHT) is 0)) {
         if ((cursorOrientation & DWT.LEFT) is 0) {
             cursorOrientation |= DWT.LEFT;
@@ -1056,10 +1056,10 @@
     for (int i = 0; i < rectangles.length; i++) {
         Rectangle proportion = proportions[i];
         newRects[i] = new Rectangle (
-            proportion.x * bounds.width / 100 + bounds.x,
-            proportion.y * bounds.height / 100 + bounds.y,
-            proportion.width * bounds.width / 100,
-            proportion.height * bounds.height / 100);
+                                     proportion.x * bounds.width / 100 + bounds.x,
+                                     proportion.y * bounds.height / 100 + bounds.y,
+                                     proportion.width * bounds.width / 100,
+                                     proportion.height * bounds.height / 100);
     }
     rectangles = newRects;
     return orientationInit;
--- a/dwt/widgets/Tree.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Tree.d	Thu Jan 15 23:08:54 2009 +0100
@@ -141,7 +141,7 @@
     int sortDirection;
     Carbon.CGFloat levelIndent;
     bool ignoreExpand, ignoreSelect;
-
+    
 /**
  * Constructs a new instance of this class given its parent
  * and a style value describing its behavior and appearance.
@@ -287,13 +287,13 @@
         TreeItem parentItem = item.getParentItem ();
         event.item = item;
         event.index = parentItem is null ? indexOf (item) : parentItem.indexOf (item);
-//      ignoreRedraw = true;
+        //      ignoreRedraw = true;
         sendEvent (DWT.SetData, event);
         //widget could be disposed at this point
-//      ignoreRedraw = false;
+        //      ignoreRedraw = false;
         if (isDisposed () || item.isDisposed ()) return false;
         if (redraw) {
-//          if (!setScrollWidth (item)) item.redraw (OS.kDataBrowserNoItem);
+            //          if (!setScrollWidth (item)) item.redraw (OS.kDataBrowserNoItem);
         }
     }
     return true;
@@ -301,14 +301,14 @@
 
 static int checkStyle (int style) {
     /*
-    * Feature in Windows.  Even when WS_HSCROLL or
-    * WS_VSCROLL is not specified, Windows creates
-    * trees and tables with scroll bars.  The fix
-    * is to set H_SCROLL and V_SCROLL.
-    * 
-    * NOTE: This code appears on all platforms so that
-    * applications have consistent scroll bar behavior.
-    */
+     * Feature in Windows.  Even when WS_HSCROLL or
+     * WS_VSCROLL is not specified, Windows creates
+     * trees and tables with scroll bars.  The fix
+     * is to set H_SCROLL and V_SCROLL.
+     * 
+     * NOTE: This code appears on all platforms so that
+     * applications have consistent scroll bar behavior.
+     */
     if ((style & DWT.NO_SCROLL) is 0) {
         style |= DWT.H_SCROLL | DWT.V_SCROLL;
     }
@@ -414,16 +414,16 @@
                 width += columns [i].getWidth ();
             }
         } else {
-//          int levelIndent = DISCLOSURE_COLUMN_LEVEL_INDENT;
-//          if (OS.VERSION >= 0x1040) {
-//              float [] metric = new float [1];
-//              OS.DataBrowserGetMetric (handle, OS.kDataBrowserMetricDisclosureColumnPerDepthGap, null, metric);
-//              levelIndent = cast(int) metric [0];
-//          }
-//          GC gc = new GC (this);
-//          width = calculateWidth (childIds, gc, true, 0, levelIndent);
-//          gc.dispose ();
-//          width += getInsetWidth (columnid, true);
+            //          int levelIndent = DISCLOSURE_COLUMN_LEVEL_INDENT;
+            //          if (OS.VERSION >= 0x1040) {
+            //              float [] metric = new float [1];
+            //              OS.DataBrowserGetMetric (handle, OS.kDataBrowserMetricDisclosureColumnPerDepthGap, null, metric);
+            //              levelIndent = cast(int) metric [0];
+            //          }
+            //          GC gc = new GC (this);
+            //          width = calculateWidth (childIds, gc, true, 0, levelIndent);
+            //          gc.dispose ();
+            //          width += getInsetWidth (columnid, true);
         }
         if ((style & DWT.CHECK) !is 0) width += getCheckColumnWidth ();
     } else {
@@ -692,27 +692,27 @@
     checkWidget ();
     if (item is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (item.isDisposed ()) error (DWT.ERROR_INVALID_ARGUMENT);
-//  ignoreSelect = true;
-//  /*
-//  * Bug in the Macintosh.  When the DataBroswer selection flags includes
-//  * both kDataBrowserNeverEmptySelectionSet and kDataBrowserSelectOnlyOne,
-//  * two items are selected when SetDataBrowserSelectedItems() is called
-//  * with kDataBrowserItemsAssign to assign a new seletion despite the fact
-//  * that kDataBrowserSelectOnlyOne was specified.  The fix is to save and
-//  * restore kDataBrowserNeverEmptySelectionSet around each call to
-//  * SetDataBrowserSelectedItems().
-//  */
-//  int [] selectionFlags = null;
-//  if ((style & DWT.SINGLE) !is 0) {
-//      selectionFlags = new int [1];
-//      OS.GetDataBrowserSelectionFlags (handle, selectionFlags);
-//      OS.SetDataBrowserSelectionFlags (handle, selectionFlags [0] & ~OS.kDataBrowserNeverEmptySelectionSet);
-//  }
-//  OS.SetDataBrowserSelectedItems (handle, 1, new int [] {item.id}, OS.kDataBrowserItemsRemove);
-//  if ((style & DWT.SINGLE) !is 0) {
-//      OS.SetDataBrowserSelectionFlags (handle, selectionFlags [0]);
-//  }
-//  ignoreSelect = false;
+    //  ignoreSelect = true;
+    //  /*
+    //  * Bug in the Macintosh.  When the DataBroswer selection flags includes
+    //  * both kDataBrowserNeverEmptySelectionSet and kDataBrowserSelectOnlyOne,
+    //  * two items are selected when SetDataBrowserSelectedItems() is called
+    //  * with kDataBrowserItemsAssign to assign a new seletion despite the fact
+    //  * that kDataBrowserSelectOnlyOne was specified.  The fix is to save and
+    //  * restore kDataBrowserNeverEmptySelectionSet around each call to
+    //  * SetDataBrowserSelectedItems().
+    //  */
+    //  int [] selectionFlags = null;
+    //  if ((style & DWT.SINGLE) !is 0) {
+    //      selectionFlags = new int [1];
+    //      OS.GetDataBrowserSelectionFlags (handle, selectionFlags);
+    //      OS.SetDataBrowserSelectionFlags (handle, selectionFlags [0] & ~OS.kDataBrowserNeverEmptySelectionSet);
+    //  }
+    //  OS.SetDataBrowserSelectedItems (handle, 1, new int [] {item.id}, OS.kDataBrowserItemsRemove);
+    //  if ((style & DWT.SINGLE) !is 0) {
+    //      OS.SetDataBrowserSelectionFlags (handle, selectionFlags [0]);
+    //  }
+    //  ignoreSelect = false;
 }
 
 
@@ -778,9 +778,9 @@
             }
         }
     }
-
+    
     NSInteger oldIndex = (cast(NSOutlineView)view).columnWithIdentifier (column.nsColumn);
-
+    
     if (columnCount is 1) {
         //TODO - reset attributes
         firstColumn = column.nsColumn;
@@ -793,7 +793,7 @@
     }
     System.arraycopy (columns, index + 1, columns, index, --columnCount - index);
     columns [columnCount] = null;
-
+    
     NSArray array = (cast(NSOutlineView)view).tableColumns ();
     NSUInteger arraySize = cast(int)/*64*/array.count ();
     for (NSUInteger i = oldIndex; i < arraySize; i++) {
@@ -823,7 +823,7 @@
         if (items [index] is item) break;
         index++;
     }
-//  if (index !is itemCount - 1) fixSelection (index, false); 
+    //  if (index !is itemCount - 1) fixSelection (index, false); 
     System.arraycopy (items, index + 1, items, index, --count - index);
     items [count] = null;
     if (parentItem !is null) {
@@ -842,14 +842,14 @@
     
     //(cast(NSTableView)view).noteNumberOfRowsChanged();
     
-//  setScrollWidth (true);
-//  fixScrollBar ();
+    //  setScrollWidth (true);
+    //  fixScrollBar ();
 }
 
 void drawInteriorWithFrame_inView (objc.id id, objc.SEL sel, objc.id cellFrame, objc.id view) {
     NSRect rect = NSRect ();
     OS.memmove (&rect, cellFrame, NSRect.sizeof);
-
+    
     NSOutlineView outlineView = cast(NSOutlineView)this.view;
     NSBrowserCell cell = new NSBrowserCell (id);
     NSRange rowsRange = outlineView.rowsInRect (rect);
@@ -870,14 +870,14 @@
             }
         }
     }
-
+    
     Color background = item.cellBackground !is null ? item.cellBackground [columnIndex] : null;
     if (background is null) background = item.background;
     bool drawBackground = background !is null;
     bool drawForeground = true;
     bool isSelected = outlineView.isRowSelected (rowIndex);
     bool drawSelection = isSelected;
-
+    
     NSColor nsSelectionBackground = null;
     NSColor nsSelectionForeground = null;
     if (isSelected) {
@@ -890,7 +890,7 @@
         nsSelectionBackground = cell.highlightColorInView (outlineView);
         nsSelectionBackground = nsSelectionBackground.colorUsingColorSpace (NSColorSpace.deviceRGBColorSpace ());
     }
-
+    
     NSRect fullRect = NSRect ();
     fullRect.y = rect.y; fullRect.height = rect.height;
     if (columnCount is 0) {
@@ -911,7 +911,7 @@
             fullRect.width = rect.width + spacing.width;
         }
     }
-
+    
     if (hooks (DWT.EraseItem)) {
         NSRect eraseItemRect;
         // TODO how to handle rearranged columns?  The third clause below ensures that
@@ -942,7 +942,7 @@
             gc.setForeground (item.getForeground (columnIndex));
             gc.setBackground (item.getBackground (columnIndex));
         }
-
+        
         Event event = new Event ();
         event.item = item;
         event.gc = gc;
@@ -984,7 +984,7 @@
             callSuper (outlineView.id, OS.sel_highlightSelectionInClipRect_, selectionRect);
         }
     }
-
+    
     if (drawBackground && !drawSelection) {
         NSGraphicsContext context = NSGraphicsContext.currentContext ();
         context.saveGraphicsState ();
@@ -994,16 +994,16 @@
         NSBezierPath.fillRect (fullRect);
         context.restoreGraphicsState ();
     }
-
+    
     if (drawForeground) {
         cell.setHighlighted (false);
         callSuper (id, sel, rect, view);
     }
-
+    
     if (hooks (DWT.PaintItem)) {
         NSRect contentRect = cell.titleRectForBounds (rect);
         NSSize contentSize = cell.cellSizeForBounds (rect);
-
+        
         GCData data = new GCData ();
         // TODO how to handle rearranged columns?  The third clause below ensures that
         // there are either 0 columns or that column 0 is still the first physical column.
@@ -1034,7 +1034,7 @@
             gc.setForeground (item.getForeground (columnIndex));
             gc.setBackground (item.getBackground (columnIndex));
         }
-
+        
         Event event = new Event ();
         event.item = item;
         event.gc = gc;
@@ -1051,17 +1051,17 @@
 
 void fixScrollBar () {
     /*
-    * Bug in the Macintosh. For some reason, the data browser does not update
-    * the vertical scrollbar when it is scrolled to the bottom and items are
-    * removed.  The fix is to check if the scrollbar value is bigger the
-    * maximum number of visible items and clamp it when needed.
-    */
-//  int [] top = new int [1], left = new int [1];
-//  OS.GetDataBrowserScrollPosition (handle, top, left);
-//  int maximum = Math.max (0, getItemHeight () * visibleCount - getClientArea ().height);
-//  if (top [0] > maximum) {
-//      OS.SetDataBrowserScrollPosition (handle, maximum, left [0]);
-//  }
+     * Bug in the Macintosh. For some reason, the data browser does not update
+     * the vertical scrollbar when it is scrolled to the bottom and items are
+     * removed.  The fix is to check if the scrollbar value is bigger the
+     * maximum number of visible items and clamp it when needed.
+     */
+    //  int [] top = new int [1], left = new int [1];
+    //  OS.GetDataBrowserScrollPosition (handle, top, left);
+    //  int maximum = Math.max (0, getItemHeight () * visibleCount - getClientArea ().height);
+    //  if (top [0] > maximum) {
+    //      OS.SetDataBrowserScrollPosition (handle, maximum, left [0]);
+    //  }
 }
 
 int getCheckColumnWidth () {
@@ -1554,18 +1554,18 @@
  */
 public TreeItem getTopItem () {
     checkWidget ();
-//  //TODO - optimize
-//  Rect rect = new Rect ();
-//  int y = getBorder () + getHeaderHeight ();
-//  for (int i=0; i<items.length; i++) {
-//      TreeItem item = items [i];
-//      if (item !is null) {
-//          int columnId = (columnCount is 0) ? columnid : columns [0].id;
-//          if (OS.GetDataBrowserItemPartBounds (handle, item.id, columnId, OS.kDataBrowserPropertyEnclosingPart, rect) is OS.noErr) {
-//              if (rect.top <= y && y <= rect.bottom) return item;
-//          }
-//      }
-//  }
+    //  //TODO - optimize
+    //  Rect rect = new Rect ();
+    //  int y = getBorder () + getHeaderHeight ();
+    //  for (int i=0; i<items.length; i++) {
+    //      TreeItem item = items [i];
+    //      if (item !is null) {
+    //          int columnId = (columnCount is 0) ? columnid : columns [0].id;
+    //          if (OS.GetDataBrowserItemPartBounds (handle, item.id, columnId, OS.kDataBrowserPropertyEnclosingPart, rect) is OS.noErr) {
+    //              if (rect.top <= y && y <= rect.bottom) return item;
+    //          }
+    //      }
+    //  }
     return null;
 }
 
@@ -1697,7 +1697,7 @@
     NSBrowserCell browserCell = new NSBrowserCell (cell);
     browserCell.setImage (image !is null ? image.handle : null);
     browserCell.setFont (item.getFont (columnIndex).handle);
-
+    
     if (hooks (DWT.MeasureItem)) {
         NSOutlineView view = cast(NSOutlineView)this.view;
         NSInteger nsColumnIndex = view.columnWithIdentifier (new cocoa.id (tableColumn));
@@ -1705,7 +1705,7 @@
         NSRect rect = view.frameOfCellAtColumn (nsColumnIndex, rowIndex);
         NSRect contentRect = browserCell.titleRectForBounds (rect);
         NSSize contentSize = browserCell.cellSizeForBounds (rect);
-
+        
         GCData data = new GCData ();
         data.paintRectStruct = view.frame ();
         data.paintRect = &data.paintRectStruct;
@@ -1763,14 +1763,14 @@
     cocoa.id columnId = userInfo.valueForKey (NSString.stringWith ("NSTableColumn")); //$NON-NLS-1$
     TreeColumn column = getColumn (columnId);
     if (column is null) return; /* either CHECK column or firstColumn in 0-column Tree */
-
+    
     column.sendEvent (DWT.Resize);
     if (isDisposed ()) return;
-
+    
     NSOutlineView outlineView = cast(NSOutlineView)view;
     NSInteger index = outlineView.columnWithIdentifier (columnId);
     if (index is -1) return; /* column was disposed in Resize callback */
-
+    
     NSArray nsColumns = outlineView.tableColumns ();
     NSInteger columnCount = outlineView.numberOfColumns ();
     for (NSInteger i = index + 1; i < columnCount; i++) {
@@ -2124,7 +2124,7 @@
             outlineView.moveColumn (oldIndex, newIndex);
             newX [index] = cast(int)outlineView.rectOfColumn (newIndex).x;
         }
-
+        
         TreeColumn[] newColumns = new TreeColumn [columnCount];
         System.arraycopy (columns, 0, newColumns, 0, columnCount);
         for (int i=0; i<columnCount; i++) {
@@ -2232,20 +2232,20 @@
     if (itemHeight is -1) {
         //TODO - reset item height, ensure other API's such as setFont don't do this
     } else {
-//      OS.SetDataBrowserTableViewRowHeight (handle, cast(short) itemHeight);
+        //      OS.SetDataBrowserTableViewRowHeight (handle, cast(short) itemHeight);
     }
 }
 
 void setItemHeight (Image image) {
-//  Rectangle bounds = image !is null ? image.getBounds () : imageBounds;
-//  if (bounds is null) return;
-//  imageBounds = bounds;
-//  short [] height = new short [1];
-//  if (OS.GetDataBrowserTableViewRowHeight (handle, height) is OS.noErr) {
-//      if (height [0] < bounds.height) {
-//          OS.SetDataBrowserTableViewRowHeight (handle, cast(short) bounds.height);
-//      }
-//  }
+    //  Rectangle bounds = image !is null ? image.getBounds () : imageBounds;
+    //  if (bounds is null) return;
+    //  imageBounds = bounds;
+    //  short [] height = new short [1];
+    //  if (OS.GetDataBrowserTableViewRowHeight (handle, height) is OS.noErr) {
+    //      if (height [0] < bounds.height) {
+    //          OS.SetDataBrowserTableViewRowHeight (handle, cast(short) bounds.height);
+    //      }
+    //  }
 }
 
 /**
@@ -2289,10 +2289,10 @@
 
 bool setScrollWidth (TreeItem[] items, bool recurse, bool callMeasureItem) {
     if (columnCount !is 0) return false;
-//  if (currentItem !is null) {
-//      if (currentItem !is item) fixScrollWidth = true;
-//      return false;
-//  }
+    //  if (currentItem !is null) {
+    //      if (currentItem !is item) fixScrollWidth = true;
+    //      return false;
+    //  }
     if (/*ignoreRedraw ||*/ drawCount !is 0) return false;
     int newWidth = 0;
     GC gc = new GC (this);
--- a/dwt/widgets/TreeColumn.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/TreeColumn.d	Thu Jan 15 23:08:54 2009 +0100
@@ -68,9 +68,9 @@
     NSTableColumn nsColumn;
     Tree parent;
     String toolTipText, displayText;
-
+    
     static const int MARGIN = 2;
-
+    
 /**
  * Constructs a new instance of this class given its parent
  * (which must be a <code>Tree</code>) and a style value
@@ -232,7 +232,7 @@
 void drawInteriorWithFrame_inView (objc.id id, objc.SEL sel, objc.id cellFrame, objc.id view) {
     NSRect cellRect = NSRect ();
     OS.memmove (&cellRect, cellFrame, NSRect.sizeof);
-
+    
     /*
      * Feature in Cocoa.  When the last column in a tree does not reach the
      * rightmost edge of the tree view, the cell that draws the rightmost-
@@ -244,10 +244,10 @@
     NSInteger columnIndex = outlineView.columnWithIdentifier (nsColumn);
     NSRect headerRect = parent.headerView.headerRectOfColumn (columnIndex);
     if (headerRect.x !is cellRect.x || headerRect.width !is cellRect.width) return;
-
+    
     NSGraphicsContext context = NSGraphicsContext.currentContext ();
     context.saveGraphicsState ();
-
+    
     int contentWidth = 0;
     NSSize stringSize, imageSize;
     NSAttributedString attrString = null;
@@ -269,7 +269,7 @@
         imageSize = image.handle.size ();
         contentWidth += Math.ceil (imageSize.width);
     }
-
+    
     if (parent.sortColumn is this && parent.sortDirection !is DWT.NONE) {
         bool ascending = parent.sortDirection is DWT.UP;
         headerCell.drawSortIndicatorWithFrame (cellRect, new NSView(view), ascending, 0);
@@ -277,7 +277,7 @@
         NSRect sortRect = headerCell.sortIndicatorRectForBounds (cellRect);
         cellRect.width = Math.max (0, sortRect.x - cellRect.x);
     }
-
+    
     int drawX = 0;
     if ((style & DWT.CENTER) !is 0) {
         drawX = cast(int)(cellRect.x + Math.max (MARGIN, ((cellRect.width - contentWidth) / 2)));
@@ -286,7 +286,7 @@
     } else {
         drawX = cast(int)cellRect.x + MARGIN;
     }
-
+    
     if (image !is null) {
         NSRect destRect = NSRect ();
         destRect.x = drawX;
@@ -308,7 +308,7 @@
         if (isFlipped) context.restoreGraphicsState ();
         drawX += destRect.width;
     }
-
+    
     if (displayText !is null && displayText.length () > 0) {
         if (image !is null) drawX += MARGIN; /* space between image and text */
         NSRect destRect = NSRect ();
@@ -319,7 +319,7 @@
         attrString.drawInRect (destRect);
         attrString.release ();
     }
-
+    
     context.restoreGraphicsState ();
 }
 
@@ -384,9 +384,9 @@
  */
 public bool getMoveable () {
     checkWidget ();
-//  int [] flags = new int [1];
-//  OS.GetDataBrowserPropertyFlags (parent.handle, id, flags);
-//  return (flags [0] & OS.kDataBrowserListViewMovableColumn) !is 0;
+    //  int [] flags = new int [1];
+    //  OS.GetDataBrowserPropertyFlags (parent.handle, id, flags);
+    //  return (flags [0] & OS.kDataBrowserListViewMovableColumn) !is 0;
     return false;
 }
 
@@ -453,9 +453,9 @@
  */
 public void pack () {
     checkWidget ();
-
+    
     int width = 0;
-
+    
     /* compute header width */
     if (displayText !is null) {
         NSMutableDictionary dict = NSMutableDictionary.dictionaryWithCapacity (4);
@@ -481,7 +481,7 @@
         NSRect sortRect = headerCell.sortIndicatorRectForBounds (rect);
         width += Math.ceil (sortRect.width);
     }
-
+    
     /* compute item widths down column */
     GC gc = new GC (parent);
     int index = parent.indexOf (this);
@@ -639,14 +639,14 @@
     if (moveable) {
         (cast(NSOutlineView)parent.view).setAllowsColumnReordering (true);
     }
-//  int [] flags = new int [1];
-//  OS.GetDataBrowserPropertyFlags (parent.handle, id, flags);
-//  if (moveable) {
-//      flags [0] |= OS.kDataBrowserListViewMovableColumn;
-//  } else {
-//      flags [0] &= ~OS.kDataBrowserListViewMovableColumn;
-//  }
-//  OS.SetDataBrowserPropertyFlags (parent.handle, id, flags [0]);
+    //  int [] flags = new int [1];
+    //  OS.GetDataBrowserPropertyFlags (parent.handle, id, flags);
+    //  if (moveable) {
+    //      flags [0] |= OS.kDataBrowserListViewMovableColumn;
+    //  } else {
+    //      flags [0] &= ~OS.kDataBrowserListViewMovableColumn;
+    //  }
+    //  OS.SetDataBrowserPropertyFlags (parent.handle, id, flags [0]);
 }
 
 /**
--- a/dwt/widgets/TreeItem.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/TreeItem.d	Thu Jan 15 23:08:54 2009 +0100
@@ -269,7 +269,7 @@
         rect.width = rect.height = Float.MAX_VALUE;
         NSSize size = cell.cellSizeForBounds (rect);
         width = cast(int)Math.ceil (size.width);
-
+        
         if (callMeasureItem && parent.hooks (DWT.MeasureItem)) {
             NSOutlineView outlineView = cast(NSOutlineView)parent.view;
             NSInteger nsColumnIndex = 0;
@@ -302,7 +302,7 @@
             width = event.width;
         }
     }
-
+    
     if (columnIndex is 0) {
         NSTableColumn column = parent.columnCount is 0 ? parent.firstColumn : parent.columns[0].nsColumn;
         NSOutlineView outlineView = cast(NSOutlineView)parent.view;
@@ -411,7 +411,7 @@
     if (font !is null) {
         dict.setObject(font.handle, OS.NSFontAttributeName);
     }
-
+    
     NSMutableParagraphStyle paragraphStyle = cast(NSMutableParagraphStyle)(new NSMutableParagraphStyle ()).alloc ().init ();
     paragraphStyle.autorelease ();
     paragraphStyle.setLineBreakMode (OS.NSLineBreakByClipping);
@@ -425,7 +425,7 @@
             paragraphStyle.setAlignment (OS.NSRightTextAlignment);
         }
     }
-
+    
     String text = getText (index);
     NSString str = NSString.stringWith(text);
     NSAttributedString attribStr = (cast(NSAttributedString) (new NSAttributedString ()).alloc ()).initWithString (str, dict);
@@ -521,7 +521,7 @@
     checkWidget ();
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
     if (!(0 <= index && index < Math.max (1, parent.columnCount))) return new Rectangle (0, 0, 0, 0);
-
+    
     NSOutlineView outlineView = cast(NSOutlineView) parent.view;
     if (parent.columnCount is 0) {
         index = (parent.style & DWT.CHECK) !is 0 ? 1 : 0;
@@ -722,7 +722,7 @@
     checkWidget ();
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
     if (!(0 <= index && index < Math.max (1, parent.columnCount))) return new Rectangle (0, 0, 0, 0);
-
+    
     NSOutlineView outlineView = cast(NSOutlineView) parent.view;
     Image image = index is 0 ? this.image : (images !is null) ? images [index] : null;
     if (parent.columnCount is 0) {
@@ -896,7 +896,7 @@
     checkWidget ();
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
     if (!(0 <= index && index < Math.max (1, parent.columnCount))) return new Rectangle (0, 0, 0, 0);
-
+    
     NSOutlineView outlineView = cast(NSOutlineView) parent.view;
     Image image = index is 0 ? this.image : (images !is null) ? images [index] : null;
     if (parent.columnCount is 0) {
@@ -993,12 +993,12 @@
  */
 public void removeAll () {
     checkWidget ();
-//  for (int i=itemCount - 1; i >= 0; i--) {
-//      TreeItem item = parent._getItem (childIds [i], false);
-//      if (item !is null && !item.isDisposed ()) {
-//          item.dispose ();
-//      }
-//  }
+    //  for (int i=itemCount - 1; i >= 0; i--) {
+    //      TreeItem item = parent._getItem (childIds [i], false);
+    //      if (item !is null && !item.isDisposed ()) {
+    //          item.dispose ();
+    //      }
+    //  }
 }
 
 /**
@@ -1067,7 +1067,7 @@
     cellBackground [index] = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true; 
-
+    
     NSOutlineView outlineView = cast(NSOutlineView) parent.view;
     if (parent.hooks (DWT.MeasureItem) || parent.hooks (DWT.EraseItem) || parent.hooks (DWT.PaintItem)) {
         outlineView.reloadItem (handle);
@@ -1126,12 +1126,12 @@
     }
     parent.ignoreExpand = false;
     cached = true;
-//  if (expanded) {
-//      parent.setScrollWidth (false, childIds, false);
-//  } else {
-//      parent.setScrollWidth (true);
-//      parent.fixScrollBar ();
-//  }
+    //  if (expanded) {
+    //      parent.setScrollWidth (false, childIds, false);
+    //  } else {
+    //      parent.setScrollWidth (true);
+    //      parent.fixScrollBar ();
+    //  }
 }
 
 /**
@@ -1199,7 +1199,7 @@
     cellFont [index] = font;
     if (oldFont !is null && oldFont.equals (font)) return;
     cached = true;
-
+    
     NSOutlineView outlineView = cast(NSOutlineView) parent.view;
     if (parent.hooks (DWT.MeasureItem) || parent.hooks (DWT.EraseItem) || parent.hooks (DWT.PaintItem)) {
         outlineView.reloadItem (handle);
@@ -1283,7 +1283,7 @@
     cellForeground [index] = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true;
-
+    
     NSOutlineView outlineView = cast(NSOutlineView) parent.view;
     if (parent.hooks (DWT.MeasureItem) || parent.hooks (DWT.EraseItem) || parent.hooks (DWT.PaintItem)) {
         outlineView.reloadItem (handle);
@@ -1364,9 +1364,9 @@
     if (image !is null && image.isDisposed ()) {
         error (DWT.ERROR_INVALID_ARGUMENT);
     }
-//  if (parent.imageBounds is null && image !is null) {
-//      parent.setItemHeight (image);
-//  }
+    //  if (parent.imageBounds is null && image !is null) {
+    //      parent.setItemHeight (image);
+    //  }
     if (index is 0)  {
         if (image !is null && image.type is DWT.ICON) {
             if (image.equals (this.image)) return;
@@ -1382,9 +1382,9 @@
         }
         images [index] = image; 
     }
-//  cached = true;
+    //  cached = true;
     if (index is 0) parent.setScrollWidth (this, false, true);
-
+    
     NSOutlineView outlineView = cast(NSOutlineView) parent.view;
     if (parent.hooks (DWT.MeasureItem) || parent.hooks (DWT.EraseItem) || parent.hooks (DWT.PaintItem)) {
         outlineView.reloadItem (handle);
@@ -1479,7 +1479,7 @@
     }
     cached = true;
     if (index is 0) parent.setScrollWidth (this, false, true);
-
+    
     NSOutlineView outlineView = cast(NSOutlineView) parent.view;
     if (parent.hooks (DWT.MeasureItem) || parent.hooks (DWT.EraseItem) || parent.hooks (DWT.PaintItem)) {
         outlineView.reloadItem (handle);
--- a/dwt/widgets/Widget.d	Wed Dec 31 21:01:13 2008 +0100
+++ b/dwt/widgets/Widget.d	Thu Jan 15 23:08:54 2009 +0100
@@ -453,9 +453,10 @@
 
 void copyToClipboard (char [] buffer) {
     if (buffer.length is 0) return;
+    wchar[] buf = buffer.toString16();
     NSPasteboard pasteboard = NSPasteboard.generalPasteboard ();
     pasteboard.declareTypes (NSArray.arrayWithObject (OS.NSStringPboardType), null);
-    pasteboard.setString (NSString.stringWithCharacters (buffer.toString16().ptr, buffer.length), OS.NSStringPboardType);
+    pasteboard.setString (NSString.stringWithCharacters (buf.ptr, buf.length), OS.NSStringPboardType);
 }
 
 void createHandle () {
@@ -885,7 +886,7 @@
 }
 
 objc.id numberOfRowsInTableView(objc.id id, objc.SEL sel, objc.id aTableView) {
-    return cast(objc.id )0;
+    return null;
 }
 
 objc.id outlineView_child_ofItem(objc.id id, objc.SEL sel, objc.id outlineView, objc.id index, objc.id item) {