1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-08-07 20:28:55 +00:00
Commit Graph

4 Commits

Author SHA1 Message Date
Andy McFadden
9c8afab2ea Restore selection and top position after change
Restoring the selection works pretty much like it used to, though
I'm capping the total size of the selection because it goes into
stupid-slow mode if you have too many elements.

Getting the item that is at the top of the ListView is astoundingly
obscure, due to the ListView's extreme generality.  I make a
simplifying assumption -- that we're using a VSP -- which allows us
to use a simple vertical offset once we've dug the appropriate
object out of the visual tree.  (The alternative is to walk through
the list of items and see what's on screen, or perform a hit test
calculation in the upper left corner.)  Yay WPF.
2019-06-10 15:46:35 -07:00
Andy McFadden
fa386a0d03 Finish wiring up code hint commands 2019-06-08 17:13:11 -07:00
Andy McFadden
80ec6b6c78 Add selection analysis
The various items in the Actions menu are enabled or disabled based
on the current selection.  There's no SelectedIndices property in
WPF ListViews, so we have to do things slightly differently.

The SelectedItems list isn't kept sorted to match the list contents,
so finding first/last item requires a bit of scanning.

Also, rearranged some stuff.  I'm trying to keep the old and new
code somewhat parallel, to make it easier to walk through at the end
and see if I've missed something.
2019-06-08 16:13:04 -07:00
Andy McFadden
558f1e4350 Wire up selection tracking
Renamed VirtualListViewSelection to DisplayListSelection, because
it's now tied to the DisplayList implementation.  Hooked it up to
handle SelectionChanged events.

Also, tweaked the code list item style to remove the one-pixel gap
between items.  Somehow I manage to click on the dead zone with
surprising regularity.
2019-06-07 17:25:04 -07:00