Mercurial > projects > dwt-mac
diff dwt/widgets/ColorDialog.d @ 45:d8635bb48c7c
Merge with SWT 3.5
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 01 Dec 2008 17:07:00 +0100 |
parents | 642f460a0908 |
children | 6914d8d302de |
line wrap: on
line diff
--- a/dwt/widgets/ColorDialog.d Tue Oct 21 15:20:04 2008 +0200 +++ b/dwt/widgets/ColorDialog.d Mon Dec 01 17:07:00 2008 +0100 @@ -1,5 +1,5 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -9,7 +9,7 @@ * IBM Corporation - initial API and implementation * * Port to the D programming language: - * Jacob Carlborg <jacob.carlborg@gmail.com> + * Jacob Carlborg <doob@me.com> *******************************************************************************/ module dwt.widgets.ColorDialog; @@ -21,7 +21,6 @@ import dwt.internal.cocoa.NSApplication; import dwt.internal.cocoa.NSColor; import dwt.internal.cocoa.NSColorPanel; -import dwt.internal.cocoa.NSString; import dwt.internal.cocoa.OS; import dwt.internal.cocoa.SWTPanelDelegate; @@ -44,6 +43,9 @@ * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the DWT implementation. * </p> + * + * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample, Dialog tab</a> + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ public class ColorDialog : Dialog { RGB rgb; @@ -98,11 +100,11 @@ * @see Widget#getStyle */ public this(Shell parent, int style) { - super(parent, style); + super (parent, checkStyle (parent, style)); checkSubclass (); } - void changeColor(int sender) { +void changeColor(objc.id id, objc.SEL sel, objc.id sender) { //TODO } @@ -139,17 +141,17 @@ SWTPanelDelegate delegate_ = cast(SWTPanelDelegate)(new SWTPanelDelegate()).alloc().init(); NSInteger jniRef = OS.NewGlobalRef(this); if (jniRef is 0) DWT.error(DWT.ERROR_NO_HANDLES); - delegate_.setTag(jniRef); + OS.object_setInstanceVariable(delegate_.id_, Display.DWT_OBJECT, jniRef); panel.setDelegate(delegate_); rgb = null; panel.orderFront(null); - NSApplication.sharedApplication().runModalForWindow_(panel); + NSApplication.sharedApplication().runModalForWindow(panel); panel.setDelegate(null); delegate_.release(); OS.DeleteGlobalRef(jniRef); NSColor color = panel.color(); if (color !is null) { - color = color.colorUsingColorSpaceName_(NSString.stringWith("NSCalibratedRGBColorSpace")); + color = color.colorUsingColorSpaceName(OS.NSCalibratedRGBColorSpace); rgb = new RGB(cast(int)(color.redComponent() * 255), cast(int)(color.greenComponent() * 255), cast(int)(color.blueComponent() * 255)); } return rgb; @@ -167,7 +169,7 @@ this.rgb = rgb; } - void windowWillClose(int sender) { +void windowWillClose(objc.id id, objc.SEL sel, objc.id sender) { NSApplication.sharedApplication().stop(null); } }