Commit Graph

9 Commits

Author SHA1 Message Date
Jeff Pittman 0a4e96fda9 Changed ListAdapter to work with lists, removing complexity for having data as strings and a separate datastore. Removed DataStore and concept, and replaced with a new adapter, DictAdapter, that works straight with dicts. Updated examples and tests for changes. 2012-08-13 13:42:40 -05:00
Jeff Pittman 107814ed3d Restored list_cascade_setter.py. Fixed comments about custom list adapter vs. using a setter-type binding. 2012-08-06 15:58:49 -05:00
Jeff Pittman f791156f26 Started moving to use of setter() in creating bindings between list adapters, with an example of a custom list adapter left in list_cascade.py. 2012-08-06 13:35:27 -05:00
Jeff Pittman c7b1851f73 Selection had no memory of previously selected items, because the data used in
the examples were just strings primarily. To further development with a more
realistic environment, a DataStore class was created, with simple set and get
property methods, operating on a key into a dict of records. The simple scheme
for the records is that they must all contain an is_selected boolean for
storing the state of selection. The fruit dataset was modified accordingly,
into two datastores: categories and fruits. A new simple dataset was also
created for integer data used in several examples.

For view instances to be associated with data records in a datastore, an index
property was added to SelectableItem. This index into the data list is used in
selection operations to keep selection of data items in sync with item view
instances.

When creating item view instances in ListView there is now a lookup call to
the datastore to check for selection of the associated data item record. The
data item record tested so far carries an is_selected boolean, but the code
was written to allow for an is_selected() function.
2012-08-05 12:41:06 -05:00
Jeff Pittman 0d29acae75 Added two new classes, ObjectAdapter and ObserverView, which work together in a fashion similar to the way ListAdapter and ListView work. ObjectAdapter can be used to hold the selection of a ListAdapter. ObserverView is a view associated with this relationship, as showin the the list_cascade_oo.py example. The detail view on the right is an ObserverView, showing the view associated with the ObjectAdapter instance observing the fruit selection. 2012-08-03 17:50:22 -05:00
Jeff Pittman ea7ce02a89 Removed the experiment with ButtonBehavior. Worked over bindings and events widely. Realized the place to put the call to check_for_empty_selection(), as things are now, is at the bottom of listview.hard_populate(). Cleaned up all of the examples for the changes. 2012-08-02 20:53:41 -05:00
Jeff Pittman cd0f045b75 Fixed call to DetailView(). 2012-08-01 08:59:07 -05:00
Jeff Pittman 8ea1783045 Split DetailView and the fruit data out into their own .py files and added/cleaned up imports. 2012-08-01 07:29:11 -05:00
Jeff Pittman 91f66e2f1a Moved list examples to a lists directory, because there are quite a few, and because some code is shared between them. 2012-08-01 07:09:46 -05:00