Keyed archiving preserves view hierarchies created in code. Decoded views
retain their content, subviews and state, and each view class is verified
against its own description before archiving.
* CPAccordionView: Add CPCoding to CPAccordionView and CPAccordionViewItem.
* CPBox:
* Encode the content, title and box views unconditionally.
* Clear the superviews of the box and title views during decoding.
* CPButton: Initialize the value to CPOffState.
* CPMapTable: Add CPCoding.
* CPPopUpButton: Clear the inherited button value.
* CPSearchField: Update the cancel button when the object value changes.
* CPSplitView: Return nil from dividerColor when the theme defines no divider
image.
* CPStepper: Discard the decoded buttons before recreating them.
* CPTabView:
* Encode the current tab view items.
* Exclude the tabs from the encoded subviews.
* CPTokenField:
* Discard the decoded scroll view before recreating it.
* Add the decoded tokens to the new document view.
* CPVisualEffectView: Resolve the backdrop filter property only when a DOM is
available.
* CPBoxTest: Verify preservation of the content view, hierarchy and title, and
decoding of an untitled box without warnings.
* CPButtonTest: Verify the initial value of a button.
* CPMapTableTest: Verify preservation of entries through archiving.
* DropInArchiveFixtures: Add populated view fixtures, tree comparison, and
round trip and saved archive helpers.
* DropInArchiveGenerator: Save cib descriptions and view archives, and write no
archive data if any view fails its round trip.
* DropInArchiveTest: Verify new archives, saved archives and reference cibs, and
treat decoding warnings as failures.
* DropInSnapshot:
* Describe the view hierarchy through private views, with state and content.
* Add DropInWithFixedScrollerStyle.
* DropInArchives, DropInCibs: Add saved view archives, cib descriptions and
reference cibs.
Controls can implement -isExlusiveBinding: to determine if bindings are exclusive. Defaults to NO.
Exclusive bindings are mainly CPSelectedIndexBinding | CPSelectedTagBinding | CPSelectedValueBinding
This could cause memory leaks and was unnecessarily verbose.
CPPopUpButton , CPRadio and CPSegmentedControl now use a generic CPBinder method for searching the binder involved when the control is asked to reverse set the binding, typically after a user interaction.
Fixes#2199
TODO: prevent user to bind multiple selection bindings when these bindings are exclusive.
Previously, if a pull down menu was brought down from a pop up button in pull down mode, clicking the button again would close and reopen the menu.
With this fix the behaviour becomes like in Cocoa, and clicking the button a second time simply closes the menu.
Support value transformers for CPContent and CPContentValues bindings.
Made _CPPopUpContentValuesBinder a subclass of CPPopUpContentBinder and reuse setContent:.
Fixed a bug in selectedIndex binding set and reverse set when insertsNull options is on.
_CPPopUPSelectionBinder : simplified the code for getting the unique selection binder in use.
ojunit and manual tests for contentvalues + value transformer.
- Added enumerateObjectsUsingBlock: to CPArray
- Fixed a remaining case of [] being used instead of objectAtIndex: in CPMutableArray.
- Added KVO support for menu items array in menus.
- Changed CPPopUpButton to use KVO to sync up with menu instead of notifications.
- Removed extra menu encoding in CPPopUpButton.
- Removed extra mainMenu object from CPApplication.
- Use setters in CPResponder instead of direct ivar access in initWithCoder:.
Closes#298.
Closes $1059.
Reviewed by me.