Mercurial > projects > dstep
comparison dstep/appkit/NSMenuItemCell.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | |
children | b9de51448c6b |
comparison
equal
deleted
inserted
replaced
15:7ff919f595d5 | 16:19885b43130e |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Sep 24, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.appkit.NSMenuItemCell; | |
8 | |
9 import dstep.appkit.NSButtonCell; | |
10 import dstep.appkit.NSMenu; | |
11 import dstep.appkit.NSMenuItem; | |
12 import dstep.appkit.NSMenuView; | |
13 import dstep.appkit.NSView; | |
14 import dstep.applicationservices.coregraphics.CGBase; | |
15 import dstep.foundation.NSGeometry; | |
16 import dstep.foundation.NSObjCRuntime; | |
17 import dstep.objc.bridge.Bridge; | |
18 import dstep.objc.objc; | |
19 | |
20 class NSMenuItemCell : NSButtonCell | |
21 { | |
22 mixin (ObjcWrap); | |
23 | |
24 void setMenuItem (NSMenuItem item) | |
25 { | |
26 return invokeObjcSelf!(void, "setMenuItem:", NSMenuItem)(item); | |
27 } | |
28 | |
29 NSMenuItem menuItem () | |
30 { | |
31 return invokeObjcSelf!(NSMenuItem, "menuItem"); | |
32 } | |
33 | |
34 void setNeedsSizing (bool flag) | |
35 { | |
36 return invokeObjcSelf!(void, "setNeedsSizing:", bool)(flag); | |
37 } | |
38 | |
39 bool needsSizing () | |
40 { | |
41 return invokeObjcSelf!(bool, "needsSizing"); | |
42 } | |
43 | |
44 void calcSize () | |
45 { | |
46 return invokeObjcSelf!(void, "calcSize"); | |
47 } | |
48 | |
49 void setNeedsDisplay (bool flag) | |
50 { | |
51 return invokeObjcSelf!(void, "setNeedsDisplay:", bool)(flag); | |
52 } | |
53 | |
54 bool needsDisplay () | |
55 { | |
56 return invokeObjcSelf!(bool, "needsDisplay"); | |
57 } | |
58 | |
59 CGFloat stateImageWidth () | |
60 { | |
61 return invokeObjcSelf!(CGFloat, "stateImageWidth"); | |
62 } | |
63 | |
64 CGFloat imageWidth () | |
65 { | |
66 return invokeObjcSelf!(CGFloat, "imageWidth"); | |
67 } | |
68 | |
69 CGFloat titleWidth () | |
70 { | |
71 return invokeObjcSelf!(CGFloat, "titleWidth"); | |
72 } | |
73 | |
74 CGFloat keyEquivalentWidth () | |
75 { | |
76 return invokeObjcSelf!(CGFloat, "keyEquivalentWidth"); | |
77 } | |
78 | |
79 NSRect stateImageRectForBounds (NSRect cellFrame) | |
80 { | |
81 return invokeObjcSelf!(NSRect, "stateImageRectForBounds:", NSRect)(cellFrame); | |
82 } | |
83 | |
84 NSRect titleRectForBounds (NSRect cellFrame) | |
85 { | |
86 return invokeObjcSelf!(NSRect, "titleRectForBounds:", NSRect)(cellFrame); | |
87 } | |
88 | |
89 NSRect keyEquivalentRectForBounds (NSRect cellFrame) | |
90 { | |
91 return invokeObjcSelf!(NSRect, "keyEquivalentRectForBounds:", NSRect)(cellFrame); | |
92 } | |
93 | |
94 void drawSeparatorItemWithFrame (NSRect cellFrame, NSView controlView) | |
95 { | |
96 return invokeObjcSelf!(void, "drawSeparatorItemWithFrame:inView:", NSRect, NSView)(cellFrame, controlView); | |
97 } | |
98 | |
99 void drawStateImageWithFrame (NSRect cellFrame, NSView controlView) | |
100 { | |
101 return invokeObjcSelf!(void, "drawStateImageWithFrame:inView:", NSRect, NSView)(cellFrame, controlView); | |
102 } | |
103 | |
104 void drawImageWithFrame (NSRect cellFrame, NSView controlView) | |
105 { | |
106 return invokeObjcSelf!(void, "drawImageWithFrame:inView:", NSRect, NSView)(cellFrame, controlView); | |
107 } | |
108 | |
109 void drawTitleWithFrame (NSRect cellFrame, NSView controlView) | |
110 { | |
111 return invokeObjcSelf!(void, "drawTitleWithFrame:inView:", NSRect, NSView)(cellFrame, controlView); | |
112 } | |
113 | |
114 void drawKeyEquivalentWithFrame (NSRect cellFrame, NSView controlView) | |
115 { | |
116 return invokeObjcSelf!(void, "drawKeyEquivalentWithFrame:inView:", NSRect, NSView)(cellFrame, controlView); | |
117 } | |
118 | |
119 void drawBorderAndBackgroundWithFrame (NSRect cellFrame, NSView controlView) | |
120 { | |
121 return invokeObjcSelf!(void, "drawBorderAndBackgroundWithFrame:inView:", NSRect, NSView)(cellFrame, controlView); | |
122 } | |
123 | |
124 NSInteger tag () | |
125 { | |
126 return invokeObjcSelf!(NSInteger, "tag"); | |
127 } | |
128 } | |
129 |