summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt
diff options
context:
space:
mode:
authorDuong Nguyen <dnguyen>2008-03-18 22:52:20 +0000
committerDuong Nguyen <dnguyen>2008-03-18 22:52:20 +0000
commit5a348eaf1a48b78f8ffb59f5a168085e113129f8 (patch)
tree8dd30ba16cecf157fdbf550798f8c32267d05acc /bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt
parented608f01474d2ac31a460b1090e172e3eba04396 (diff)
downloadeclipse.platform.swt-5a348eaf1a48b78f8ffb59f5a168085e113129f8.tar.gz
eclipse.platform.swt-5a348eaf1a48b78f8ffb59f5a168085e113129f8.tar.xz
eclipse.platform.swt-5a348eaf1a48b78f8ffb59f5a168085e113129f8.zip
Bug 222120 - DND - how to detect which tab item is involved in a DropTargetEvent
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/TabItem.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/TabItem.java b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/TabItem.java
index dca8e1e6d7..7999f265a1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/TabItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/TabItem.java
@@ -156,6 +156,32 @@ void destroyWidget () {
}
/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent.
+ *
+ * @return the receiver's bounding rectangle
+ *
+ * @exception SWTException <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>
+ */
+public Rectangle getBounds () {
+ checkWidget ();
+ int topHandle = handle;
+ int point = OS.gcnew_Point (0, 0);
+ if (point == 0) error (SWT.ERROR_NO_HANDLES);
+ int location = OS.UIElement_TranslatePoint (topHandle, point, parent.handle);
+ int x = (int) OS.Point_X (location);
+ int y = (int) OS.Point_Y (location);
+ OS.GCHandle_Free (point);
+ OS.GCHandle_Free (location);
+ int width = (int) OS.FrameworkElement_ActualWidth (topHandle);
+ int height = (int) OS.FrameworkElement_ActualHeight (topHandle);
+ return new Rectangle (x, y, width, height);
+}
+
+/**
* Returns the control that is used to fill the client area of
* the tab folder when the user selects the tab item. If no
* control has been set, return <code>null</code>.