Commit Graph
394 Commits
Author SHA1 Message Date
Antoine Mercadal 7e4e1ec68f FIXED: lot's of error with CPAppearance 2015-08-14 01:44:22 -07:00
Antoine Mercadal 541a7974e0 NEW: effectiveAppearance and new CPThemeState
Each default (and only supported) CPAppearance now have an associated
theme state. As the appearance is correctly propagated in CPViews
hierarchy, it is now possible to have dark controls when the an
ancestor view has a dark appearance.

Added automated tests
2015-08-13 23:40:27 -07:00
Alexandre Wilhelm 923d32ee6d Test: finally put the init of the CPApplication in the instance method setUp. See previous commit #6fe9dae3d62af995f2481bfebdd706aeb0b21365 2015-07-07 15:04:29 -07:00
Alexandre Wilhelm 6fe9dae3d6 Fixed: AppKit unit-tests are not standalone
Previously, every AppKit tests used the same sharedApplication. Due to this implementation, a could not pass because a previous test made failed the current test. For instance, a test could fail because the window of the previous test resigned (just imagine a new window is the key window in the current test), and this resign could raise an error. The error was displayed for the current test thought this test was perfect !

We now instead of using sharedApplication create a new CPApplication per unit-test file in the class method setUp.
2015-07-07 14:12:19 -07:00
Alexandre Wilhelm 4c1e22b0f6 Fixed: travis failed because the unittests tried to display a layer
Previously, the unittests for the CPDatePicker broke the tests suite of cappuccino. A CPDatePicker uses a CALayer, and the CALayer display methods wasn't wrap in a #if PLATFOrM(DOM). Now it does, so during the tests we do not try to access do the element document anymore.

This PR fixes also some warnings when compiling.
2015-07-06 14:14:39 -07:00
Alexandre Wilhelm 1ad8d34ecb Fixed: fixed travis with datePicker test 2015-07-02 15:12:18 -07:00
Alexandre Wilhelm 1f983db47c Fixed: refactoring of the class _CPDatePickerTextField.j. We now use the method called by interpreteKeyEvents instead of handling the key equivalent in performKeyEquivalent 2015-06-29 14:28:28 -07:00
Alexandre Wilhelm 92cdb27e23 Fixed: documentVisibleRect in CPScrollView does not return the expected result
Previously, the method documentVisibleRect did not return the expected result. An issue happened when using this method on a scaled view. The converted rect was converted in the wrong context.

Unit test in Tests/AppKit/CPScrollViewTest.j

Fixed #2356
2015-05-19 14:30:09 -07:00
Alexandre Wilhelm 44c686f494 Merge pull request #2323 from mrcarlberg/scroll_rect_to_visible_with_large_rect
Fixed: Method scrollRectToVisible:(CGRect)aRect in CPView didn’t work...
2015-04-13 13:12:27 -07:00
Alexandre Wilhelm 6efe563a69 Fixed: method _initOtherEventWithType: in CPEvent did not save the given windowNumber 2015-04-10 10:51:47 -07:00
Antoine Mercadal 007ca4c6b0 Merge pull request #2336 from cpasslack/cpasslack/corruptDecimalNumberAfterDecodingFix
Fixed: Encoding a [CPDecimalNumber zero] causes a corrupt CPDecimalNumbe...
2015-03-31 11:25:20 -07:00
Martin Carlberg b3dfce7b5a Fixed: Compared the rects minimum x value with it self instead of the visible minimum x value. Also fixed the test case to catch this. 2015-03-31 17:30:57 +02:00
Christian Passlack bb9049bef4 Code-styling to match official style-guide. 2015-03-23 20:45:31 +01:00
Christian Passlack 94f15aba40 Updated Test-Cases of CPNumberFormater and CPTextfield because of the
changes for fix #2332. The test-cased failed, because now a
a CPDecimalNumber has a different UID compared to a CPNumber with the same
value. That means isEqual: will return false. In the test-cases the formatter now
generates CPNumbers to make the two Numbers compareable via isEqual.
2015-03-23 20:30:01 +01:00
cacaodev bd673a3f26 FIXED: CPSegmentedControl -setSelectedSegment:-1
previously, -setSelectedSegment:-1 was not visualy deselecting the
segments and selectedSegment was not set to -1.
2015-03-20 21:19:36 +01:00
Antoine Mercadal f2c5515317 Merge pull request #2334 from Dogild/ReloadDataTableViewRunLoop
Fixed: reloadData in CPTableView run the runLoop
2015-03-19 18:22:24 -07:00
cacaodev 7c095175ab Merge pull request #2324 from cacaodev/CPSegmentedControl-indexed-mutation
CPSegmentedControl
FIXED: widthForSegment: and frameForSegment: now return the correct values when the segments sizeToFit
Added indexed accessors for the segment object
Improved tile performance
With manual and ojtest
2015-03-16 12:13:03 +01:00
Alexandre Wilhelm 3b2635014c Fixed: the developer need to perform the run loop to get some informations in CPTableView. Now, the run loop is performed by the tableview 2015-03-15 19:38:06 -07:00
cacaodev 755040444a Fixed selection updating again.
This time it’s right. CPSegmentedControl does in fact allow empty
selection (-1) in cocoa.
Updated ojtets.
2015-03-15 20:42:17 +01:00
Antoine Mercadal 40c81b88d4 Merge branch 'master' of https://github.com/cappuccino/cappuccino 2015-03-05 17:00:53 -08:00
Antoine Mercadal 027a317291 FIXED: Memory Leak with tooltips
Only populate the tooltips handler functions when necessary (when there is a tooltip and when the view is in a window) or clear them otherwise.

Tests in /Tests/AppKit/CPViewTest.j
2015-03-05 16:59:37 -08:00
Martin Carlberg 8e497e2a48 Fixed: Method scrollRectToVisible:(CGRect)aRect in CPView didn’t work correctly if aRect is larger then the visible rect.
If aRect is larger then the visible rect this method scrolled all they way to the opposite edge instead of the nearest.
2015-03-02 16:30:02 +01:00
cacaodev 3ea230fd17 Improved tests for segmented control
Added manual test showing fix for setLabel:forSegment for flexible
segments.
Added ojtest showing that the selection is preserved when a selected
segment is removed.
2015-02-27 13:33:11 +01:00
Alexandre Wilhelm 63f634af00 Merge pull request #2300 from ahankinson/fix-domserver-dead-code
Fixed: Remove unreachable code in CPDOMDisplayServer.h
2015-02-25 17:28:15 -08:00
Antoine Mercadal 1c9e9da10f Merge pull request #2315 from Dogild/CPTableView-ViewAtColumn
New: Added method viewAtColumn:row:makeIfNecessary: in CPTableView
2015-02-25 11:31:36 -08:00
Antoine Mercadal 71c0ba63ca Merge pull request #2318 from cacaodev/CPTableView-columnbinding
FIXED: Exception when rows were removed in a table with binded columns.
2015-02-25 11:25:53 -08:00
cacaodev 808411bc0b FIXED: Exception when rows were removed in a table with binded columns.
Before this fix, the CPTableColumn binder was not correctly reloading
the table when the number of rows changed. Now we reload fully the
dataviews when the number of rows changes. If no rows are
inserted/deleted, there is an optimization: we just need to reload the
objectValues and leave the dataviews untouched.

With Test in Tests/AppKitCPTableViewTest.j
Fixes #2317
2015-02-24 16:15:20 +01:00
Alexandre Wilhelm f82b478a77 New: added the method setNeedsLayout:
This PR adds the possibility to layout or not a CPView.
Previously, once setNeedsLayout was called on a CPView, it wasn't possible to cancel the layout of the view.
Now we can as in cocoa. The method setNeedsLayout will still work (it calls the method setNeedsLayout: with YES).

UnitTests in Tests/AppKit/CPViewTest.j
2015-02-20 14:36:27 -08:00
Alexandre Wilhelm 9af9bd0c4c New: Added method viewAtColumn:row:makeIfNecessary: in CPTableView
This PR adds the method viewAtColumn:row:makeIfNecessary: in CPTableView.
This method first attempts to return an available view, which is generally in the visible area. If there is no available view, and makeIfNecessary is YES, a prepared temporary view is returned. If makeIfNecessary is NO, and the view is not available, nil will be returned.
An exception will be thrown if row is an invalid row index and if column is an invalid column index.
The returned result should generally not be held onto for longer than the current run loop cycle. Instead they should re-query the table view for the row view.

UnitTests in Tests/AppKit/CPTableViewTests.j
2015-02-20 10:54:45 -08:00
cacaodev f248788d14 Test for #2310 fix, CPTableView whitespace.
Note: It seems that CPThemeStateKeyWindow cannot be tested in the
console. A manual test with multiple windows and table views exists in
Manual/TableTest/OldTest/
2015-02-15 19:29:29 +01:00
Antoine Mercadal 187a017c4d Merge pull request #2305 from Dogild/DuplicateTests
Fixed: Duplicate unit-tests
2015-02-06 15:58:27 -08:00
Alexandre Wilhelm 6a1543cb82 Fixed: Duplicate unit-tests
Previously, some unit-tests had the same name in a test file. Now they have unique name.
2015-02-03 16:46:49 -08:00
cacaodev 2e25ef6f81 Merge remote-tracking branch 'upstream/master' into CPTableView-enumerateRows
Conflicts:
	AppKit/CPTableHeaderView.j
	AppKit/CPTableView.j
	Tests/AppKit/CPTableViewTest.j
2015-01-25 17:25:32 +01:00
Andrew Hankinson f96e211cd6 Tests: New tests for CPDOMDisplayServer 2015-01-20 16:19:24 -05:00
Alexandre Wilhelm c7ccff914f Test: added basic test for ordering window 2014-12-02 16:48:44 -08:00
Alexandre Wilhelm 8efb6f8808 Test: added unit test for registered notification for the tableView 2014-12-02 16:39:07 -08:00
Alexandre Wilhelm 006bf72c17 Test: added unit test for registered notification for the scrollView 2014-12-02 16:38:55 -08:00
Alexandre Wilhelm ec3af04f29 Test: added tests for CPComboBox 2014-12-02 16:38:17 -08:00
Alexandre Wilhelm b45399a045 Test: added class notificationHelper with the method registeredNotificationsForObserver 2014-12-02 16:37:57 -08:00
Antoine Mercadal 243024e232 Fix broken tests due to new objj type checks 2014-11-26 13:12:39 -08:00
Martin Carlberg 5b7afd72e3 Fixed: Test cases now use correct options for KVO change dictionaries 2014-10-09 19:30:05 +02:00
cacaodev ae6d379cce Improve TestTableColumn manual test to expose a bug when resizing after a column remove 2014-09-25 23:12:25 +02:00
Antoine Mercadal 71bfe4dd44 Merge pull request #2176 from Dogild/CPView-addSubview
Fixed: Methods viewDidMoveToSuperview viewDidMoveToWindow viewWillMoveToSuperview viewWillMoveToWindow not called as in Cocoa
2014-09-24 12:22:07 -07:00
cacaodev 2dccd2f30b NEW: ojtest for method - (void)getColumn:(Function)columnRef row:(Function)rowRef forView:(CPView)aView
This internal method is used for editing and public methods rowForView: and columnForView
2014-09-18 19:23:16 +02:00
cacaodev a2755221d0 The cocoa behavior is:
Exclusive bindings are impossible in IB
Possible in code (tested with segmented control and selectedIndex & selectedTag) but then you get unexpected behavior. A segment can be selected after a click and then
changes to another segment.
After this commit, extra exclusive bindings are just ignored and we warn about it.
2014-09-12 22:33:50 +02:00
cacaodev 68b193a782 NEW: bind:toObject: ... now checks if another binding mutually exclusive is already binded. Throws an exception if this is the case.
Controls can implement -isExlusiveBinding: to determine if bindings are exclusive. Defaults to NO.
Exclusive bindings are mainly CPSelectedIndexBinding | CPSelectedTagBinding | CPSelectedValueBinding
2014-09-09 20:31:15 +02:00
cacaodev abe2e544bb Merge remote-tracking branch 'upstream/master' into CPTableView-enumerateRows 2014-09-06 21:33:18 +02:00
Alexandre Wilhelm aded1dd4da Merged: manual merged 2014-09-05 13:00:48 -07:00
Antoine Mercadal cf93b72edd Merge pull request #2173 from daboe01/Fixed--collectionViewDidChangeSelection
Fixed: support for outdated collectionViewDidChangeSelection delegate method
2014-09-04 13:57:39 -07:00
Alexandre Wilhelm cf0b4c8f03 Fixed: added CPView test for the method addSubview 2014-08-28 22:23:20 -07:00