comparison dwt/internal/cocoa/NSPanel.d @ 45:d8635bb48c7c

Merge with SWT 3.5
author Jacob Carlborg <doob@me.com>
date Mon, 01 Dec 2008 17:07:00 +0100
parents f565d3a95c0a
children
comparison
equal deleted inserted replaced
44:ca5e494f2bbf 45:d8635bb48c7c
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others. 2 * Copyright (c) 2000, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * 10 *
11 * Port to the D programming language: 11 * Port to the D programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com> 12 * Jacob Carlborg <doob@me.com>
13 *******************************************************************************/ 13 *******************************************************************************/
14 module dwt.internal.cocoa.NSPanel; 14 module dwt.internal.cocoa.NSPanel;
15 15
16 import dwt.dwthelper.utils;
17 import cocoa = dwt.internal.cocoa.id;
16 import dwt.internal.cocoa.NSWindow; 18 import dwt.internal.cocoa.NSWindow;
17 import dwt.internal.cocoa.OS; 19 import dwt.internal.cocoa.OS;
18 import objc = dwt.internal.objc.runtime; 20 import objc = dwt.internal.objc.runtime;
19 21
20 public class NSPanel : NSWindow 22 public class NSPanel : NSWindow {
21 {
22 23
23 public this () 24 public this() {
24 { 25 super();
25 super(); 26 }
26 }
27 27
28 public this (objc.id id) 28 public this(objc.id id) {
29 { 29 super(id);
30 super(id); 30 }
31 }
32 31
33 public bool becomesKeyOnlyIfNeeded () 32 public this(cocoa.id id) {
34 { 33 super(id);
35 return OS.objc_msgSend(this.id_, OS.sel_becomesKeyOnlyIfNeeded) !is null; 34 }
36 }
37 35
38 public bool isFloatingPanel () 36 public void setWorksWhenModal(bool flag) {
39 { 37 OS.objc_msgSend(this.id, OS.sel_setWorksWhenModal_, flag);
40 return OS.objc_msgSend(this.id_, OS.sel_isFloatingPanel) !is null; 38 }
41 }
42 39
43 public void setBecomesKeyOnlyIfNeeded (bool flag) 40 public bool worksWhenModal() {
44 { 41 return OS.objc_msgSend_bool(this.id, OS.sel_worksWhenModal);
45 OS.objc_msgSend(this.id_, OS.sel_setBecomesKeyOnlyIfNeeded_1, flag); 42 }
46 }
47
48 public void setFloatingPanel (bool flag)
49 {
50 OS.objc_msgSend(this.id_, OS.sel_setFloatingPanel_1, flag);
51 }
52
53 public void setWorksWhenModal (bool flag)
54 {
55 OS.objc_msgSend(this.id_, OS.sel_setWorksWhenModal_1, flag);
56 }
57
58 public bool worksWhenModal ()
59 {
60 return OS.objc_msgSend(this.id_, OS.sel_worksWhenModal) !is null;
61 }
62 43
63 } 44 }