diff 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
line wrap: on
line diff
--- a/dwt/widgets/TabItem.d	Mon May 05 00:12:38 2008 +0200
+++ b/dwt/widgets/TabItem.d	Sat May 17 17:34:28 2008 +0200
@@ -15,6 +15,7 @@
 import dwt.DWT;
 import dwt.DWTException;
 import dwt.graphics.Image;
+import dwt.graphics.Rectangle;
 import dwt.internal.win32.OS;
 
 import dwt.widgets.Item;
@@ -177,6 +178,28 @@
 }
 
 /**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent.
+ *
+ * @return the receiver's bounding rectangle
+ *
+ * @exception DWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public Rectangle getBounds() {
+    checkWidget();
+    int index = parent.indexOf(this);
+    if (index is -1) return new Rectangle (0, 0, 0, 0);
+    RECT itemRect;
+    OS.SendMessage (parent.handle, OS.TCM_GETITEMRECT, index, &itemRect);
+    return new Rectangle(itemRect.left, itemRect.top, itemRect.right - itemRect.left, itemRect.bottom - itemRect.top);
+}
+
+/**
  * Returns the receiver's parent, which must be a <code>TabFolder</code>.
  *
  * @return the receiver's parent