|
Lines 84-90
Link Here
|
| 84 |
TreeColumn sortColumn; |
84 |
TreeColumn sortColumn; |
| 85 |
int columnCount; |
85 |
int columnCount; |
| 86 |
int sortDirection; |
86 |
int sortDirection; |
| 87 |
boolean ignoreExpand, ignoreSelect, ignoreRedraw, reloadPending, drawExpansion; |
87 |
boolean ignoreExpand, ignoreSelect, ignoreRedraw, reloadPending, drawExpansion, wasSelected; |
| 88 |
Rectangle imageBounds; |
88 |
Rectangle imageBounds; |
| 89 |
TreeItem insertItem; |
89 |
TreeItem insertItem; |
| 90 |
boolean insertBefore; |
90 |
boolean insertBefore; |
|
Lines 1892-1899
Link Here
|
| 1892 |
} |
1892 |
} |
| 1893 |
|
1893 |
|
| 1894 |
void mouseDown (int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { |
1894 |
void mouseDown (int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { |
|
|
1895 |
NSOutlineView widget = (NSOutlineView)view; |
| 1896 |
NSEvent nsEvent = new NSEvent(theEvent); |
| 1895 |
if (headerView != null && id == headerView.id) { |
1897 |
if (headerView != null && id == headerView.id) { |
| 1896 |
NSTableView widget = (NSTableView)view; |
|
|
| 1897 |
widget.setAllowsColumnReordering(false); |
1898 |
widget.setAllowsColumnReordering(false); |
| 1898 |
NSPoint pt = headerView.convertPoint_fromView_(new NSEvent(theEvent).locationInWindow(), null); |
1899 |
NSPoint pt = headerView.convertPoint_fromView_(new NSEvent(theEvent).locationInWindow(), null); |
| 1899 |
int /*long*/ nsIndex = headerView.columnAtPoint(pt); |
1900 |
int /*long*/ nsIndex = headerView.columnAtPoint(pt); |
|
Lines 1911-1920
Link Here
|
| 1911 |
// Bug/feature in Cocoa: If the tree has a context menu we just set it visible instead of returning |
1912 |
// Bug/feature in Cocoa: If the tree has a context menu we just set it visible instead of returning |
| 1912 |
// it from menuForEvent:. This has the side effect, however, of sending control-click to the NSTableView, |
1913 |
// it from menuForEvent:. This has the side effect, however, of sending control-click to the NSTableView, |
| 1913 |
// which is interpreted as a single click that clears the selection. Fix is to ignore control-click, |
1914 |
// which is interpreted as a single click that clears the selection. Fix is to ignore control-click, |
| 1914 |
NSEvent event = new NSEvent(theEvent); |
1915 |
if ((nsEvent.modifierFlags() & OS.NSControlKeyMask) != 0) return; |
| 1915 |
if ((event.modifierFlags() & OS.NSControlKeyMask) != 0) return; |
|
|
| 1916 |
} |
1916 |
} |
|
|
1917 |
wasSelected = false; |
| 1917 |
super.mouseDown(id, sel, theEvent); |
1918 |
super.mouseDown(id, sel, theEvent); |
|
|
1919 |
if (!wasSelected) { |
| 1920 |
NSPoint pt = view.convertPoint_fromView_(nsEvent.locationInWindow(), null); |
| 1921 |
int /*long*/ row = widget.rowAtPoint(pt); |
| 1922 |
if (row != -1 && widget.isRowSelected(row)) { |
| 1923 |
NSRect rect = widget.frameOfOutlineCellAtRow(row); |
| 1924 |
if (!OS.NSPointInRect(pt, rect)) { |
| 1925 |
id itemID = widget.itemAtRow(row); |
| 1926 |
Widget item = display.getWidget (itemID.id); |
| 1927 |
if (item != null && item instanceof TreeItem) { |
| 1928 |
Event event = new Event (); |
| 1929 |
event.item = item; |
| 1930 |
postEvent (SWT.Selection, event); |
| 1931 |
} |
| 1932 |
} |
| 1933 |
} |
| 1934 |
} |
| 1935 |
wasSelected = false; |
| 1918 |
} |
1936 |
} |
| 1919 |
|
1937 |
|
| 1920 |
/* |
1938 |
/* |
|
Lines 2085-2090
Link Here
|
| 2085 |
} |
2103 |
} |
| 2086 |
|
2104 |
|
| 2087 |
void outlineViewSelectionDidChange (int /*long*/ id, int /*long*/ sel, int /*long*/ notification) { |
2105 |
void outlineViewSelectionDidChange (int /*long*/ id, int /*long*/ sel, int /*long*/ notification) { |
|
|
2106 |
wasSelected = true; |
| 2088 |
if (ignoreSelect) return; |
2107 |
if (ignoreSelect) return; |
| 2089 |
NSOutlineView widget = (NSOutlineView) view; |
2108 |
NSOutlineView widget = (NSOutlineView) view; |
| 2090 |
int row = (int)/*64*/widget.selectedRow (); |
2109 |
int row = (int)/*64*/widget.selectedRow (); |