[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

text selection!



I'm psyched, even though this isn't a particularly big deal.  I'm not
even actually displaying the selection.  The actual structure is:

A standard MVC Controller and view.  The controller holds onto my
eventqueue and the root FM controller for the FM stuff I'm building.
The view holds onto the FM view.  The controller is just a generic
MultiSelection controller that knows how to ask its view for a key
that identifies the selected element.  It then feeds this key to a
TextSelection object (soon to be renamed RangeSelection) that knows
about maintaining ranges of selection.  The FMView used for display
and selection is a SimpleTextViewer which just displays a FMTextModel
(my replacement for DisplayModel).  To make update happen correctly, I
will eventually add the correct updating code so that the FMTextModel
is a dependent of the selectionObject.  That's a pretty low priority
though.  

The places where all this generalizes:  The selection object handles
shift selection trivially (I already tested it).  A trivial new class
that represents the selection with a RunModel will allow multiple text
selections (using the option key...).  The SelectionController and
selectionObject will work just as well for selecting in lists of
objects (specifically links).  This includes all shift/option/command
extensions to the selection.  Alternate selectionObjects will
implement list selections that require at most one selection, at least
one selection, selections in tree space, etc.

Now I'm going to get the basic selection mechanism to work for lists
of subViews....

dean