Commit Graph
106 Commits
Author SHA1 Message Date
aparajita 96605826ba Merge pull request #1842 from stewa/empty-collectionview-keyboard-navigation-problem
Fixed: using keyboard navigation in empty CPCollectionView threw exception

Previously, if an empty CPCollectionView was first responder and keyboard navigation was used, a CPInvalidArgumentException (Range {-1, 1} is out of bounds) was thrown.

This commit checks for an empty collection, eliminating the exception.
2013-03-12 07:01:53 -07:00
aparajita da69a6e339 Merge pull request #1845 from cacaodev/CPCollectionView-doc
Docs: CPCollectionView-setItemPrototype: method documentation
2013-03-11 21:20:14 -07:00
Stefan Wallström a549c191da lint 2013-03-11 21:09:22 +01:00
cacaodev 0d168a4518 Remove //@class CPClipView 2013-03-11 17:52:21 +01:00
cacaodev 0e4f5e9203 Uncomment import 2013-03-11 17:14:00 +01:00
cacaodev a98def4326 Added doc for -setItemPrototype: explaining how to setup the item prototype when you want to use bindings for the view. 2013-03-11 16:49:19 +01:00
Stefan Wallström 2bf2442096 Fixed: Using keyboard navigation in empty CPCollectionView threw exception. 2013-03-10 17:38:08 +01:00
Alexander Ljungberg f4096b94a7 New: use @ref and @deref instead of Ref.h throughout Cappuccino. 2013-03-10 13:08:34 +00:00
Aparajita Fishman 53ce9b6588 Fixed: delegate method collectionViewDidChangeSelection: is deprecated
Previously CPCollectionView supported a delegate method collectionViewDidChangeSelection:, which is not defined in Cocoa. Since CPCollectionView is KVO-compliant for selectionIndexes, this delegate method is no longer necessary and is a needless divergence from Cocoa.

The method is now marked as deprecated, and when used will log a deprecation warning.

Closes #715
2013-02-26 08:11:42 -05:00
Aparajita Fishman a011596231 CGContext fixes/enhancements
- NEW: Retrieve the underlying Image element from a CPImage with -image.
- NEW: You can now render any arbitrary drawing to a pattern context and use that as a fill or stroke pattern. See CGContextCreatePatternContext, CGContextSetFillPattern and CGContextSetStrokePattern. Works in all canvas-enabled browsers, including IE 9+.
- NEW: An example of using a custom rendered pattern is in Tests/Manual/PatternFillTest.
- NEW: Test if a CPImage is a single image (vs. three/nine part) with -isSingleImage.
- FIXED: With canvas, we have to track ourselves whether the context has a path or not.
- FIXED: All shapes except rects may not be added to a path with no context. If you attempt to do so, an error is logged.
- FIXED: CGPath was not setting the start and current point correctly in some cases.
- FIXED: CGContextAddPath was not moving to the path's start point at the beginning.
- FIXED: Removed superfluous CGContextClosePath commands, fixed some drawing sequences.
- FIXED: Misc. formatting.

Sorry, these changes are canvas only (including IE 9+)! I am not going to spend the time to port these fixes to VML (IE 8).
2013-02-23 13:53:20 -05:00
cacaodev 4791973b02 If maxNumberOfRows == 0 (the default), ignore maxNumberOfRows 2013-02-13 23:54:02 +01:00
cacaodev 21b5eade71 CPCollectionView Issue 1755:
Create the drop indicator in mouseEntered if needed. This is the case where the collection view is a drop destination but not a drag source.
In _updateDragAndDropStateWithDraggingInfo... , handle the special case where the drop destination is 0 (includes item count == 0).
Test app: add an empty collection view acting as a drop destination for the first collectionView.
2013-02-13 17:47:27 +01:00
Alexander Ljungberg 21efb90b4c 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.
2013-02-08 11:46:08 +00:00
Alexander Ljungberg 1248b1fb29 Refs #1700. Fix unknown class or global warnings. 2013-02-08 11:26:56 +00:00
Alexander Ljungberg 8ed85ede2c Refs #1700. Use more macros. 2013-02-08 11:17:45 +00:00
Alexander Ljungberg 6181b75d9f Refs #1700. Make reloadContentCachingRemovedItems: a private method. 2013-02-08 11:02:02 +00:00
Alexander Ljungberg 7b1ffb942f Refs #1700. Clean up and use macros. 2013-02-08 11:01:19 +00:00
Alexander Ljungberg 61990e764c Merge pull request #1700 from cacaodev/CPCollectionViewItem-loading
CPCollectionView -maxItemSize support, content binding, collection view item loading ... [+4]
2013-02-08 10:52:00 +00:00
Aparajita Fishman 4f377bcebe Objj2 compiler fixes
Compiled all files individually:

- Added missing imports.
- Added @class/@global declarations to break circular dependencies.
- Misc. code cleanup.

Conflicts:
	AppKit/CPWindow/_CPWindow.j
	AppKit/Platform/DOM/CPPlatformWindow+DOM.j
2013-01-23 15:48:55 +07:00
Martin Carlberg b52217e8a0 Tried to make the import mess a little better. Fixed a lot of bugs. Changed some class names in the test cases. Looks like all the tests are being run in the same space. Has to look into this….. 2012-12-17 00:40:26 +01:00
Martin Carlberg c297e926f9 Compiler now works with jake and can compiler the whole Cappuccino framework. A lot of test cases still fail 2012-12-16 17:38:47 +01:00
cacaodev 6b7b63dff4 Drop support with drop indicator.
FIXED: undefined _horizontalMargin
Test app: UI for switching uniformSubviewsResizing.
2012-12-08 23:15:41 +01:00
cacaodev dd5bd17e2b 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.
2012-12-08 17:43:53 +01:00
cacaodev 2ab1493d27 Merge branch 'CPCollectionView-dragged-view' into CPCollectionView-dragAndDrop 2012-12-07 16:51:23 +01:00
cacaodev 9a1e75712d test app: CPSelectionIndexesBinding test 2012-12-07 16:51:11 +01:00
cacaodev 4c1ebfbdd4 -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
2012-12-06 19:42:03 +01:00
cacaodev 34d6d0695f Freeze autoresizingMask
The mask is 0 and cannot be changed.
Cocoa allows any value but ignores them for layout.
2012-11-30 15:01:44 +01:00
cacaodev 524bd52a56 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.
2012-11-30 15:01:44 +01:00
cacaodev efc5b8faaa 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.
2012-11-30 15:00:28 +01:00
cacaodev 8b5c0fb715 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.
2012-11-30 14:56:36 +01:00
Alexander Ljungberg 0f5d459ed8 Fixed: collection view crash on unepexted drag events. 2012-10-23 11:21:42 +01:00
Blair Duncan 04f650dde7 Windows selection compatibility. Fix for issue 1390 2012-09-03 23:47:11 -04:00
Alexander Ljungberg 998bdb550b Merge branch 'master' of github.com:cappuccino/cappuccino 2012-04-26 15:25:59 +01:00
Alexander Ljungberg a0c7305334 Fixed: collection views cleared their selection whenever the content was changed.
This was unlike Cocoa and prevented CPArrayController's selectsInsertedObjects from working.
2012-04-26 15:19:18 +01:00
Aparajita Fishman 36bfc7c675 Fixed decode methods to return the correct defaults, removed unnecessary containsValueForKey and || with defaults 2012-04-24 10:15:19 +02:00
Alexander Ljungberg 7efc8230a2 Fixed: a collection view wouldn't become the first responder when its items were clicked. 2012-04-20 17:30:17 +01:00
cacaodev 57c8d223ad CPCollectionView dragging: fix a bug where the dragging view was created from content instead of selection 2012-02-29 18:45:11 +01:00
cacaodev 8641738777 Merge remote-tracking branch 'upstream/master' into CPCollectionView-dragged-view 2012-02-29 18:42:25 +01:00
Alexander Ljungberg 4b764dc8b4 Throw an exception when trying to set a null minimum item size for a collection view. 2012-02-17 16:25:16 +00:00
Alexander Ljungberg 3a8ad56d4b Fixed: don't crash when loading a collection view with no item prototype view from a cib. 2012-02-17 16:23:59 +00:00
Alexander Ljungberg a1bc5ad4d3 Fixed: app would freeze on collection view setSelectionIndexes:nil. 2012-02-17 14:23:21 +00:00
Alexander Ljungberg 4aa3824a2a Minor collection view optimisation. 2012-02-17 14:05:03 +00:00
Alexander Ljungberg e03e774113 Format delegate signatures in collection view documentation. 2012-01-27 12:19:52 +00:00
cacaodev bafd62d42d 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.
2012-01-25 17:25:23 +01:00
Klaas Pieter Annema 753257a650 Always tile the collectionview
A collectionview should always tile because it needs to adjusts it's size to properly work with an enclosing scrollview
2011-05-31 14:37:29 +02:00
Derek Hammer 7194a6961a Forgot a forward slash to end the pre tag. 2011-05-22 17:58:25 -05:00
Derek Hammer e404217e8b Elaborate what setItemPrototype expects and does in CPCollectionView. 2011-05-22 17:55:17 -05:00
Klaas Pieter Annema f8674b6d87 add collectionView:menuForItemAtIndex delegate 2011-04-20 14:40:47 +02:00
Klaas Pieter Annema 39459c9a44 take min and max size from item prototype 2011-04-18 10:34:45 +02:00
Klaas Pieter Annema 3d5232b308 give objects a chance to change their binder class
- make every object calling getBinding:forObject: aware of this change
- implement _CPCheckBoxValueBinder to handle binding to the value of a checkbox Closes: #1083
- re-implement CPTextField's behavior for controller markers using the new binder class
- disabled some tests that are not compliant with Cocoa
2011-01-07 14:14:19 +01:00