Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSStepper.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.NSStepper; | 14 module dwt.internal.cocoa.NSStepper; |
15 | 15 |
16 import dwt.dwthelper.utils; | |
17 import cocoa = dwt.internal.cocoa.id; | |
16 import dwt.internal.cocoa.NSControl; | 18 import dwt.internal.cocoa.NSControl; |
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 NSStepper : NSControl | 22 public class NSStepper : NSControl { |
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 autorepeat () | 32 public this(cocoa.id id) { |
34 { | 33 super(id); |
35 return OS.objc_msgSend(this.id_, OS.sel_autorepeat) !is null; | 34 } |
36 } | |
37 | 35 |
38 public double increment () | 36 public double increment() { |
39 { | 37 return OS.objc_msgSend_fpret(this.id, OS.sel_increment); |
40 return OS.objc_msgSend_fpret(this.id_, OS.sel_increment); | 38 } |
41 } | |
42 | 39 |
43 public double maxValue () | 40 public double maxValue() { |
44 { | 41 return OS.objc_msgSend_fpret(this.id, OS.sel_maxValue); |
45 return OS.objc_msgSend_fpret(this.id_, OS.sel_maxValue); | 42 } |
46 } | |
47 | 43 |
48 public double minValue () | 44 public double minValue() { |
49 { | 45 return OS.objc_msgSend_fpret(this.id, OS.sel_minValue); |
50 return OS.objc_msgSend_fpret(this.id_, OS.sel_minValue); | 46 } |
51 } | |
52 | 47 |
53 public void setAutorepeat (bool autorepeat) | 48 public void setIncrement(double increment) { |
54 { | 49 OS.objc_msgSend(this.id, OS.sel_setIncrement_, increment); |
55 OS.objc_msgSend(this.id_, OS.sel_setAutorepeat_1, autorepeat); | 50 } |
56 } | |
57 | 51 |
58 public void setIncrement (double increment) | 52 public void setMaxValue(double maxValue) { |
59 { | 53 OS.objc_msgSend(this.id, OS.sel_setMaxValue_, maxValue); |
60 OS.objc_msgSend(this.id_, OS.sel_setIncrement_1, increment); | 54 } |
61 } | |
62 | 55 |
63 public void setMaxValue (double maxValue) | 56 public void setMinValue(double minValue) { |
64 { | 57 OS.objc_msgSend(this.id, OS.sel_setMinValue_, minValue); |
65 OS.objc_msgSend(this.id_, OS.sel_setMaxValue_1, maxValue); | 58 } |
66 } | |
67 | 59 |
68 public void setMinValue (double minValue) | 60 public void setValueWraps(bool valueWraps) { |
69 { | 61 OS.objc_msgSend(this.id, OS.sel_setValueWraps_, valueWraps); |
70 OS.objc_msgSend(this.id_, OS.sel_setMinValue_1, minValue); | 62 } |
71 } | |
72 | 63 |
73 public void setValueWraps (bool valueWraps) | 64 public static objc.Class cellClass() { |
74 { | 65 return cast(objc.Class) OS.objc_msgSend(OS.class_NSStepper, OS.sel_cellClass); |
75 OS.objc_msgSend(this.id_, OS.sel_setValueWraps_1, valueWraps); | 66 } |
76 } | |
77 | 67 |
78 public bool valueWraps () | 68 public static void setCellClass(objc.Class factoryId) { |
79 { | 69 OS.objc_msgSend(OS.class_NSStepper, OS.sel_setCellClass_, factoryId); |
80 return OS.objc_msgSend(this.id_, OS.sel_valueWraps) !is null; | 70 } |
81 } | |
82 | 71 |
83 } | 72 } |