Mercurial > projects > dwt-mac
diff dwt/widgets/TreeColumn.d @ 123:63a09873578e
Fixed compile errors
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Thu, 15 Jan 2009 23:08:54 +0100 |
parents | c7f7f4d7091a |
children |
line wrap: on
line diff
--- 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]); } /**