Commit Graph
577 Commits
Author SHA1 Message Date
Antoine Mercadal 547764e3c1 FIXED: Always call [super awakeFromCib] in CPView subclasses 2015-08-14 01:43:55 -07:00
Antoine Mercadal 6420a51dd0 FIXED: crash when a cell based table view contains a dataview that contains an editable text field
Previously, CPTableView was listening to all end editing notifications in cell-based mode.
This caused a crash if the textfield is an actually subview of a dataview.

This patch ensures to listen only editing did end notification for direct subview of tableView.
2015-08-03 15:00:04 -07:00
Alexandre Wilhelm d69ae60bcb Fixed: themeState of an editing CPTextField in a cell based CPTableView
Previously, when having a CPTableView cell based, the themeState of the textField were wrong. The text color was black as every textField was considered as editable. The CPTableView handled differently the textField, as long a textField is not editing, the textField is mark as non editable. Previously, the textFields were considered editable all the time.

More informations here : https://groups.google.com/forum/?fromgroups#!topic/objectivej/zImy4sj0Xz4
2015-05-27 14:57:28 -07:00
Alexandre Wilhelm 34f724a4a4 Fixed: capp_lint fixes 2015-04-22 11:22:44 -07: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
Alexandre Wilhelm 59afb012b6 Fixed: make sure to lay out the tableView when calling the method editColumn:row:withEvent:select: 2015-03-14 16:18:22 -07:00
Alexandre Wilhelm 7d9a52301c Fixed: reloadData in CPTableView run the runLoop
Previously, when reloading a CPTableView the run loop was explicitly call to layout the tableView. This is not the case in Cocoa.
You can call several times the method reloadData and this will only lay out the tableView one time.
2015-03-14 14:25:04 -07:00
Alexandre Wilhelm 98d0a397a3 Fixed: _clickedRow and _clickedColumn not updated as in correclty
Previously, the var clickedRow and clickedColumn were only updated with a doubleClick.
Now clickedRow and clickedColumn are updated in the scope of a trackMouse as in cocoa. Once the method stopTracking:at:mouseIsUp is called, clickedRow and clickedColumn are set to -1 again. This var can't be used outside a user event.
2015-03-11 10:18:21 -07:00
Alexandre Wilhelm 2028642efe Typo: removed console.error in CPTableView 2015-02-20 10:58:25 -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
cacaodev bf202f25dd Merge remote-tracking branch 'upstream/master' into CPTableView-issue2310 2015-02-15 18:44:32 +01:00
cacaodev 2d2472dbe9 FIXED: The firstResponder state of a table dataView was not correctly removed on dismiss. fixes #2310 2015-02-15 11:00:25 +01:00
Antoine Mercadal bf05155c5e [FIXED] Merge issues
During a previous merge the call to ..willDisplayView:.. and
…willRemoveView:.. for delegate methods were removed from CPTableView
and CPOutlineView
2015-02-12 16:01:38 -08:00
cacaodev c5db677663 Style, typos, tabs. 2015-02-08 21:07:27 +01:00
cacaodev 452e03b894 FIXED: remove observation in -init. It was already handled in -viewWillMoveToWindow: 2015-01-27 22:01:32 +01:00
cacaodev 01bdddaee4 Merge 34c7ded (CPSelectionHighlightStyleNone and mouse click) 2015-01-27 13:09:33 +01:00
cacaodev f7c82b0920 FIXED : -startObservingFirstResponder: remaining renaming. 2015-01-27 13:04:45 +01:00
cacaodev 820eeb7752 _stopObservingFirstResponder -> _stopObservingFirstResponderForWindow: 2015-01-25 17:30:14 +01: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
Alexandre Wilhelm 30413e6f8f Merged conflict in CPComboBox 2014-11-26 16:00:03 -08:00
Alexandre Wilhelm 51940cea3d Fixed: leak memory with CPTableViews delegate 2014-11-26 15:05:22 -08:00
Alexandre Wilhelm b36cc8f1e9 Fixed: Memory leak in CPTableView, CPScrollView
Prevously, when removing a CPTableView or a CPScrollView, the CPNotificationCenter kept a reference of these observers in the notification center.

Now, the CPNotificationCenter does only have a observer when necessary.
2014-11-25 17:33:17 -08:00
Antoine Mercadal f9275a70af FIXED: New warnings reveleaded by ivar type checking
This patch fixes all new warnings
2014-11-06 10:17:05 -08:00
Antoine Mercadal 328172cfeb Merge pull request #2230 from Dogild/TableViewBezeledTextField
Fixed: bezeled is set to yes when making a right click on a non-selectable CPTextField in a cell of a CPTableView
2014-10-27 13:51:00 -07:00
Alexandre Wilhelm 34c7dededf Fixed: hitTest method returns the wrong view in the CPTableView when the selectionStyle is set to CPTableViewSelectionHighlightStyleNone
Previously, when having a CPTableView with a selectionStyle set to CPTableViewSelectionHighlightStyleNone, we needed two clicks to be able to select or click on a control of the cell. Now we only need one click as in Cocoa.

This is fixed by changing the method hitTest and returning the good view which can become the firstResponder.
2014-10-24 14:06:42 -07:00
Alexandre Wilhelm e56cc85e96 Fixed: bezeled is set to yes when making a right click on a non-selectable CPTextField in a cell of a CPTableView
Previously, when making a right click on a non-selectable CPTextField which is contained in a dataView of a CPTableView set the bezel attribute to yes.

Now, when making this things, Cappuccino will check if the CPTextField if editable or not.
2014-10-23 16:24:04 -07:00
Alexandre Wilhelm cbef08eeff Fixed: prototype of method unfocusedSelectionGradientColors is void
Previously the prototype method of unfocusedSelectionGradientColors as void, now it's CPColor
2014-10-23 10:59:54 -07:00
cacaodev fc2e16dd4e Merge remote-tracking branch 'upstream/master' into CPTableView-enumerateRows
Conflicts:
	AppKit/CPTableView.j
2014-10-01 14:11:57 +02:00
Alexandre Wilhelm b617d60b60 Fixed: Several views of _CPTableDrawView created when encoding and decoding a CPTableView
Previously, when encoding and decoding a CPTableView, the tableView had several _CPTableDrawView (in the subviews).
Now when encoding, we make sure to remove _CPTableDrawView from its superview.
2014-09-30 15:28:26 -07:00
cacaodev e156badef6 FIXED: After a column removal, columns were not at the right place and non exposed views from the removed column were not removed 2014-09-25 23:14:54 +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 1a414ac69c view-based table: always use the proto UID as view identifier
-setDataView: was not working because the caching system was picking
views cached with the column identifier which is persistent.

Test: CPTableViewTest -testLayout
2014-09-23 13:56:52 +02:00
cacaodev f82099143f CPTableView: -_reloadDataViewsImmediately -> -reloadData
CPTableColumn: binder:-setValueFor:  is a simple data reload.
2014-09-23 12:17:52 +02:00
Alexandre Wilhelm 903cc8ee83 Fixed: CPThemeStateSelectedDataView still set when removing a view
Previously, when removing a view from a CPTableView, the themeState CPThemeStateSelectedDataView wasn't unset. Now it does.
2014-09-19 09:59:56 -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 3e8afaeae4 Fixed: -removeTableColumn: now works without error. OJTest in AppKit/CPTableColumnTest.j, manual test in TableTest/TestTanleColumn/
Fixed: Added an out of bounds check to _unloadDataViews:...
Revert: revert -reloadData to the previous behavior where views & data were reloaded, not only data. That's what cocoa does for view based tables.
2014-09-11 23:14:21 +02:00
Alexandre Wilhelm 1fcf13d149 Fixed: added optimization for releasing observers 2014-08-20 16:13:59 -07:00
Alexandre Wilhelm abdf1156d4 Fixed: memory leaks with CPNotifications
Previously, when removing a view, Cappuccino didn't clean the notification center. The notification center kept in reference old views.

This PR fix this issue. When a CPView is added to a view, the methods _removeObservers and _addObservers are called. In these both methods we remove and add the observer to the notification center if needed. _removeObservers and _addObservers are called for the view and its subviews. These both methods are called through the method viewWillMoveToSuperview.

When a CPView is removed, we only call the method _removeObservers.
When a CPWindow is closed, we call the method _removeObservers on its contentView.
When a CPWindow is about to be opened, we call the method _removeObservers and _addObservers on its contentView.

Refs #1880
Refs #2024

Test app in Tests/Manual/AttachedSheet2/SheetWindowController.j
2014-08-19 17:45:01 -07:00
cacaodev 78c5522966 Merge remote-tracking branch 'upstream/master' into CPTableView-enumerateRows
Conflicts:
	AppKit/CPTableView.j
2014-06-11 19:42:33 +02:00
Alexander Ljungberg 2a78da6d07 Formatting and comment on table view first responder change.
Refs #2133.
2014-06-10 11:03:08 +02:00
Alexandre Wilhelm c64e5a5799 Fixed: font cell of a CPTableView comes black when editing another cell
Previously, when editing a cell, the other cells of the tableView lost the themeState of the firstResponder.
Now the other cells, as the tableView, keep this state when a cell is editing.

Fixed #2133
2014-06-04 11:19:32 -07:00
cacaodev da82887cc0 Merge remote-tracking branch 'upstream/master' into CPTableView-enumerateRows 2014-05-12 18:41:41 +02:00
Alexander Ljungberg a4702d48b4 Fixed: illegible white on grey text in table view.
If a table view row is selected its text will turn white to offset against the blue selection colour. However, when the table is not the first responder, or the window is in is not the key window, the light grey highlight colour is used instead, but the text remains white.

This fix ensures the text becomes black in this case by utilising the new first responder and key window theme states.

Fixes #2009, fixes #2001.
2014-05-12 15:21:08 +01:00
Aparajita Fishman 5923f7d859 Fixed: oops, it should have been single backslashes. 2014-05-08 17:40:51 -04:00
Aparajita Fishman 57f6a5ca8c Tweak: use continuation lines so the tmLanguage symbol parser works correctly. 2014-05-08 17:08:27 -04:00
cacaodev 45a59f9aec Code style
Rename _numberOfRowsDidChange -> _dataViewsNeedReloadAfterContentChange.
Subclasses use this method to tell if a full view reloading is needed
when calling -reloadData.
Currently CPOutlineView returns YES - this is the previous behavior.

Added private - (void)_reloadDataForRowIndexes:(CPIndexSet)rowIndexes
columnIndexes:(CPIndexSet)columnIndexes
This is the internal method for reloading objectValues only.
2014-04-19 09:10:51 +02:00
cacaodev 3a97db804f Merge remote-tracking branch 'upstream/master' into CPTableView-enumerateRows
Possible regression from #fe260a8
Regression: -reloadData does not reload views any more even if the table is empty (see CPOutlineViewCibTest).
BUG: -removeTableColumn: error.

Conflicts:
	AppKit/CPOutlineView.j
	AppKit/CPTableHeaderView.j
	AppKit/CPTableView.j
2014-04-18 18:12:55 +02:00
Antoine Mercadal 8bdaeab998 FIXED: Selection behavior when implementing selectionIndexesForProposedSelection
Previously, when delegates implemented tableView:selectionIndexesForProposedSelection:, the selection with arrow were broken. This patch ensure to try to select next/previous row if the current row cannot be selected.
It also cleans up the selection indexes when sending selectAll: as Cocoa does.
2014-04-03 14:10:00 -07:00
Alexandre Wilhelm c1fb54ecad New: Added delegate tableView:willRemoveView:forTableColumn:row
Added delegate tableView:willRemoveView:forTableColumn:row in CPTableView
2014-04-02 13:55:39 -07:00