CPCollectionView -maxItemSize support, content binding, collection view item loading ... [+4] #1700

Merged
merged 15 commits into from Feb 8, 2013

Conversation

Projects
None yet
7 participants
@cacaodev
Contributor

cacaodev commented Dec 6, 2012

Includes:
• CPContentBinding support. it was there but unusable due to a late minItemSize update.
• CPCollectionViewItem can be loaded from an external cib. You can now have outlets and bindings from/to the prototype. They will be automatically connected for each item in the collection view.
• Support for maxitemSize width and height, including zero width/height interpreted as fully sizable.

The layout is now left-based which is the default in cocoa. But our current layout with centered views is also fine. You can switch back to it with the -uniformResizing flag. (It's just a bit more costly because we need to relayout more often).

With manual test of course.

cacaodev added some commits Jan 25, 2012

CPCollectionView Implemented - (CPView)draggingViewForItemsAtIndexes:…
…(CPIndexSet)indexes withEvent:(CPEvent)event offset:(CGPoint)dragImageOffset

and the corresponding delegate method from where you can ask for the default dragged view. Multiple selection not implemented yet.
CPCollectionView : Allow the prototype view to be loaded from a cib
With this commit CPCollectionView can load subviews from an external
cib. Outlets, actions and bindings between the view and the
prototype are restaured when the view is loaded.
CPCollectionView test. Nib test and bindings test.
Bindings:
collectionView CPContentBinding -> arrayController.selectedObjects
prototypeView CPValueBinding -> owner.representedObject
Update min/maxItemSize lazylly instead of subclassing -awakeFromCib
Binders can set values before -awakeFromCib. We were too late
and the bound content was not visible.
Partially rewrote layout.
it is not optimal but certainly better than the previous  version. A
collection view was unusable when resized through its scroll view.
Freeze autoresizingMask
The mask is 0 and cannot be changed.
Cocoa allows any value but ignores them for layout.
-setItemPrototype:
    Do not cache removed items in -reloadContent when the item prototype changes.

maxItemSize:
    Interpreted as horiz/vertic expandable when zero size and the proto view has a CPViewWidth|HeightSizable. (per cocoa but not documented).
    maxItemSize height support.

Fixed: incorrect position when num items < numberOfColumns.

Rewrote layout engine. Splitted the computation of size, columns count, rows count from the actual layout where we set the frame.
This will help when/if we support insertion/mutation of  -content or view animations.
We can also be more lazy when the computation results stay the same.

Added shared -init. Whitespace cleaning.

CPCollectionviewCibTest:
    Add ability to set the 2 kinds of prototypes, one loading its view from a cib, the other with a view outlet in the same cib.
    Loaded protoype: the bound textfield can commit its value to the model.
    UI for setting maxNumberOfColumns|Rows min|maxItemSize
@cappbot

This comment has been minimized.

Show comment Hide comment
@cappbot

cappbot Dec 6, 2012

Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.

cappbot commented Dec 6, 2012

Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.

cacaodev added some commits Dec 7, 2012

Simplify the "layout computing" method and change its name
There is not need to use that much arguments because the result is stored in ivars.
CPCollectionViewItem -copy: set properties correctly even if the collectionView overrides them.
Drop support with drop indicator.
FIXED: undefined _horizontalMargin
Test app: UI for switching uniformSubviewsResizing.
@mikecsh

This comment has been minimized.

Show comment Hide comment
@mikecsh

mikecsh Jan 24, 2013

Contributor

+1

Contributor

mikecsh commented Jan 24, 2013

+1

@cappbot

This comment has been minimized.

Show comment Hide comment
@cappbot

cappbot Jan 24, 2013

Milestone: Someday. Vote: 1. Label: #new. What's next? A reviewer should examine this issue.

cappbot commented Jan 24, 2013

Milestone: Someday. Vote: 1. Label: #new. What's next? A reviewer should examine this issue.

@CristinaRO

This comment has been minimized.

Show comment Hide comment
@CristinaRO

CristinaRO Jan 24, 2013

+1

+1

@cappbot

This comment has been minimized.

Show comment Hide comment
@cappbot

cappbot Jan 24, 2013

Milestone: Someday. Votes: 2. Label: #new. What's next? A reviewer should examine this issue.

cappbot commented Jan 24, 2013

Milestone: Someday. Votes: 2. Label: #new. What's next? A reviewer should examine this issue.

@milestinsley

This comment has been minimized.

Show comment Hide comment
@milestinsley

milestinsley Jan 24, 2013

Contributor

+1

Contributor

milestinsley commented Jan 24, 2013

+1

@cappbot

This comment has been minimized.

Show comment Hide comment
@cappbot

cappbot Jan 24, 2013

Milestone: Someday. Votes: 3. Label: #new. What's next? A reviewer should examine this issue.

cappbot commented Jan 24, 2013

Milestone: Someday. Votes: 3. Label: #new. What's next? A reviewer should examine this issue.

@ahankinson

This comment has been minimized.

Show comment Hide comment
@ahankinson

ahankinson Feb 3, 2013

Contributor

+1

Contributor

ahankinson commented Feb 3, 2013

+1

@cappbot

This comment has been minimized.

Show comment Hide comment
@cappbot

cappbot Feb 3, 2013

Milestone: Someday. Votes: 4. Label: #new. What's next? A reviewer should examine this issue.

cappbot commented Feb 3, 2013

Milestone: Someday. Votes: 4. Label: #new. What's next? A reviewer should examine this issue.

@ahankinson

This comment has been minimized.

Show comment Hide comment
@ahankinson

ahankinson Feb 8, 2013

Contributor

This issue seems to be quite popular and seems to be ready for a core committer to review and merge.

+#accepted
+#needs-review

Contributor

ahankinson commented Feb 8, 2013

This issue seems to be quite popular and seems to be ready for a core committer to review and merge.

+#accepted
+#needs-review

@cappbot

This comment has been minimized.

Show comment Hide comment
@cappbot

cappbot Feb 8, 2013

Milestone: Someday. Votes: 4. Label: #accepted. What's next? A reviewer should examine this issue.

cappbot commented Feb 8, 2013

Milestone: Someday. Votes: 4. Label: #accepted. What's next? A reviewer should examine this issue.

@aljungberg

This comment has been minimized.

Show comment Hide comment
@aljungberg

aljungberg Feb 8, 2013

Member

assignee=aljungberg
milestone=0.9.7

Member

aljungberg commented Feb 8, 2013

assignee=aljungberg
milestone=0.9.7

@cappbot

This comment has been minimized.

Show comment Hide comment
@cappbot

cappbot Feb 8, 2013

Assignee: aljungberg. Milestone: 0.9.7. Votes: 4. Label: #accepted. What's next? A reviewer should examine this issue.

cappbot commented Feb 8, 2013

Assignee: aljungberg. Milestone: 0.9.7. Votes: 4. Label: #accepted. What's next? A reviewer should examine this issue.

@ghost ghost assigned aljungberg Feb 8, 2013

aljungberg added a commit that referenced this pull request Feb 8, 2013

Merge pull request #1700 from cacaodev/CPCollectionViewItem-loading
CPCollectionView -maxItemSize support, content binding, collection view item loading ... [+4]

aljungberg added a commit that referenced this pull request Feb 8, 2013

aljungberg added a commit that referenced this pull request Feb 8, 2013

aljungberg added a commit that referenced this pull request Feb 8, 2013

Refs #1700. Fixed: setItemPrototype crash.
Setting the item prototype without first adding the collection view to a view would cause a crash, as would reloadContent.

This fix makes sure the collection view doesn't try to tile itself unless it has a frame.

@aljungberg aljungberg merged commit 00fea3e into cappuccino:master Feb 8, 2013

1 check failed

default The Travis build failed
Details
@aljungberg

This comment has been minimized.

Show comment Hide comment
@aljungberg

aljungberg Feb 8, 2013

Member

Merged. Thanks!

+#fixed

Member

aljungberg commented Feb 8, 2013

Merged. Thanks!

+#fixed

@cappbot

This comment has been minimized.

Show comment Hide comment
@cappbot

cappbot Feb 8, 2013

Assignee: aljungberg. Milestone: 0.9.7. Votes: 4. Label: #fixed. What's next? This issue is considered successfully resolved.

cappbot commented Feb 8, 2013

Assignee: aljungberg. Milestone: 0.9.7. Votes: 4. Label: #fixed. What's next? This issue is considered successfully resolved.

@cacaodev cacaodev deleted the cacaodev:CPCollectionViewItem-loading branch Feb 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment