Commit Graph

334 Commits

Author SHA1 Message Date
Jeff Pittman caec459146 Added Factory register call, and trying to use CompositeListItem in the template for the new thumbnailed cascading lists example. 2012-08-02 10:55:21 -05:00
Jeff Pittman 753696f78b Added an example to work with new fruit images. 2012-08-02 09:28:57 -05:00
Jeff Pittman 189dea9b19 Added thumbnail images for fruits, all from wikipedia.org. 2012-08-02 04:29:41 -05:00
Jeff Pittman dafb48c8e8 Simplified fruit names in sample data. 2012-08-02 04:28:44 -05:00
Jeff Pittman 23ac1d8601 Improvement of the composite list view example. 2012-08-01 12:53:43 -05:00
Jeff Pittman cd7febcbf8 Improved the kv example docs comment. 2012-08-01 11:34:26 -05:00
Jeff Pittman eb6463a368 Added explanation of how the default args converter is used in the kv example. 2012-08-01 11:08:00 -05:00
Jeff Pittman 7da7432600 Added a list_kv.py example, and copied the code to the ListView docs header for the kv section. 2012-08-01 11:01:09 -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
Jeff Pittman 634aabbcf6 Added forced dispatch of on_selection_change after instantiation of DetailView in examples. 2012-08-01 07:04:36 -05:00
Jeff Pittman 03e031d663 Added item_strings= to ListView call. 2012-07-31 23:33:04 -05:00
Jeff Pittman 67c03f102d Whitespace and import fixes. 2012-07-31 19:19:37 -05:00
Jeff Pittman 397619e58d Added SimpleListAdapter to be the bare-bones, no selection, list adapter. ListAdapter now uses SimpleListAdapter if no adapter is provided. ListAdapter implements SelectionSupport, as before, but now subclasses SimpleListAdapter. Renamed SelectableListsAdapter to ListsAdapter. Updated examples and tests accordingly. Updated and fixed code examples in the docs for ListView. 2012-07-31 17:44:37 -05:00
Jeff Pittman b27adda021 Removed required arguments in ListAdapter. Fixed examples and tests accordingly. 2012-07-31 16:13:17 -05:00
Jeff Pittman 58dae9eb4e Removed the mixin SelectionObserver classes, and went back to explicit bindings done at the time of widget creation (just after). Updated examples and tests accordingly. The selection handler method is now called on_selection_change. The SelectionSupport mixin was changed to register the on_selection_change event, and was modified to dispatch in a more atomic fashion. 2012-07-31 14:08:00 -05:00
Jeff Pittman 65d96ef45d Changed observed_selection_changed() to on_selection_change() in preparation for redoing with a Kivy event. 2012-07-31 11:02:57 -05:00
Jeff Pittman fa7009d79d Added a simple example for listview, that only takes a list of strings. 2012-07-31 10:02:21 -05:00
Jeff Pittman 867061fe4a Removed the custom CompositeListItem from the example, and made a general CompositeListItem class in listview.py. This required a change to ListView to check for a provided adapter, and to handle its set for AbstractView, which as not __init(). 2012-07-31 10:00:04 -05:00
Jeff Pittman 608ca35951 Found a less distracting name for the main view of the list_composite.py example. 2012-07-31 00:03:08 -05:00
Jeff Pittman 5ef9a77c50 Added a list_composite.py list example, based on testing of the one started in the docs in widgets/listview.py. 2012-07-30 23:56:29 -05:00
Jeff Pittman b530e42850 Started writing formal examples for ListView in its doc header, which prompted several clean-ups. ListItemButton and ListItemLabel were added to listview.py, so that various custom ListItem classes made for the examples and tests could be removed. The todo list for this uix-listview branch was moved to a gist. A new adapters/util.py file was added, containing only list_item_args_adapter(). ListAdapter was modified to check for an args_converter argument, and if not present, to use the default one in adapters/util.py. 2012-07-30 22:39:15 -05:00
Jeff Pittman c3fc85e352 Remamed the adapters with the Single... and Multiple... long descriptive names by what they do, SelectableListsAdapter and AccumulatingListAdapter, respectively. 2012-07-30 11:24:30 -05:00
Jeff Pittman 40c5b2a72a Fixed the initial set in DetailView to use str() on the list item. 2012-07-30 09:50:08 -05:00
Jeff Pittman 3f6c8fad21 Removed the word Chained from the names of the new adapter classes, because it is redundant to Observing. Started an implementation of MultipleSelectionObservingListAdapter -- this is one of the long names. Added an example demonstrating this new adapter. Removed unneeded properties for views in the examples, because references to them are not used. Added better descriptions in headers for several examples. 2012-07-29 22:47:32 -05:00
Jeff Pittman 8ce7e9e0b0 Reinstated initialize_selection(), because it is needed when data changes. Added SingleSelectionObserver and MultipleSelectionObserver as markers. For now, using long descriptive names for the new adapter classes. 2012-07-29 21:32:03 -05:00
Jeff Pittman 61319369eb Added initial set for fruit_name in DetailView of examples. 2012-07-29 17:49:52 -05:00
Jeff Pittman 569c82b07d Removed special calls to check selection. 2012-07-29 13:59:15 -05:00
Jeff Pittman 9f26e72582 Made a new adapter called ChainedListAdapter to contain code that had been done at a higher level in a custom list view. Now ListView is used directly, and the selection chaining, or cascading, from list to list is pushed down to the adapters. SelectionObserver was modified to help in this reorganization. ChainedListAdapter uses the modified SelectionObserver, and implements the observed_selection_changed() method to update its selection. ChainedListAdapter contains a selectable_lists_dict, containing the lists of list items that change when selection of the observed list adapter changes, so the observed list selection is the key into this dict. Updated the listview widget examples, which became considerably simpler. Added a _trigger_hard_populate() method in ListView that fires when self.adapter.data changes, where the "hard" reference is to a reset of the item_view_instances dict to an empty before calling populate(). This is an effort to get the list to stay in sync with its list_adapter, but initial selection, despite all of these changes, still is not shown in the list view display. 2012-07-29 13:01:56 -05:00
Jeff Pittman 19c8d0c878 Worked over the list_disclosure.py example to properly use the selection_target arg and kwargs. 2012-07-29 01:05:49 -05:00
Jeff Pittman e2db30d37f Changed SelectableItem to have list_adapter property passed from ListAdapter, not from the custom list item class of the examples, so removes it from the API. Likewise, put the binding between selection and handle_selection in SelectableItem, because this also always must be done, so should not be exposed in the API. Added a selection_target property to accommodate the idea in examples/widgets/list_disclosure.py, for composite list items, for which the components may or may not be selectable, but may wish to proxy for the parent composite list item -- this approach is marked as needing review. Changed get_view in ListAdapter to make the correct cls instantiation call to pass itself as one of the arguments to the list item. 2012-07-29 00:46:07 -05:00
Jeff Pittman 05aa65eff4 Changed the name of the list argument in select_list to obj_list. Removed unneeded description of how properties work. 2012-07-28 23:41:07 -05:00
Jeff Pittman 13b2509bd4 Updated mixins dir for imports in examples. 2012-07-26 18:06:32 -05:00
Jeff Pittman dd6b816a8b Split out check_for_empty_selection from initialize_selection(). initialize_selection() still bound to changes of selection_mode and allow_empty_selection. 2012-07-16 16:19:13 -05:00
Jeff Pittman 25c3692b1d Added selection test to check for selected item by name. 2012-07-16 15:37:18 -05:00
Jeff Pittman b5c32166e8 Split out AbstractView. 2012-07-15 13:47:54 -05:00
Jeff Pittman 3cfb676626 Split Adapter and ListAdapter out of listview.py. Now they live in a top-level dir, kivy/adapters/adapter.py and listadapter.py. Fixed imports accordingly. 2012-07-15 12:45:59 -05:00
Jeff Pittman 9ed7f85e09 Reworked cascading example to remove arguments to the main view. Added print message in list_adapter initialize_selection() when there is no data. 2012-07-15 10:55:04 -05:00
Jeff Pittman 808d8f3ea2 Added call to initialize_selection to other examples. 2012-07-15 10:04:38 -05:00
Jeff Pittman a518880a39 Removed update_selection and put the check for allow_empty_selection in initialize_selection. Added calls to initialize_selection after widgets are built in examples. 2012-07-15 10:01:47 -05:00
Jeff Pittman 4a2d6d07ac Removed observer registration system and changed to use Kivy bindings system directly to the selection ListProperty. 2012-07-15 08:07:20 -05:00
Jeff Pittman b49a5638f6 Multiple binding sets collapsed to one. Added comment explaining selection modes. 2012-07-15 07:16:48 -05:00
Jeff Pittman a0c9fe78af Selection fixes. Main one was bug in handle_selection for list item types. Removed faulty code and calling self.adapter.handle_selection() instead. Now for list items, select and deselect only do cosmetic changes. 2012-07-14 15:44:40 -05:00
Jeff Pittman 3c58e90ca1 Improved todo items. Renamed item_keys back to data. 2012-07-14 13:50:37 -05:00
Jeff Pittman ae1d8b8380 Changed SelectableItem to take list_adapter as argument, instead of passing in a callback ref. So, call is now self.list_adapter.handle_selection(). 2012-07-14 11:32:52 -05:00
Jeff Pittman 98b6e280f5 Reverted to generic use of item in Adapter, clarifying with a comment. Kept explicit method name get_item_view_instance(), instead of get_view(). 2012-07-14 10:55:14 -05:00
Jeff Pittman d60a3832ab Refactor: explicit naming. 2012-07-14 07:27:46 -05:00
Jeff Pittman 01386d3762 Added note explaining idea for list_disclosure.py example. 2012-07-13 16:44:15 -05:00
Jeff Pittman e52cf08e3e Added back the example with BoxLayout as ListItem. Now in list_disclosure.py example file. 2012-07-13 16:19:47 -05:00