Skip to content

Instantly share code, notes, and snippets.

@aljungberg
Created April 16, 2010 19:05
Show Gist options
  • Save aljungberg/368803 to your computer and use it in GitHub Desktop.
Save aljungberg/368803 to your computer and use it in GitHub Desktop.
eaecdc7 Fixed: calling setIsPaneSplitter: on a CPTableView would change the divider width but the subviews would not change size to match.
88f7cbe CPDate initWithString: now takes proper international format strings like NSDate. Similarly CPDate description generates such strings.
3c29b9a Fixed: CPArray insertObject:inArraySortedByDescriptors: always failed due to an incorrect method call and an out of scope variable reference. Also, even when fixed the method failed to produce the correct result due to a problem with _indexOfObject for non matched objects. Added unit tests.
2a28eec Added reverse sort tests for CPArray insertObject:inArraySortedByDescriptors:.
fe87138 The default theme can now be specified in the main Info.plist file using the key CPDefaultTheme. If no key is specified the default is Aristo.
8b12887 Merged some Jake changes.
e78f748 Removed a bindings console.log statement incompatible with browsers without a debug console.
34a44d0 Fixed: CPArrayController selectionIndexes returned nil initially rather than an empty index set.
7d7e9fb Added binding support for CPTableView selectionIndexes.
e993841 Fixed: a certain logging line in _CPKVOForwardingObserver caused occasional errors in Firefox. For reference the error was: [Exception... "Illegal operation on WrappedNative prototype object" nsresult: "0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)" location: "... Objective-J.js :: $_CPKVOForwardingObserver__observeValueForKeyPath_ofObject_change_context_ :: line 2886" data: no]
bdc97de Fixed: under certain circumstances controls would not be drawn despite a call to setNeedsDisplay:YES. A typical symptom of this was custom CPViews' drawRect never being called. The error was caused by _CPDisplayServer throwing away its remaining work whenever the display code of a control called setNeedsLayout.
c25196f DataSource delegate method tableView:objectValueForTableColumn:row is optional if bindings are used to provide data for the table view.
396ae31 Dragged rows are now visible with the default dragViewForRowsWithIndexes implementation even when bindings are used.
2ef8633 Support for diacritics aware strings comparison
f0d61ea CPCharacterSet implementation
2788c0c CPScanner implementation
05d81a9 CPPredicate &al implementation. OJUnit test.
32800d0 CPPredicate & co style cleaning
aefd881 Implemented support for CPOutlineView delegate method outlineView:shouldSelectItem:.
a5c4054 Implemented CPTableView clickedRow for use in double-action.
05a45a4 Fixed: CPWindow setFrame:display: failed with an "unrecognized selector" exception.
2778b7e Implemented [CPDate copy] with unit test. Also whitespace cleanup in CPDate.
ec6f34a Fixed: CPDates compared equal to nil and CPNull.
d28bad5 Fixed: CPTableView deselectRow: changed the column selection rather than the row selection.
67544d0 Fixed: CPArrayController keys ContentArray, ArrangedObjects, Selection, SelectionIndex, SelectedObjects, CanRemove and CanSelectNext could not be observed properly because their dependency declarations had a repeated typo.
d12de79 CPTableView selectionIndexes can now be observed, not just KVC modified.
1ccf38b Fixed: CPArray insertObject:inArraySortedByDescriptors: did not return the index into which the object was inserted. This would have broken CPArrayController's addObject code.
e74069e Fixed: the _CPObservableArray init method used by CPArrayController did not properly initialize _observationProxies.
72093f9 Fixed: the CPArrayController addObject: optimization for fast index updates would never fire with a nil _filterPredicate, causing rearrangeObjects to be called needlessly.
53398b9 CPArrayController now pushes new selections to the bound model for selectionIndexes. Using this, support for selectsInsertedObjects was added.
be810c6 Performance fix: willChange and didChange for CPArrayController's selectionIndexes were sent doubly.
fc0bb79 Fixed: CPArrayController would throw out of bounds exceptions when its content array was shortened and items at the end were selected.
b17b6d2 Fixed: CPArrayController could get out of bounds selections if a call to rearrangeObjects caused objects to disappear from the arranged set.
ac2472e Fixed: [CPDate description] did not generate a correct date for users in timezones with a negative timezone offset.
28008a0 Fixed: the CPArrayController code to remove out of bounds selections failed to remove the last selected item if the new arrangedObjects array was empty.
6fbb278 Optimized table data loading when using bindings for the cell values. A special code path in the CPTableColumn's prepareDataView:forRow: method turns a O(n) operation into O(1) where n is the number of items in the model array.
4c80ef0 Merge branch 'jakebindings' into bindings
331ffb0 Fixed merge mistake.
f642959 Export Base64 functions.
87fdc11 Fewer bindings debug log messages.
8dc102a Global base64_decode_to_string.
e4b8d7f Revert "Pulled @each out into a separate feature branch, so as to not conflict with the 0.8 work: http://github.com/280north/cappuccino/tree/@each ."
458481a Revert "Pulled @each out into a separate feature branch, so as to not conflict with the 0.8 work: http://github.com/280north/cappuccino/tree/@each ."
38306de Merge branch '@each' of git://github.com/280north/cappuccino into bindings
1e43b6c Proper resize cursors for CPSplitView. Also enables resize cursor for additionalEffectiveRectOfDividerAtIndex areas.
5e5f444 CPSplitView resize cursors now require [[self window] setAcceptsMouseMovedEvents:YES]; to be called manually pending a CPTrackingArea based implementation.
0bec646 Don't change scroll mode unexpectedly in CPWebView.
be698aa Fixed: the array controller remove method mapped selection indexes to the content array instead of the arranged objects, leading to the wrong objects being removed as filters and sort descriptors were effectively ignored.
77df662 Fixed: support CPTableView drag and drop when using bindings again. The previous fix was accidentally merged away at some point.
fb5950c Fixed: including CPValueTransformer.j causes an infinite loop due to the recent Objective-J (mis?) behavior that every class has to inherit from CPObject. Also, the transformer map failed to initialize properly with the existing setup code for reasons which were not immediately clear. Moving the initialization to a regular + initialize method eliminated the problem.
e23dc15 Fixed: exposed bindings on CPObject would not appear in CPObject subclasses.
0126835 The problem with initialize in fb5950c82d0124bdebb6e03cb4509306ef4161c8 turned out to be caused by a Cappuccino bug with class methods and arguments named 'name'. Renaming the argument solved the problem so I reverted the initialize change. This fix also fixes valueTransformerForName.
4ef9a61 Fixed bindings problems where 'nil' would be transformed into @"". Also, CPIsNilTransformerName and its inverse couldn't work because any nil value was immediately returned without transformations being applied. Full complement of unit tests included, based on Cocoa empirical testing.
8f844e4 Hack to make [textField bind:CPValueBinding ...] work. Without this, any observed change leads to a [textField setValue:X forKey:"value"] which in turn leads to a direct ivar access changing the value in textField._value. This means the text field has no idea the value changed and it doesn't update to show the new text. I'm not sure what the right solution should be here. It looks like _replacementKeyPathForBinding should play into this and change the end result to [textField setValue:X forKey:"objectValue"] which would work fine. But currently _replacementKeyPathForBinding applies to the observed key path, not the bound one.
fd33451 Reverse update value binding when control editing stops, not only when the action fires. This causes tabbing out of a text field to update the binding source. Based on the description of the bindings option NSContinuouslyUpdatesValueBindingOption this is the right thing to do: if NSContinuouslyUpdatesValueBindingOption is on, update on every character; "otherwise the update is made only when the user interface item resigns as the responder."
ddee3d0 CPNull valueForKey:X returns CPNull for any value of X, paralleling [nil valueForKey:X]. Verified against Cocoa through empirical testing.
80229d9 added CPTokenField
ed1ef00 fixed some tokenfield issues
8033bdf added various hacks to make the cptokenfield work with the new enstore admin
1257e4f Include CPTokenField.j.
b6828c3 Fixed: if [CPTokenField setObjectValue:X] was called while the token field was the first responder, the input value would be set to a string version of the object value due to CPTextField's setObjectValue method.
c83300e Fixed: [CPArray isEqualToArray:nil] threw an exception instead of returning NO.
95a154d Fixed some typos in the previous CPTokenField commit.
040764e Made CPTokenField themeable. Todo: the autocomplete drop-down is still hardcoded and Aristo style images are needed.
988feeb Reverse bindings support for when tokens are deleted through the close button.
c411b6a Fixed: if a CPTokenField was a subview of a container not at the top at the window, such as is often the case with a toolbar, the autocomplete view of CPTokenField would appear offset downwards.
34fca5b Implemented tokenizingCharacterSet property for CPTokenField. This changes the default tag separator to "," and allows tags with spaces. The previous behaviour can be restored using [field setTokenizingCharacterSet:[CPCharacterSet characterSetWithCharactersInString:@" "]].
1db7fc8 Reverse binding support for deleting tokens using the delete button. Fixed: if the last token was deleted using the close button without the token field being the first responder, the placeholder message would not appear.
9da63ce Fixed: if setValue was called to clear a token field, the placeholder message would not appear.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment