Commit Graph
10331 Commits
Author SHA1 Message Date
Aparajita Fishman 4b0b19aec7 Formatting, refactoring, use separate message for nil key 2013-03-06 07:49:18 -05:00
Aparajita Fishman af142a5ccc Merge branch 'refs/heads/cpdictionary_throw_on_nil' into temp 2013-03-05 15:50:41 -05:00
aparajita e3384d98b7 Merge pull request #1810 from ahankinson/fix-issue1184
Fix #1184: Add missing argument to .apply()
2013-03-05 12:40:27 -08:00
Alexander Ljungberg f4b08a9ce2 New: - CPObject performSelector:withObject:afterDelay:.
Also - CPObject cancelPreviousPerformWithTarget: and other related methods.
2013-03-05 18:52:06 +00:00
aparajita 21595cdebc Merge pull request #1821 from ahankinson/fix-issue357
Fix #357: Fix resizeWithOldSuperviewSize to work more like Cocoa
2013-03-05 05:30:13 -08:00
cacaodev ac3a45aec5 CPTableView: force the mask to CPViewNotSizable for IB made CPTableCellView.
Added documentation for tableView:dataViewForTableColum:row: delegate method. Document other cases, when we expect the data view to have a CPViewNotSizable mask.
ViewBasedCib example: added variable row heights.
2013-03-04 20:03:20 +01:00
Andrew Hankinson 4605130a53 Fix #357: Fix resizeWithOldSuperviewSize to work more like Cocoa
Without this fix, CPView's resizeWithOldSuperviewSize: would simply resize subviews at the rate of 1 pixel for every 2 pixel change.

This change introduces a new method of resizing views to a ratio of the size of the superview.

Patch contributed by @davidkhess
2013-03-02 16:40:00 -05:00
Randy Luecke 89c943f755 Merge pull request #1820 from BlairDuncan/TableViewCursorInfinateLoopFix
fix for issue #1819 tableview infinate loop
2013-03-01 14:20:34 -08:00
Blair Duncan 9730e066b8 fix for issue #1819 tableview infinate loop 2013-03-01 17:00:38 -05:00
Christophe Serafin 77d2ebbda0 adds shouldReorderColumn to CPTableView delegate methods 2013-03-01 11:57:24 +01:00
Alexander Ljungberg 8668911593 Merge pull request #1817 from gildegoma/travis-ci_use_build_dir_variable
Travis CI: Use new $TRAVIS_BUILD_DIR environment variable
2013-03-01 10:57:02 +00:00
Martin Carlberg 34843a70b9 Merge branch 'master' of https://github.com/cappuccino/cappuccino into cpdictionary_throw_on_nil 2013-03-01 10:50:22 +01:00
Martin Carlberg e686fbc0a8 Fixed: Handle deprecated setObject:forKey: calls with nil object on CPDictionary 2013-03-01 10:50:00 +01:00
Gilles Cornu 95ab1b355a Travis CI: Use new $TRAVIS_BUILD_DIR env-variable
Before this fix: environment variables defined `.travis.yml` were still
dependant of internal configuration of the travis worker virtual
machine. See also previous pull request #1728.

With this fix, `.travis.yml` is even more generic and portable.
2013-03-01 07:58:33 +01:00
Antoine Mercadal 5312524871 Define navigator.userAgent as another ugly Rhino fix 2013-02-28 15:41:14 -08:00
Martin Carlberg 64fb0934a4 Fixed: Do not setObject: forKey: when object or key is nil 2013-02-28 22:59:11 +01:00
Martin Carlberg 6ee3a395fb Fixed: CPDictionary setObject: forKey: will log deprecated warning when passing nil object or key.
This should be replaced by throwing exception after release of next stable version. Code included for this.
2013-02-28 22:58:42 +01:00
Aparajita Fishman 62ced1749f Fixed: invalid menu item validator was not checked properly
Previously, if CPApplication -targetForAction:to:from: returned nil, no check was done to see if that failed because there was no action or no valid target. If the item had no item, no target, and to action binding, it would be left enabled, which was incorrect.

This commit fixes the validation to disable the item if targetForAction:to:from: returns nil and the item has an action or target.
2013-02-27 18:26:34 -05:00
Aparajita Fishman 9ea3b70143 Fixed: table cells were not initialized from xib settings
This is a second attempt to fix the problems addressed by 69bbe627a9.

Because table cell classes needed to use the same initialization code as the NS_initWithCoder methods, it was necessary to refactor the initialization code into separate NS_initWithCell methods and call them separately from NS_initWithCoder.
2013-02-27 18:02:55 -05:00
Stefan Wallström b7ff643a34 Fixed: when clicking and dragging inside a menu, mouseEntered and mouseExited was mixed up for custom views. 2013-02-27 22:26:52 +01:00
Aparajita Fishman 07f9b94548 Fixed: initializer did not allow programmers to pass arbitrary types
Originally the initializer had coerced the parameter to a string, even though it is clearly documented that it should be a string. A later commit removed that coercion.

This commit reinstates the type coercion and thus saves the world from those who would pass non-string types in a parameter that says "withString".
2013-02-27 15:17:17 -05:00
Aparajita Fishman c5b3c17ccc Revert "Fixed: table cells were not initialized from xib settings"
This reverts commit 69bbe627a9 until it can be implemented correctly.
2013-02-27 13:54:26 -05:00
Andrew Hankinson 02460f0e9d Change this to _window in apply() 2013-02-27 09:07:21 -05:00
Andrew Hankinson ee20038dce Fix #1184: Add missing argument to .apply()
The Javascript .apply() method takes two arguments: A context argument and an array of values. In CPWebScriptObject callWebScriptMethod:withArguments, only an array of arguments was passed to the .apply() method.

This fix inserts `this` as the first argument, and the array of arguments as the second. This has been converted to a pull request from the original issue (#1184)

The original issue also suggested a fix for handling namespaces, which are not incorporated in this patch.
2013-02-26 21:37:57 -05:00
Aparajita Fishman 226bf5299e Fix: don't touch the item state unless disabling 2013-02-26 21:07:12 -05:00
Aparajita Fishman ae2ed8bf94 Fixed: empty strings and indexes out of range were not handled
Previously CPAttributedString did not provide an -init method,
with the result that an attributed string created with [[CPAttributedString alloc] init]
would not be correctly initialized.

Also, some methods that took indexes into the string were not checking for an invalid index and were not raising exceptions when the documentation said they should.

Finally, some methods that were supposed to return empty dictionaries were returning nil.

This commit fixes all of these problems. Empty strings should no longer cause errors.

Closes #533
2013-02-26 20:15:15 -05:00
aparajita 395d140c76 Merge pull request #1805 from ahankinson/fix-issue1359
Fix #1539: Figure out the best shell config file
2013-02-26 11:47:54 -08:00
Alexander Ljungberg d9354c867b Fixed: token field menu refusing clicks in recent versions.
Not clear why this worked before but not now. This fix makes sense regardless.

Without this fix, clicks would not be sent through to the token field menu because its window wasn't the key window.

This fix makes the autocomplete menu declare it does not need to and does not want to become the key window.

Fixes #1807.
2013-02-26 18:55:22 +00:00
Alexander Ljungberg a6fafcd03b Fixed: inadvertent grid lines in token field menu.
Without this fix, grey lines were showing in the background of token field autocomplete menus in recent versions.

This fix removes the grid lines which were never intended to be there to begin with.

Fixes #1806.
2013-02-26 18:27:41 +00:00
Alexander Ljungberg 0b88f1be14 Docs: incorrect - CPEvent acceptsFirstMouse: documentation. 2013-02-26 18:27:41 +00:00
Aparajita Fishman 69bbe627a9 Fixed: table cells were not initialized from xib settings
Previously, table view cells (non-view-based) were not being decoded with all of the available cell attributes in IB, and many attributes were hard-coded. In addition, there was a bunch of initialization code that has been made redundant by theming.

With this commit, decoding of all control classes has been refactored so that table view cells can use the same code, thus ensuring they decode all available cell attributes. In addition, the redundant code has been eliminated.

It is now possible to apply most table cell attributes such as font, color, alignment, sendsActionOnEndEditing, and so on, directly in IB.

Closes #1803

BREAKING CHANGE:
Changes have been made to table cell decoding in nib2cib. All xibs should be re-converted with `find . -name '*.xib' -exec nib2cib {} \;`.
2013-02-26 13:07:54 -05:00
Alexander Ljungberg 26a9c9e725 New: exclude Sublime specific files more generally. 2013-02-26 17:28:07 +00:00
Alexander Ljungberg 9ce5c1c4d7 Fixed: alignment in CPGrahicsTest.
Refs #1801.
2013-02-26 16:28:15 +00:00
Alexander Ljungberg a0b9efe1fd Fixed: CGPathMoveToPoint problem after a0115962.
Without this fix, CGPathMoveToPoint would not actually move to the point if there had been at least one previous CGPath command (a current path existed) but it was not a move to point command.

This fix ensures move to point is effective in all cases.

Fixes #1801.
2013-02-26 16:27:54 +00:00
Alexander Ljungberg 1aa57ca11b Test: expose errors in CGPathMoveToPoint.
This test highlights the problem described by issue #1801, and exposes that CGPathMoveToPoint is in fact not working correctly after the fix either.
2013-02-26 16:27:54 +00:00
Andrew Hankinson e10ce7a445 Fix #1359: Figure out the best shell config file
This fix adds a little more intelligence to the bootstrap.sh script.

If a user is using ZSH or BASH it will recognize those and append to the appropriate config file, creating .profile if necessary.

If the user's shell cannot be read from the $SHELL variable, it will attempt to find the first suitable configuration file in the user's home directory. If none can be found, it will create .profile.

This was based off the Wikipedia article on Unix shells and the configuration files they will read. The only shells that are not supported by this patch should be csh and tcsh.
2013-02-26 11:13:35 -05:00
aparajita cf9ce6ac60 Merge pull request #1613 from cacaodev/CPTableViewLion
CPTableView : view-based table and new Lion API
2013-02-26 07:29:46 -08:00
cacaodev 10d120ccfd Removed tracing in test apps. Added CPTrace.j in Tests/Manual/, available for any app who wants to import and use it. Added utility function computing moving average. 2013-02-26 16:06:02 +01:00
Aparajita Fishman 2cb3450cf8 Fixed: CGPathEqualToPath did not compare all subpath types
The implementation of CGPathEqualToPath did not compare all of the subpath types now supported by CGPath. In addition, it referred to subpath properties that no longer exist.

The implementation now compares all properties of all supported subpath types.

Closes #1246
2013-02-26 08:41:27 -05: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 05012985bb Merge pull request #1801 from mrcarlberg/cgpath_typo
Fixed typo in CGPath.j
2013-02-26 04:34:54 -08:00
Martin Carlberg 93c9a70aa0 Fixed typo 2013-02-26 12:44:37 +01:00
cacaodev 7d03483210 Merge remote-tracking branch 'upstream/master' into CPTableViewLion
Conflicts:
	AppKit/CPView.j
2013-02-26 11:56:18 +01:00
Martin Carlberg c17053f71a Removed test line 2013-02-26 08:53:12 +01:00
Aparajita Fishman fc9001353f Fixed: CPObjectController -setContent potentially called too early
Previously setContent: was called first, before the rest of the object was initialized. This potentially could have unexpected results because setContent has many side effects.

This commit waits until the object is completely initialized before calling setContent.
2013-02-25 21:22:45 -05:00
aparajita 6a8cba521b Merge pull request #1627 from ggsato/CPArrayControllerFirstSelectionTest
a suggested fix for CPArrayController selection binding failure in retri...
2013-02-25 18:16:04 -08:00
Aparajita Fishman 471641c228 Fixed: subviews in cib did not receive view(Will/Did)MoveToSuperview:
In Cocoa, viewWillMoveToSuperview: and viewDidMoveToSuperview: are called when views are instantiated from code or from a nib.

Previously in Cappuccino, when a view was instantiated from a cib, the _subviews of the view were directly set from the decoded subview array. This short-circuited all of the normal notifications a view receives when added to a superview, including viewWillMoveToSuperview: and viewDidMoveToSuperview:. As a result, some views that override these methods, such as CPSearchField, were not set up correctly when instantiated from a cib.

With this commit, subviews instantiated from a cib are manually added to their superview, thus ensuring they go through the same cycle as views instantiated from code, and ensuring that viewWillMoveToSuperview: and viewDidMoveToSuperview: are called.

Closes #1699
2013-02-25 20:09:18 -05:00
Aparajita Fishman 887421c9fa Fixed: window content view overlapped window frame
Previously, the content view of almost all window types
could overlap the frame of the window.

This is a follow on to b28429f which insets the content view
from the frame for all relevant window types.

Refs #1798
2013-02-25 17:50:12 -05:00
Aparajita Fishman cbe8659cc7 Docs: fixed mistake in comments 2013-02-25 17:27:34 -05:00
Aparajita Fishman b28429f940 Fixed: window content view was not inset from the frame
Previously, _CPStandardWindowView did not inset the content view rect
from the window frame, thus its contents could overlap the window frame.

Now the content view is correctly inset so that content view content
is clipped to the window frame, except for the corners. Because the
corners are round and the window frame is a background color, they
can still be overlapped. this will be fixed in a later commit.

Closes #1798
2013-02-25 17:15:26 -05:00