diff dwt/widgets/Tree.d @ 90:c7f7f4d7091a

All widgets are ported
author Jacob Carlborg <doob@me.com>
date Tue, 30 Dec 2008 18:54:31 +0100
parents 4e8317766ba0
children 63a09873578e
line wrap: on
line diff
--- a/dwt/widgets/Tree.d	Tue Dec 30 17:01:10 2008 +0100
+++ b/dwt/widgets/Tree.d	Tue Dec 30 18:54:31 2008 +0100
@@ -63,7 +63,7 @@
 import dwt.internal.cocoa.SWTTreeItem;
 import cocoa = dwt.internal.cocoa.id;
 
-import dwt.internal.c.Carbon;
+import Carbon = dwt.internal.c.Carbon;
 import dwt.internal.objc.cocoa.Cocoa;
 import objc = dwt.internal.objc.runtime;
 import dwt.widgets.Composite;
@@ -139,7 +139,7 @@
     TreeColumn sortColumn;
     int columnCount;
     int sortDirection;
-    CGFloat levelIndent;
+    Carbon.CGFloat levelIndent;
     bool ignoreExpand, ignoreSelect;
 
 /**
@@ -423,7 +423,7 @@
 //          GC gc = new GC (this);
 //          width = calculateWidth (childIds, gc, true, 0, levelIndent);
 //          gc.dispose ();
-//          width += getInsetWidth (column_id, true);
+//          width += getInsetWidth (columnid, true);
         }
         if ((style & DWT.CHECK) !is 0) width += getCheckColumnWidth ();
     } else {
@@ -930,11 +930,11 @@
         GC gc = GC.cocoa_new (this, data);
         gc.setFont (item.getFont (columnIndex));
         if (isSelected) {
-            CGFloat[] components = new CGFloat[nsSelectionForeground.numberOfComponents ()];
+            Carbon.CGFloat[] components = new Carbon.CGFloat[nsSelectionForeground.numberOfComponents ()];
             nsSelectionForeground.getComponents (components.ptr);   
             Color selectionForeground = Color.cocoa_new (display, components);
             gc.setForeground (selectionForeground);
-            components = new CGFloat[nsSelectionBackground.numberOfComponents ()];
+            components = new Carbon.CGFloat[nsSelectionBackground.numberOfComponents ()];
             nsSelectionBackground.getComponents (components.ptr);   
             Color selectionBackground = Color.cocoa_new (display, components);
             gc.setBackground (selectionBackground);
@@ -974,7 +974,7 @@
                 NSRect rowRect = outlineView.rectOfRow (rowIndex);
                 if ((style & DWT.CHECK) !is 0) {
                     /* highlighting at this stage draws over the checkbox, so don't include its column */
-                    CGFloat checkWidth = checkColumn.width ();
+                    Carbon.CGFloat checkWidth = checkColumn.width ();
                     selectionRect.x = checkWidth;
                     selectionRect.width = rowRect.width - checkWidth;
                 } else {
@@ -988,7 +988,7 @@
     if (drawBackground && !drawSelection) {
         NSGraphicsContext context = NSGraphicsContext.currentContext ();
         context.saveGraphicsState ();
-        CGFloat[] colorRGB = background.handle;
+        Carbon.CGFloat[] colorRGB = background.handle;
         NSColor color = NSColor.colorWithDeviceRed (colorRGB[0], colorRGB[1], colorRGB[2], 1f);
         color.setFill ();
         NSBezierPath.fillRect (fullRect);
@@ -1021,11 +1021,11 @@
         GC gc = GC.cocoa_new (this, data);
         gc.setFont (item.getFont (columnIndex));
         if (isSelected) {
-            CGFloat[] components = new CGFloat[nsSelectionForeground.numberOfComponents ()];
+            Carbon.CGFloat[] components = new Carbon.CGFloat[nsSelectionForeground.numberOfComponents ()];
             nsSelectionForeground.getComponents (components.ptr);   
             Color selectionForeground = Color.cocoa_new (display, components);
             gc.setForeground (selectionForeground);
-            components = new CGFloat[nsSelectionBackground.numberOfComponents ()];
+            components = new Carbon.CGFloat[nsSelectionBackground.numberOfComponents ()];
             nsSelectionBackground.getComponents (components.ptr);   
             Color selectionBackground = Color.cocoa_new (display, components);
             gc.setBackground (selectionBackground);
@@ -1560,7 +1560,7 @@
 //  for (int i=0; i<items.length; i++) {
 //      TreeItem item = items [i];
 //      if (item !is null) {
-//          int columnId = (columnCount is 0) ? column_id : columns [0].id;
+//          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;
 //          }
@@ -1748,7 +1748,7 @@
     NSOutlineView outlineView = cast(NSOutlineView)view;
     NSArray nsColumns = outlineView.tableColumns ();
     for (int i = startIndex; i <= endIndex; i++) {
-        id columnId = nsColumns.objectAtIndex (i);
+        cocoa.id columnId = nsColumns.objectAtIndex (i);
         TreeColumn column = getColumn (columnId);
         if (column !is null) {
             column.sendEvent (DWT.Move);
@@ -1799,7 +1799,7 @@
     if (row is -1)
         postEvent (DWT.Selection);
     else {
-        id _id = widget.itemAtRow (row);
+        cocoa.id _id = widget.itemAtRow (row);
         TreeItem item = cast(TreeItem) display.getWidget (_id.id);
         Event event = new Event ();
         event.item = item;
@@ -2054,7 +2054,7 @@
     return result;
 }
 
-void setBackground (CGFloat [] color) {
+void setBackground (Carbon.CGFloat [] color) {
     super.setBackground (color);
     NSColor nsColor;
     if (color is null) {