Without this fix, -CPView convertPoint:fromView was broken due to the changes made in #1998. In particular, the transform for the fromView would be calculated and then just thrown away if the views were in the same window. This happened to work in some specific cases and the lack of unit tests concealed the error.
This fix properly applies the transforms when two views are in the same window without one of them necessarily being inside the other.
Refs #1998.
This PR adds a new feature for CPControl. Now when leaving the control, the userInfo of the notification CPTextDidEndEditingNotification contains the last movements of the control as in COCOA
Test app in Tests/Manual/CPTextFieldMovementsTest
Previously shouldSelectTableColumn wasn't called in CPTableView and CPOutlineView.
This PR resolves this issue, shouldSelectTableColumn is now called between selectionShouldChangeInTableView and tableViewSelectionIsChanging as in COCOA.
Test app Tests/Manual/TableTest/DelegateSelectionTest/
Previously the delegate method shouldSelectItem didn't work in CPOutlineView.
It didn't work because the checking method _delegateRespondsToSelectionIndexesForProposedSelection and _delegateRespondsToShouldSelectRow didn't check if the real delegate of the outlineView implemented the methods
Previously the method shouldSelectRow was called even it's the method selectionIndexesForProposedSelection was implemented by the delegate. Now it works as in Cocoa.
The method selectionIndexesForProposedSelection is called when it has to be called, like in Cocoa.
This PR adds new methods to check and call the delegate/datasource methods more easily
Test app in Tests/Manual/TableTest/DelegateSelectionTest/
Previously the call of the delegate method of a CPTableView weren't call in the good order, specially the selecting method.
Now it works as in Cocoa.
Fixed typos
Test app in Tests/Manual/TableTest/DelegateSelectionTest
This PR adds the support of scaling in CPView.
There are two new public methods in CPView : -(void)scaleUnitSquareToSize: and -(void)setScaleSize:
-(void)scaleUnitSquareToSize: works exactly as in COCOA, it means if you set a first scale to 0.5 and then 0.5 again, the scaleSize of the view will be 0.25
-(void)setScaleSize: works with the value given. If you set 0.5 after you just seted 0.5 the scaleSize will be 0.5. This method is definitly better in using, specially when using the scaleSize binding with a slider.
Test app in Tests/Manual/ScalingTest
Previously, using a truncating line break mode on a CPTextField and setting the string value to "test test" was displaying "test test". This patch changes the css white-space property from "nowrap" to "pre" which preserves the white spaces.
Previously, if a window had an autoresizingMask and was marked as not being constrained (for example _CPMenuBarWindow), and the CPWindowConstrainToScreen was set to NO, resizing the platform window would not autoresize the window.
This commit ensures that windows that autoresize but don't care about constraining will resize with the platform window no matter what.
Fixes#1981.
Previously when opening a submenu from a menu, the main menu disappears because a issue with the poolMenuWindow.
This PR fixes this bug.
It also handle more properly the case when an user is making several right clicks on a responder (origin problem with the ghost menu).
Fixed#1887
Copy, cut and delete are now disabled if there's no selection in the active text field. Cut, paste and delete are greyed out if the text field is not editable (a label).
Refs #1964.
When the Edit menu is used to cut or to paste, Cappuccino needs to do all the work of making it happen. But the current code relied on the browser doing part of the work.
This fix adds new state so CPTextField can know if it should expect the browser to do some of the work or not.
Refs #1964.
This made it impossible to select some (non-editable) text, and then to click a Cappuccino menu option like Edit > Copy. Upon the click of Edit, the just selected text would be lost.
This was caused by some very mysterious code focusing and blurring an input every time propagation was stopped. Since it wasn't documented, the snippet was just removed for now. If it turns out it was useful we'll need to add it back and make sure it's not called in this scenario (while documenting it properly).
Refs #1964.
Previously, addChildWindow:ordered: was setting the platform window of the child window.
This patch restore the correct behaviour, and fix a bug with _CPAutocompleteMenu. Now the autocomplete menu is opened as a child of its textfield window using the correct platform window.
Previously it was possible to have a highlighted CPMenuItem for a disabled CPMenuItem. (To get that, select an item, close the menu, disabled the item manually and then open the menu again).
Now it is not possible to get this behavior.
Previously, addChildWindow:ordered: did not set not the child window's platform window. This could result to open them in the wrong browser window. This patch makes sure to set the parent's platform window as the child window's platform window.
Previously if - CPTextField `deleteBackward:` was invoked without it being a browser backspace key event for an actively edited text field, the first character in the current selection would not be deleted.
This fix makes it so that `deleteBackward:` works properly from any caller. The fix also undoes a mistake in a recent previous commit which prevented the text field from visually updating after deletion.