[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] better mouse tracking on NSMatrix
From: |
Benhur Stein |
Subject: |
[PATCH] better mouse tracking on NSMatrix |
Date: |
Tue, 11 Mar 2003 22:57:05 -0300 |
User-agent: |
Internet Messaging Program (IMP) 3.0 |
Hi!
After lots of testing, here are some patches to the mouse tracking code in
NSMatrix. The behaviour of mouse tracking is a bit different on OS42 and
MaxOSX. The implementation here reflects OS42 more closely (as the original code
in NSMatrix). Examples of differences:
- highlighting of NSButtonCells is different;
- OS42 makes each cell under the cursor track the mouse, MacOSX makes only
the clicked cell track it, untilMouseUp;
- if mouse goes up outside of a cell, OS42 sends the action, MacOSX does not;
- keys used for selection in list mode are not the same (shift and alternate
on OS42, command and shift on MacOSX).
Changes in the patch:
Some macros didn't protect their arguments.
New method -_setDottedRow:column:
Method -_selectCell:atRow:column: changed to use _setDotted
Method -highlightCell:atRow:column: has been highly simplified, doesn't draw
immediately, marks as needing display.
Method -setSelectionFrom:to:anchor:highlight: reimplemented (original did not
work well and I could not understand it).
Method -_mouseDownNonListMode: simplified to do less drawing and flushing.
Method -_mouseDownListMode: new method, taken from -mouseDown and simplified.
Method -mouseDown: calls previous method.
Method -_setState:highlight:startIndex:endIndex: was not working well with
rectangular selections; optimized to not draw cells that are not changed.
Also attached is the little program I used to test rectangular selections.
Regards,
Benhur
matrix.patch.gz
Description: Unix tar archive
testmatrix.m.gz
Description: Unix tar archive
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] better mouse tracking on NSMatrix,
Benhur Stein <=