List/Tree Widget
From Adobe Open Source Wiki
(Difference between revisions)
| Line 1: | Line 1: | ||
| − | The tricky part of a | + | ''(For the time being the focus will be on lists, not heirarchical trees.'' |
| + | |||
| + | The tricky part of a list controller/view is that you have a controller/view on a sequence. You need to figure out: | ||
# How to communicate requests for changes to the sequence | # How to communicate requests for changes to the sequence | ||
# What those requests are | # What those requests are | ||
# How to communicate a change in the visible portion of the sequence to the view | # How to communicate a change in the visible portion of the sequence to the view | ||
| + | |||
| + | We assume the sequences in a list are disjoint. | ||
== Related Docs == | == Related Docs == | ||
| Line 23: | Line 27: | ||
|Visible Update || Notify the user of the sequence of nodes that are currently visible in the view || Y || Y || N | |Visible Update || Notify the user of the sequence of nodes that are currently visible in the view || Y || Y || N | ||
|} | |} | ||
| + | |||
| + | == Typedefs == | ||
| + | |||
| + | Assume for the time being that the model_type is simple: | ||
| + | |||
| + | typedef std::vector<std::string> model_type; | ||
| + | typedef model_type::iterator iterator; | ||
| + | typedef std::pair<iterator, iterator> sequence_type; | ||
| + | |||
| + | == Model API == | ||
| + | |||
| + | void insert(const model_type& what, iterator where); | ||
Revision as of 00:07, 10 January 2007
(For the time being the focus will be on lists, not heirarchical trees.
The tricky part of a list controller/view is that you have a controller/view on a sequence. You need to figure out:
- How to communicate requests for changes to the sequence
- What those requests are
- How to communicate a change in the visible portion of the sequence to the view
We assume the sequences in a list are disjoint.
Contents |
Related Docs
Win32 Tree Control API Documentation (Tree View)
Carbon Tree Control API Documentation (Data Browser)
Request Types
| Request Type | Description | Single Node? | Multi Node? | Parent Target? |
|---|---|---|---|---|
| Insert | Create a new node in the tree | Y | Y | Y |
| Delete | Remove a node from the tree | Y | Y | N |
| Move | Change the parent of a node in the tree | Y | Y | Y |
| Visible Update | Notify the user of the sequence of nodes that are currently visible in the view | Y | Y | N |
Typedefs
Assume for the time being that the model_type is simple:
typedef std::vector<std::string> model_type; typedef model_type::iterator iterator; typedef std::pair<iterator, iterator> sequence_type;
Model API
void insert(const model_type& what, iterator where);