Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover2003-08-22 22:32:37 +0000
committerSteve Northover2003-08-22 22:32:37 +0000
commit79662ee8cc3f613263cefb586b48c6b804026f52 (patch)
treefc0e78ca05c54d06ce6763ab34b2909554bf414d
parent11bccded3c22e8e6857213e8db2ccad6f605ba46 (diff)
downloadeclipse.platform.swt-79662ee8cc3f613263cefb586b48c6b804026f52.tar.gz
eclipse.platform.swt-79662ee8cc3f613263cefb586b48c6b804026f52.tar.xz
eclipse.platform.swt-79662ee8cc3f613263cefb586b48c6b804026f52.zip
*** empty log message ***
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java36
1 files changed, 18 insertions, 18 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
index 6abf28e6d1..1bd4725b71 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
@@ -273,12 +273,12 @@ void createItem (TableColumn column, int index) {
System.arraycopy (columns, 0, newColumns, 0, columns.length);
columns = newColumns;
}
- if (customDraw && items != null && count != 0) {
+ if (customDraw && count != 0) {
int itemCount = OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
- for (int i = 0; i < itemCount; i++) {
+ for (int i=0; i<itemCount; i++) {
if (items [i].cellBackground != null) {
- int [] cellBackground = items [i].cellBackground;
- int [] temp = new int [columnCount];
+ int [] cellBackground = items [i].cellBackground;
+ int [] temp = new int [columnCount];
System.arraycopy (cellBackground, 0, temp, 0, index);
System.arraycopy (cellBackground, index, temp, index+1, columnCount-index-1);
temp [index] = -1;
@@ -572,11 +572,10 @@ void destroyItem (TableColumn column) {
if (first) index = 0;
System.arraycopy (columns, index + 1, columns, index, --count - index);
columns [count] = null;
-
- if (customDraw && items != null && getColumnCount () != 0) {
+ if (customDraw && getColumnCount () != 0) {
int columnCount = OS.SendMessage (hwndHeader, OS.HDM_GETITEMCOUNT, 0, 0);
int itemCount = OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
- for (int i = 0; i < itemCount; i++) {
+ for (int i=0; i<itemCount; i++) {
if (items [i].cellBackground != null) {
int [] cellBackground = items [i].cellBackground;
int [] temp = new int [columnCount];
@@ -1580,19 +1579,20 @@ LRESULT sendMouseDownEvent (int type, int button, int msg, int wParam, int lPara
* list widget and other widgets in Windows. The fix is
* to detect the case when an item is reselected and issue
* the notification.
+ *
+ * NOTE: This code runs for multi-select as well, ignoring
+ * the selection that is issed from WM_NOTIFY.
*/
boolean wasSelected = false;
- if ((style & SWT.SINGLE) != 0) {
- int count = OS.SendMessage (handle, OS.LVM_GETSELECTEDCOUNT, 0, 0);
- if (count == 1 && pinfo.iItem != -1) {
- LVITEM lvItem = new LVITEM ();
- lvItem.mask = OS.LVIF_STATE;
- lvItem.stateMask = OS.LVIS_SELECTED;
- lvItem.iItem = pinfo.iItem;
- OS.SendMessage (handle, OS.LVM_GETITEM, 0, lvItem);
- wasSelected = (lvItem.state & OS.LVIS_SELECTED) != 0;
- if (wasSelected) ignoreSelect = true;
- }
+ int count = OS.SendMessage (handle, OS.LVM_GETSELECTEDCOUNT, 0, 0);
+ if (count == 1 && pinfo.iItem != -1) {
+ LVITEM lvItem = new LVITEM ();
+ lvItem.mask = OS.LVIF_STATE;
+ lvItem.stateMask = OS.LVIS_SELECTED;
+ lvItem.iItem = pinfo.iItem;
+ OS.SendMessage (handle, OS.LVM_GETITEM, 0, lvItem);
+ wasSelected = (lvItem.state & OS.LVIS_SELECTED) != 0;
+ if (wasSelected) ignoreSelect = true;
}
dragStarted = false;
int code = callWindowProc (msg, wParam, lParam);

Back to the top