A MOViewListView is a vertical list of views that can be individually collapsed or expanded.
Superclass: NSView
A MOViewListView has a list of "stacked views" that it keeps arranged in a vertical stack. The appearance and behavior is similar to similar UI seen in PB, in some Microsoft apps, in the Jaguar Finder's Info window, and in Okito Composer among others. A MOViewListView is generally intended to live in a scroll view with a vertical scroller. Sizing behavior is interesting. The width of the MOViewListView determines the width of its subviews, but the combined height of the subviews and labels determines the height of the MOViewListView. Thus, subviews of a MOViewListView are generally expected to be able to take on any width, but are free to be a specific height and as tall as they need to be. The MOViewListView watches for changes in the frame of its subviews and will adapt itself as needed if any of the views change height.
MOViewListView uses instances of MOViewListViewItem to manage its subviews. Each MOViewListViewItem has a view and a label (and some other incidental attributes.) MOViewListViewItem is similar in function to NSTabViewItem. In particular one interesting use of MOViewListViewItem is to allow the subviews of a MOViewListView to be loaded lazily only when needed. MOViewListViewItems can be created with no view initially and added to the MOViewListView. The MOViewListView's delegate can then implement -viewListView:willExpandViewListViewItem: to load the view if necessary and set it into the MOViewListViewItem. That way as long as an item is collapsed and has never been expanded, its view will not be loaded.
MOViewListView has a lot of configurability with respect to its appearance. It implements the standard Cocoa -controlSize/-setControlSize: methods and adapts the appearance of its label bars accordingly. All the colors used for drawing the view (its background and labels) are also configurable. In addition, a convenience API is provided that sets all the colors to several preset schemes (some of which mimic the appearance of this type of view used in PB and Finder.)
MOViewListView can animate when collapsing or expanding subviews. There is specific API for expanding and collapsing that takes a flag to indicate whether to animate. There is also API that does not take that flag and those APIs animate or not depending on a user preference. The preference for animation is enabled by default. +usesAnimation and +setUsesAnimation: can be used to query and control this preference.
By default MOViewListView adapts to any changes that require relayout of its subviews immediately as changes are made. There is API for disabling/enabling this. If you plan to make a whole series of changes, you may want to disable relayout before you begin and re-enable it when you are done to prevent unnecessary work during the changes.