Mercurial > projects > dwt-mac
comparison 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 |
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.NSColorPicker; | |
15 | |
16 import dwt.internal.cocoa.NSButtonCell; | |
17 import dwt.internal.cocoa.NSColorList; | |
18 import dwt.internal.cocoa.NSColorPanel; | |
19 import dwt.internal.cocoa.NSImage; | |
20 import dwt.internal.cocoa.NSInteger; | |
21 import dwt.internal.cocoa.NSObject; | |
22 import dwt.internal.cocoa.NSSize; | |
23 import dwt.internal.cocoa.NSString; | |
24 import dwt.internal.cocoa.OS; | |
25 import objc = dwt.internal.objc.runtime; | |
26 | |
27 public class NSColorPicker : NSObject | |
28 { | |
29 | |
30 public this () | |
31 { | |
32 super(); | |
33 } | |
34 | |
35 public this (objc.id id) | |
36 { | |
37 super(id); | |
38 } | |
39 | |
40 public void attachColorList (NSColorList colorList) | |
41 { | |
42 OS.objc_msgSend(this.id, OS.sel_attachColorList_1, colorList !is null ? colorList.id : null); | |
43 } | |
44 | |
45 public NSString buttonToolTip () | |
46 { | |
47 objc.id result = OS.objc_msgSend(this.id, OS.sel_buttonToolTip); | |
48 return result !is null ? new NSString(result) : null; | |
49 } | |
50 | |
51 public NSColorPanel colorPanel () | |
52 { | |
53 objc.id result = OS.objc_msgSend(this.id, OS.sel_colorPanel); | |
54 return result !is null ? new NSColorPanel(result) : null; | |
55 } | |
56 | |
57 public void detachColorList (NSColorList colorList) | |
58 { | |
59 OS.objc_msgSend(this.id, OS.sel_detachColorList_1, colorList !is null ? colorList.id : null); | |
60 } | |
61 | |
62 public NSColorPicker initWithPickerMask (NSUInteger mask, NSColorPanel owningColorPanel) | |
63 { | |
64 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithPickerMask_1colorPanel_1, mask, | |
65 owningColorPanel !is null ? owningColorPanel.id : null); | |
66 return result !is null ? this : null; | |
67 } | |
68 | |
69 public void insertNewButtonImage (NSImage newButtonImage, NSButtonCell buttonCell) | |
70 { | |
71 OS.objc_msgSend(this.id, OS.sel_insertNewButtonImage_1in_1, newButtonImage !is null ? newButtonImage.id : null, | |
72 buttonCell !is null ? buttonCell.id : null); | |
73 } | |
74 | |
75 public NSSize minContentSize () | |
76 { | |
77 NSSize result; | |
78 OS.objc_msgSend_stret(result, this.id, OS.sel_minContentSize); | |
79 return result; | |
80 } | |
81 | |
82 public NSImage provideNewButtonImage () | |
83 { | |
84 objc.id result = OS.objc_msgSend(this.id, OS.sel_provideNewButtonImage); | |
85 return result !is null ? new NSImage(result) : null; | |
86 } | |
87 | |
88 public void setMode (objc.id mode) | |
89 { | |
90 OS.objc_msgSend(this.id, OS.sel_setMode_1, mode); | |
91 } | |
92 | |
93 public void viewSizeChanged (id sender) | |
94 { | |
95 OS.objc_msgSend(this.id, OS.sel_viewSizeChanged_1, sender !is null ? sender.id : null); | |
96 } | |
97 | |
98 } |