Mercurial > projects > dwt-win
comparison dwt/widgets/TabItem.d @ 213:36f5cb12e1a2
Update to SWT 3.4M7
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 17 May 2008 17:34:28 +0200 |
parents | ab60f3309436 |
children | c84e3d3feb3f |
comparison
equal
deleted
inserted
replaced
212:ab60f3309436 | 213:36f5cb12e1a2 |
---|---|
13 module dwt.widgets.TabItem; | 13 module dwt.widgets.TabItem; |
14 | 14 |
15 import dwt.DWT; | 15 import dwt.DWT; |
16 import dwt.DWTException; | 16 import dwt.DWTException; |
17 import dwt.graphics.Image; | 17 import dwt.graphics.Image; |
18 import dwt.graphics.Rectangle; | |
18 import dwt.internal.win32.OS; | 19 import dwt.internal.win32.OS; |
19 | 20 |
20 import dwt.widgets.Item; | 21 import dwt.widgets.Item; |
21 import dwt.widgets.Widget; | 22 import dwt.widgets.Widget; |
22 import dwt.widgets.TabFolder; | 23 import dwt.widgets.TabFolder; |
175 checkWidget(); | 176 checkWidget(); |
176 return control; | 177 return control; |
177 } | 178 } |
178 | 179 |
179 /** | 180 /** |
181 * Returns a rectangle describing the receiver's size and location | |
182 * relative to its parent. | |
183 * | |
184 * @return the receiver's bounding rectangle | |
185 * | |
186 * @exception DWTException <ul> | |
187 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | |
188 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | |
189 * </ul> | |
190 * | |
191 * @since 3.4 | |
192 */ | |
193 public Rectangle getBounds() { | |
194 checkWidget(); | |
195 int index = parent.indexOf(this); | |
196 if (index is -1) return new Rectangle (0, 0, 0, 0); | |
197 RECT itemRect; | |
198 OS.SendMessage (parent.handle, OS.TCM_GETITEMRECT, index, &itemRect); | |
199 return new Rectangle(itemRect.left, itemRect.top, itemRect.right - itemRect.left, itemRect.bottom - itemRect.top); | |
200 } | |
201 | |
202 /** | |
180 * Returns the receiver's parent, which must be a <code>TabFolder</code>. | 203 * Returns the receiver's parent, which must be a <code>TabFolder</code>. |
181 * | 204 * |
182 * @return the receiver's parent | 205 * @return the receiver's parent |
183 * | 206 * |
184 * @exception DWTException <ul> | 207 * @exception DWTException <ul> |