Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSImageView.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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:380af2bdd8e5 |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2007 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * | |
11 * Port to the D Programming language: | |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | |
13 *******************************************************************************/ | |
14 module dwt.internal.cocoa.NSImageView; | |
15 | |
16 import dwt.internal.cocoa.NSControl; | |
17 import dwt.internal.cocoa.NSImage; | |
18 import dwt.internal.cocoa.OS; | |
19 import objc = dwt.internal.objc.runtime; | |
20 | |
21 public class NSImageView : NSControl | |
22 { | |
23 | |
24 public this () | |
25 { | |
26 super(); | |
27 } | |
28 | |
29 public this (objc.id id) | |
30 { | |
31 super(id); | |
32 } | |
33 | |
34 public bool allowsCutCopyPaste () | |
35 { | |
36 return OS.objc_msgSend(this.id, OS.sel_allowsCutCopyPaste) !is null; | |
37 } | |
38 | |
39 public bool animates () | |
40 { | |
41 return OS.objc_msgSend(this.id, OS.sel_animates) !is null; | |
42 } | |
43 | |
44 public NSImage image () | |
45 { | |
46 objc.id result = OS.objc_msgSend(this.id, OS.sel_image); | |
47 return result !is null ? new NSImage(result) : null; | |
48 } | |
49 | |
50 public NSImageAlignment imageAlignment () | |
51 { | |
52 return OS.objc_msgSend(this.id, OS.sel_imageAlignment); | |
53 } | |
54 | |
55 public NSImageFrameStyle imageFrameStyle () | |
56 { | |
57 return OS.objc_msgSend(this.id, OS.sel_imageFrameStyle); | |
58 } | |
59 | |
60 public NSImageScaling imageScaling () | |
61 { | |
62 return OS.objc_msgSend(this.id, OS.sel_imageScaling); | |
63 } | |
64 | |
65 public bool isEditable () | |
66 { | |
67 return OS.objc_msgSend(this.id, OS.sel_isEditable) !is null; | |
68 } | |
69 | |
70 public void setAllowsCutCopyPaste (bool allow) | |
71 { | |
72 OS.objc_msgSend(this.id, OS.sel_setAllowsCutCopyPaste_1, allow); | |
73 } | |
74 | |
75 public void setAnimates (bool flag) | |
76 { | |
77 OS.objc_msgSend(this.id, OS.sel_setAnimates_1, flag); | |
78 } | |
79 | |
80 public void setEditable (bool yn) | |
81 { | |
82 OS.objc_msgSend(this.id, OS.sel_setEditable_1, yn); | |
83 } | |
84 | |
85 public void setImage (NSImage newImage) | |
86 { | |
87 OS.objc_msgSend(this.id, OS.sel_setImage_1, newImage !is null ? newImage.id : null); | |
88 } | |
89 | |
90 public void setImageAlignment (NSImageAlignment newAlign) | |
91 { | |
92 OS.objc_msgSend(this.id, OS.sel_setImageAlignment_1, newAlign); | |
93 } | |
94 | |
95 public void setImageFrameStyle (NSImageFrameStyle newStyle) | |
96 { | |
97 OS.objc_msgSend(this.id, OS.sel_setImageFrameStyle_1, newStyle); | |
98 } | |
99 | |
100 public void setImageScaling (NSImageScaling newScaling) | |
101 { | |
102 OS.objc_msgSend(this.id, OS.sel_setImageScaling_1, newScaling); | |
103 } | |
104 | |
105 } |