Mercurial > projects > dwt-mac
diff dwt/widgets/Tracker.d @ 90:c7f7f4d7091a
All widgets are ported
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Tue, 30 Dec 2008 18:54:31 +0100 |
parents | 102ff2adce19 |
children | 63a09873578e |
line wrap: on
line diff
--- a/dwt/widgets/Tracker.d Tue Dec 30 17:01:10 2008 +0100 +++ b/dwt/widgets/Tracker.d Tue Dec 30 18:54:31 2008 +0100 @@ -37,7 +37,7 @@ import dwt.internal.cocoa.NSWindow; import dwt.internal.cocoa.OS; -import dwt.internal.c.Carbon; +import Carbon = dwt.internal.c.Carbon; import dwt.internal.objc.cocoa.Cocoa; import dwt.widgets.Composite; import dwt.widgets.Control; @@ -86,12 +86,6 @@ const static int STEPSIZE_SMALL = 1; const static int STEPSIZE_LARGE = 9; - static this () - { - rectangles = new Rectangle [0]; - proportions = rectangles; - } - /** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. @@ -125,6 +119,9 @@ * @see Widget#getStyle */ public this (Composite parent, int style) { + rectangles = new Rectangle [0]; + proportions = rectangles; + super (parent, checkStyle (style)); this.parent = parent; } @@ -164,6 +161,9 @@ * @see DWT#DOWN */ public this (Display display, int style) { + rectangles = new Rectangle [0]; + proportions = rectangles; + if (display is null) display = Display.getCurrent (); if (display is null) display = Display.getDefault (); if (!display.isValidThread ()) { @@ -742,14 +742,14 @@ tracking = true; window = cast(NSWindow)(new NSWindow()).alloc(); NSArray screens = NSScreen.screens(); - CGFloat minX = Float.MAX_VALUE, maxX = Float.MIN_VALUE; - CGFloat minY = Float.MAX_VALUE, maxY = Float.MIN_VALUE; + Carbon.CGFloat minX = Float.MAX_VALUE, maxX = Float.MIN_VALUE; + Carbon.CGFloat minY = Float.MAX_VALUE, maxY = Float.MIN_VALUE; int count = cast(int)/*64*/screens.count(); for (int i = 0; i < count; i++) { NSScreen screen = new NSScreen(screens.objectAtIndex(i)); NSRect frame = screen.frame(); - CGFloat x1 = frame.x, x2 = frame.x + frame.width; - CGFloat y1 = frame.y, y2 = frame.y + frame.height; + Carbon.CGFloat x1 = frame.x, x2 = frame.x + frame.width; + Carbon.CGFloat y1 = frame.y, y2 = frame.y + frame.height; if (x1 < minX) minX = x1; if (x2 < minX) minX = x2; if (x1 > maxX) maxX = x1;