comparison dwt/internal/cocoa/NSSlider.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.NSSlider;
15
16 import dwt.internal.cocoa.CGFloat;
17 import dwt.internal.cocoa.id;
18 import dwt.internal.cocoa.NSCell;
19 import dwt.internal.cocoa.NSColor;
20 import dwt.internal.cocoa.NSControl;
21 import dwt.internal.cocoa.NSEvent;
22 import dwt.internal.cocoa.NSFont;
23 import dwt.internal.cocoa.NSImage;
24 import dwt.internal.cocoa.NSInteger;
25 import dwt.internal.cocoa.NSPoint;
26 import dwt.internal.cocoa.NSRect;
27 import dwt.internal.cocoa.NSSliderCell : NSTickMarkPosition;
28 import dwt.internal.cocoa.NSString;
29 import dwt.internal.cocoa.OS;
30 import objc = dwt.internal.objc.runtime;
31
32 public class NSSlider : NSControl
33 {
34
35 public this ()
36 {
37 super();
38 }
39
40 public this (objc.id id)
41 {
42 super(id);
43 }
44
45 public bool acceptsFirstMouse (NSEvent theEvent)
46 {
47 return OS.objc_msgSend(this.id, OS.sel_acceptsFirstMouse_1, theEvent !is null ? theEvent.id : null) !is null;
48 }
49
50 public bool allowsTickMarkValuesOnly ()
51 {
52 return OS.objc_msgSend(this.id, OS.sel_allowsTickMarkValuesOnly) !is null;
53 }
54
55 public double altIncrementValue ()
56 {
57 return cast(double) OS.objc_msgSend_fpret(this.id, OS.sel_altIncrementValue);
58 }
59
60 public double closestTickMarkValueToValue (double value)
61 {
62 return cast(double) OS.objc_msgSend_fpret(this.id, OS.sel_closestTickMarkValueToValue_1, value);
63 }
64
65 public NSImage image ()
66 {
67 objc.id result = OS.objc_msgSend(this.id, OS.sel_image);
68 return result !is null ? new NSImage(result) : null;
69 }
70
71 public NSInteger indexOfTickMarkAtPoint (NSPoint point)
72 {
73 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_indexOfTickMarkAtPoint_1, point);
74 }
75
76 public NSInteger isVertical ()
77 {
78 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_isVertical);
79 }
80
81 public CGFloat knobThickness ()
82 {
83 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_knobThickness);
84 }
85
86 public double maxValue ()
87 {
88 return cast(double) OS.objc_msgSend_fpret(this.id, OS.sel_maxValue);
89 }
90
91 public double minValue ()
92 {
93 return cast(double) OS.objc_msgSend_fpret(this.id, OS.sel_minValue);
94 }
95
96 public NSInteger numberOfTickMarks ()
97 {
98 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_numberOfTickMarks);
99 }
100
101 public NSRect rectOfTickMarkAtIndex (NSInteger index)
102 {
103 NSRect result;
104 OS.objc_msgSend_stret(result, this.id, OS.sel_rectOfTickMarkAtIndex_1, index);
105 return result;
106 }
107
108 public void setAllowsTickMarkValuesOnly (bool yorn)
109 {
110 OS.objc_msgSend(this.id, OS.sel_setAllowsTickMarkValuesOnly_1, yorn);
111 }
112
113 public void setAltIncrementValue (double incValue)
114 {
115 OS.objc_msgSend(this.id, OS.sel_setAltIncrementValue_1, incValue);
116 }
117
118 public void setImage (NSImage backgroundImage)
119 {
120 OS.objc_msgSend(this.id, OS.sel_setImage_1, backgroundImage !is null ? backgroundImage.id : null);
121 }
122
123 public void setKnobThickness (CGFloat aFloat)
124 {
125 OS.objc_msgSend(this.id, OS.sel_setKnobThickness_1, aFloat);
126 }
127
128 public void setMaxValue (double aDouble)
129 {
130 OS.objc_msgSend(this.id, OS.sel_setMaxValue_1, aDouble);
131 }
132
133 public void setMinValue (double aDouble)
134 {
135 OS.objc_msgSend(this.id, OS.sel_setMinValue_1, aDouble);
136 }
137
138 public void setNumberOfTickMarks (NSInteger count)
139 {
140 OS.objc_msgSend(this.id, OS.sel_setNumberOfTickMarks_1, count);
141 }
142
143 public void setTickMarkPosition (NSTickMarkPosition position)
144 {
145 OS.objc_msgSend(this.id, OS.sel_setTickMarkPosition_1, position);
146 }
147
148 public void setTitle (NSString aString)
149 {
150 OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString !is null ? aString.id : null);
151 }
152
153 public void setTitleCell (NSCell aCell)
154 {
155 OS.objc_msgSend(this.id, OS.sel_setTitleCell_1, aCell !is null ? aCell.id : null);
156 }
157
158 public void setTitleColor (NSColor newColor)
159 {
160 OS.objc_msgSend(this.id, OS.sel_setTitleColor_1, newColor !is null ? newColor.id : null);
161 }
162
163 public void setTitleFont (NSFont fontObj)
164 {
165 OS.objc_msgSend(this.id, OS.sel_setTitleFont_1, fontObj !is null ? fontObj.id : null);
166 }
167
168 public NSTickMarkPosition tickMarkPosition ()
169 {
170 return cast(NSTickMarkPosition) OS.objc_msgSend(this.id, OS.sel_tickMarkPosition);
171 }
172
173 public double tickMarkValueAtIndex (NSInteger index)
174 {
175 return cast(double) OS.objc_msgSend_fpret(this.id, OS.sel_tickMarkValueAtIndex_1, index);
176 }
177
178 public NSString title ()
179 {
180 objc.id result = OS.objc_msgSend(this.id, OS.sel_title);
181 return result !is null ? new NSString(result) : null;
182 }
183
184 public id titleCell ()
185 {
186 objc.id result = OS.objc_msgSend(this.id, OS.sel_titleCell);
187 return result !is null ? new id(result) : null;
188 }
189
190 public NSColor titleColor ()
191 {
192 objc.id result = OS.objc_msgSend(this.id, OS.sel_titleColor);
193 return result !is null ? new NSColor(result) : null;
194 }
195
196 public NSFont titleFont ()
197 {
198 objc.id result = OS.objc_msgSend(this.id, OS.sel_titleFont);
199 return result !is null ? new NSFont(result) : null;
200 }
201
202 }