diff dwt/internal/cocoa/NSColorPicker.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 8b48be5454ce
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwt/internal/cocoa/NSColorPicker.d	Sat Aug 09 17:00:02 2008 +0200
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ * Port to the D Programming language:
+ *     Jacob Carlborg <jacob.carlborg@gmail.com>
+ *******************************************************************************/
+module dwt.internal.cocoa.NSColorPicker;
+
+import dwt.internal.cocoa.NSButtonCell;
+import dwt.internal.cocoa.NSColorList;
+import dwt.internal.cocoa.NSColorPanel;
+import dwt.internal.cocoa.NSImage;
+import dwt.internal.cocoa.NSInteger;
+import dwt.internal.cocoa.NSObject;
+import dwt.internal.cocoa.NSSize;
+import dwt.internal.cocoa.NSString;
+import dwt.internal.cocoa.OS;
+import objc = dwt.internal.objc.runtime;
+
+public class NSColorPicker : NSObject
+{
+
+    public this ()
+    {
+        super();
+    }
+
+    public this (objc.id id)
+    {
+        super(id);
+    }
+
+    public void attachColorList (NSColorList colorList)
+    {
+        OS.objc_msgSend(this.id, OS.sel_attachColorList_1, colorList !is null ? colorList.id : null);
+    }
+
+    public NSString buttonToolTip ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_buttonToolTip);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSColorPanel colorPanel ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_colorPanel);
+        return result !is null ? new NSColorPanel(result) : null;
+    }
+
+    public void detachColorList (NSColorList colorList)
+    {
+        OS.objc_msgSend(this.id, OS.sel_detachColorList_1, colorList !is null ? colorList.id : null);
+    }
+
+    public NSColorPicker initWithPickerMask (NSUInteger mask, NSColorPanel owningColorPanel)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithPickerMask_1colorPanel_1, mask,
+                owningColorPanel !is null ? owningColorPanel.id : null);
+        return result !is null ? this : null;
+    }
+
+    public void insertNewButtonImage (NSImage newButtonImage, NSButtonCell buttonCell)
+    {
+        OS.objc_msgSend(this.id, OS.sel_insertNewButtonImage_1in_1, newButtonImage !is null ? newButtonImage.id : null,
+                buttonCell !is null ? buttonCell.id : null);
+    }
+
+    public NSSize minContentSize ()
+    {
+        NSSize result;
+        OS.objc_msgSend_stret(result, this.id, OS.sel_minContentSize);
+        return result;
+    }
+
+    public NSImage provideNewButtonImage ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_provideNewButtonImage);
+        return result !is null ? new NSImage(result) : null;
+    }
+
+    public void setMode (objc.id mode)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setMode_1, mode);
+    }
+
+    public void viewSizeChanged (id sender)
+    {
+        OS.objc_msgSend(this.id, OS.sel_viewSizeChanged_1, sender !is null ? sender.id : null);
+    }
+
+}