Mercurial > projects > dwt-mac
view dwt/internal/cocoa/NSSavePanel.d @ 139:86fc761a24ae
Fixes #11
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Thu, 04 Jun 2009 23:23:10 +0200 |
parents | d8635bb48c7c |
children |
line wrap: on
line source
/******************************************************************************* * 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 * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * * Port to the D programming language: * Jacob Carlborg <doob@me.com> *******************************************************************************/ module dwt.internal.cocoa.NSSavePanel; import dwt.dwthelper.utils; import cocoa = dwt.internal.cocoa.id; import dwt.internal.cocoa.NSPanel; import dwt.internal.cocoa.NSString; import dwt.internal.cocoa.OS; import dwt.internal.objc.cocoa.Cocoa; import objc = dwt.internal.objc.runtime; public class NSSavePanel : NSPanel { public this() { super(); } public this(objc.id id) { super(id); } public this(cocoa.id id) { super(id); } public NSString filename() { objc.id result = OS.objc_msgSend(this.id, OS.sel_filename); return result !is null ? new NSString(result) : null; } public NSInteger runModal() { return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_runModal); } public static NSSavePanel savePanel() { objc.id result = OS.objc_msgSend(OS.class_NSSavePanel, OS.sel_savePanel); return result !is null ? new NSSavePanel(result) : null; } public void setDirectory(NSString path) { OS.objc_msgSend(this.id, OS.sel_setDirectory_, path !is null ? path.id : null); } public void setTitle(NSString title) { OS.objc_msgSend(this.id, OS.sel_setTitle_, title !is null ? title.id : null); } }