summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2006-03-17 22:09:13 +0000
committerFelipe Heidrich <fheidric>2006-03-17 22:09:13 +0000
commit75a73077a9ee0523fa37e6b3f35e37db1a3f5eb2 (patch)
treeb078f7f742b0cf682a2fd7dfbf39facc7dc9f7c3
parent1aee34cae1a780c465123090f1ecce8f606ff51a (diff)
downloadeclipse.platform.swt-75a73077a9ee0523fa37e6b3f35e37db1a3f5eb2.tar.gz
eclipse.platform.swt-75a73077a9ee0523fa37e6b3f35e37db1a3f5eb2.tar.xz
eclipse.platform.swt-75a73077a9ee0523fa37e6b3f35e37db1a3f5eb2.zip
Bug 127373 - Hyperlinks covered by a table widget receives a linkActivated event when double click on the table
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
index 98c5f2c908..d19cadac56 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
@@ -41,7 +41,7 @@ public class Link extends Control {
Point selection;
String [] ids;
int [] mnemonics;
- int focusIndex;
+ int focusIndex, mouseDownIndex;
int font;
static final RGB LINK_FOREGROUND = new RGB (0, 51, 153);
static final int LinkProc;
@@ -181,7 +181,7 @@ void createHandle () {
ids = new String [0];
mnemonics = new int [0];
selection = new Point (-1, -1);
- focusIndex = -1;
+ focusIndex = mouseDownIndex = -1;
}
}
@@ -759,9 +759,9 @@ LRESULT WM_LBUTTONDOWN (int wParam, int lParam) {
Rectangle rect = rects [i];
if (rect.contains (x, y)) {
if (j != focusIndex) {
- focusIndex = j;
redraw ();
}
+ focusIndex = mouseDownIndex = j;
return result;
}
}
@@ -774,20 +774,21 @@ LRESULT WM_LBUTTONUP (int wParam, int lParam) {
LRESULT result = super.WM_LBUTTONUP (wParam, lParam);
if (result == LRESULT.ZERO) return result;
if (OS.COMCTL32_MAJOR < 6) {
- if (focusIndex == -1) return result;
+ if (mouseDownIndex == -1) return result;
int x = lParam & 0xFFFF;
int y = lParam >> 16;
- Rectangle [] rects = getRectangles (focusIndex);
+ Rectangle [] rects = getRectangles (mouseDownIndex);
for (int i = 0; i < rects.length; i++) {
Rectangle rect = rects [i];
if (rect.contains (x, y)) {
Event event = new Event ();
- event.text = ids [focusIndex];
+ event.text = ids [mouseDownIndex];
sendEvent (SWT.Selection, event);
- return result;
+ break;
}
}
}
+ mouseDownIndex = -1;
return result;
}