Mercurial > projects > dwt-mac
diff dwt/widgets/Shell.d @ 37:642f460a0908
Fixed a lot of compile errors, a "hello world" app compiles now
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Fri, 10 Oct 2008 12:29:48 +0200 |
parents | 453387bb0706 |
children | d8635bb48c7c |
line wrap: on
line diff
--- a/dwt/widgets/Shell.d Tue Oct 07 12:56:18 2008 +0200 +++ b/dwt/widgets/Shell.d Fri Oct 10 12:29:48 2008 +0200 @@ -276,7 +276,7 @@ * @see DWT#SYSTEM_MODAL */ public this (Display display, int style) { - this (display, null, style, 0, false); + this (display, null, style, null, false); } this (Display display, Shell parent, int style, objc.id handle, bool embedded) { @@ -378,7 +378,7 @@ * @see DWT#SYSTEM_MODAL */ public this (Shell parent, int style) { - this (parent !is null ? parent.display : null, parent, style, 0, false); + this (parent !is null ? parent.display : null, parent, style, null, false); } public static Shell internal_new (Display display, objc.id handle) { @@ -491,22 +491,22 @@ Rectangle clientArea = monitor.getClientArea (); rect.width = clientArea.width * 5 / 8; rect.height = clientArea.height * 5 / 8; - int styleMask = OS.NSBorderlessWindowMask; + NSUInteger styleMask = NSBorderlessWindowMask; if ((style & DWT.NO_TRIM) is 0) { styleMask = OS.NSTitledWindowMask; - if ((style & DWT.CLOSE) !is 0) styleMask |= OS.NSClosableWindowMask; - if ((style & DWT.MIN) !is 0) styleMask |= OS.NSMiniaturizableWindowMask; - if ((style & DWT.MAX) !is 0) styleMask |= OS.NSResizableWindowMask; - if ((style & DWT.RESIZE) !is 0) styleMask |= OS.NSResizableWindowMask; + if ((style & DWT.CLOSE) !is 0) styleMask |= NSClosableWindowMask; + if ((style & DWT.MIN) !is 0) styleMask |= NSMiniaturizableWindowMask; + if ((style & DWT.MAX) !is 0) styleMask |= NSResizableWindowMask; + if ((style & DWT.RESIZE) !is 0) styleMask |= NSResizableWindowMask; } - window = window.initWithContentRect_styleMask_backing_defer_(rect, styleMask, OS.NSBackingStoreBuffered, false); + window = window.initWithContentRect_styleMask_backing_defer_(rect, styleMask, NSBackingStoreBuffered, false); display.cascade = window.cascadeTopLeftFromPoint(display.cascade); if ((style & DWT.ON_TOP) !is 0) { window.setLevel(OS.NSFloatingWindowLevel); } } - createHandle (null); + (cast(Composite)this).createHandle (null); window.setContentView (topView()); windowDelegate = cast(SWTWindowDelegate)(new SWTWindowDelegate()).alloc().init(); @@ -555,19 +555,19 @@ Event event = new Event (); event.keyCode = DWT.CAPS_LOCK; // setInputState (event, DWT.KeyDown, chord, modifiers); - target.sendKeyEvent (DWT.KeyDown, event); + (cast(Widget)target).sendKeyEvent (DWT.KeyDown, event); } } Event event = new Event (); // setInputState (event, type, chord, modifiers); if (event.keyCode is 0 && event.character is 0) return; - bool result = sendKeyEvent (type, event); + bool result = (cast(Widget)this).sendKeyEvent (type, event); if (type is DWT.KeyDown && (modifiers & OS.NSAlphaShiftKeyMask) !is 0 && (lastModifiers & OS.NSAlphaShiftKeyMask) is 0) { if (target !is null) { event = new Event (); event.keyCode = DWT.CAPS_LOCK; // setInputState (event, DWT.KeyUp, chord, modifiers); - target.sendKeyEvent (DWT.KeyUp, event); + (cast(Widget)target).sendKeyEvent (DWT.KeyUp, event); } } display.lastModifiers = modifiers; @@ -621,7 +621,7 @@ NSSize size = NSSize(); size.width = width; size.height = height; - size = NSScrollView.contentSizeForFrameSize(size, (style & DWT.H_SCROLL) !is 0, (style & DWT.V_SCROLL) !is 0, OS.NSNoBorder); + size = NSScrollView.contentSizeForFrameSize(size, (style & DWT.H_SCROLL) !is 0, (style & DWT.V_SCROLL) !is 0, NSNoBorder); width = cast(int)size.width; height = cast(int)size.height; } @@ -1231,7 +1231,7 @@ public void setText (String str) { checkWidget(); - if (string is null) error (DWT.ERROR_NULL_ARGUMENT); + if (str is null) error (DWT.ERROR_NULL_ARGUMENT); super.setText (str); NSString nsStr = NSString.stringWith(str); window.setTitle(nsStr); @@ -1263,7 +1263,7 @@ resized = true; sendEvent (DWT.Resize); if (isDisposed ()) return; - if (layout !is null) { + if (layout_ !is null) { markLayout (false, false); updateLayout (false); } @@ -1301,7 +1301,7 @@ Shell activeShell = display.getActiveShell (); Shell current = this; while (current !is null) { - if (current.equals (activeShell)) { + if (current.opEquals (activeShell)) { isActive = true; break; } @@ -1338,7 +1338,7 @@ resized = true; sendEvent (DWT.Resize); if (isDisposed ()) return; - if (layout !is null) { + if (layout_ !is null) { markLayout (false, false); updateLayout (false); } @@ -1389,7 +1389,7 @@ if (!eventTarget.sendKeyEvent(nsEvent, type is OS.NSKeyDown ? DWT.KeyDown : DWT.KeyUp)) return; } } - super.windowSendEvent(id, event); + super.windowSendEvent(ID, event); } }