diff dwt/internal/cocoa/NSSplitView.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/NSSplitView.d	Sat Aug 09 17:00:02 2008 +0200
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * 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.NSSplitView;
+
+import dwt.internal.cocoa.CGFloat;
+import dwt.internal.cocoa.id;
+import dwt.internal.cocoa.NSColor;
+import dwt.internal.cocoa.NSInteger;
+import dwt.internal.cocoa.NSRect;
+import dwt.internal.cocoa.NSString;
+import dwt.internal.cocoa.NSView;
+import dwt.internal.cocoa.OS;
+import objc = dwt.internal.objc.runtime;
+
+
+
+enum NSSplitViewDividerStyle : NSInteger
+{
+    NSSplitViewDividerStyleThick = 1,
+    NSSplitViewDividerStyleThin
+}
+
+alias NSSplitViewDividerStyle.NSSplitViewDividerStyleThick NSSplitViewDividerStyleThick;
+alias NSSplitViewDividerStyle.NSSplitViewDividerStyleThin NSSplitViewDividerStyleThin;
+
+
+
+public class NSSplitView : NSView
+{
+
+    public this ()
+    {
+        super();
+    }
+
+    public this (objc.id id)
+    {
+        super(id);
+    }
+
+    public void adjustSubviews ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_adjustSubviews);
+    }
+
+    public NSString autosaveName ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_autosaveName);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public id delegatee ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate);
+        return result !is null ? new id(result) : null;
+    }
+
+    public NSColor dividerColor ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_dividerColor);
+        return result !is null ? new NSColor(result) : null;
+    }
+
+    public NSSplitViewDividerStyle dividerStyle ()
+    {
+        return cast(NSSplitViewDividerStyle) OS.objc_msgSend(this.id, OS.sel_dividerStyle);
+    }
+
+    public CGFloat dividerThickness ()
+    {
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_dividerThickness);
+    }
+
+    public void drawDividerInRect (NSRect rect)
+    {
+        OS.objc_msgSend(this.id, OS.sel_drawDividerInRect_1, rect);
+    }
+
+    public bool isPaneSplitter ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_isPaneSplitter) !is null;
+    }
+
+    public bool isSubviewCollapsed (NSView subview)
+    {
+        return OS.objc_msgSend(this.id, OS.sel_isSubviewCollapsed_1, subview !is null ? subview.id : null) !is null;
+    }
+
+    public bool isVertical ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_isVertical) !is null;
+    }
+
+    public CGFloat maxPossiblePositionOfDividerAtIndex (NSInteger dividerIndex)
+    {
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_maxPossiblePositionOfDividerAtIndex_1, dividerIndex);
+    }
+
+    public CGFloat minPossiblePositionOfDividerAtIndex (NSInteger dividerIndex)
+    {
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_minPossiblePositionOfDividerAtIndex_1, dividerIndex);
+    }
+
+    public void setAutosaveName (NSString autosaveName)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setAutosaveName_1, autosaveName !is null ? autosaveName.id : null);
+    }
+
+    public void setDelegate (id delegatee)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegatee !is null ? delegatee.id : null);
+    }
+
+    public void setDividerStyle (NSSplitViewDividerStyle dividerStyle)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setDividerStyle_1, dividerStyle);
+    }
+
+    public void setIsPaneSplitter (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setIsPaneSplitter_1, flag);
+    }
+
+    public void setPosition (CGFloat position, NSInteger dividerIndex)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setPosition_1ofDividerAtIndex_1, position, dividerIndex);
+    }
+
+    public void setVertical (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setVertical_1, flag);
+    }
+
+}