Commit Graph
5908 Commits
Author SHA1 Message Date
Alexandre Wilhelm d6e40332c4 Removed comments 2013-10-17 14:32:34 -07:00
Alexandre Wilhelm 4b8a6ee674 Fixed: shouldSelectRow was called with selectionIndexesForProposedSelection
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/
2013-10-17 14:26:19 -07:00
Antoine Mercadal 406a049380 Fixed: Previous commit was preventing to select in the void if selectionShouldChangeInTableView: was not implemented
This patch restore the correct behavior
2013-10-16 16:48:50 -07:00
Alexandre Wilhelm f0a9696634 Fixed typo 2013-10-16 15:03:35 -07:00
Alexandre Wilhelm 016c267e69 Fixed: Delegate method of CPTableView aren't call in the good order
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
2013-10-16 15:01:28 -07:00
Antoine Mercadal ed99833894 Merge pull request #1996 from rgv151/master
PATCH: Implement shouldExpand/Collapse delegate for CPOutlineView
2013-10-15 14:04:46 -07:00
Alexandre Wilhelm ef5f26fd81 New: Added support for scaling in CPView
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
2013-10-15 14:03:26 -07:00
Antoine Mercadal 2f18218ce5 Merge branch 'master' of https://github.com/cappuccino/cappuccino 2013-10-15 12:41:20 -07:00
Antoine Mercadal 0b5a98d3fe FIXED: lineBreakMode set to CPLineBreakByTruncating* was trimming consecutive white spaces
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.
2013-10-15 12:39:03 -07:00
Bruce Doan 918543d617 Merge branch 'master' of https://github.com/cappuccino/cappuccino 2013-10-12 23:00:12 +07:00
Bruce Doan 6f8d6a5b25 Some minor fixes to pass the capp_lint checks 2013-10-09 00:09:30 +07:00
aparajita 95082c3263 Merge pull request #1982 from Dogild/MenuFix
Fixed: Menu disappears when opening a submenu
2013-10-07 04:29:20 -07:00
Bruce Doan 8503081a6f PATCH: Implement shouldExpand/Collapse delegate for CPOutlineView 2013-10-06 23:47:25 +07:00
Alexander Ljungberg eef91c0240 Merge pull request #1976 from Dogild/HighlightedDisabledMenu
Fixed: a disabled CPMenuItem could still have a selected background
2013-09-23 11:22:27 +01:00
Björn Sperber 5cefce1cf0 Respect frameRate when scheduling timer in CPAnimation. Treat a frameRate of 0 as "really fast" instead of CPTimer default (10 fps). 2013-09-19 13:52:49 +02:00
Aparajita Fishman 30441b109f Fixed: windows that were autoresized and not constrainable would obey the global CPWindowConstrainToScreen flag.
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.
2013-08-23 18:28:40 -04:00
Alexandre Wilhelm f17fd6a448 Fixed: Menu disappears when opening a submenu
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
2013-08-23 13:59:11 -07:00
Martin Carlberg 9f7d0578e5 New: Added the basic protocols CPObject and CPCoding 2013-08-22 14:31:15 +02:00
Martin Carlberg 48d98f7ebd Fixed: Added theme attribute 'divider-thickness' to wrong class when doing manual merge. 2013-08-20 11:22:39 +02:00
Martin Carlberg 7044c1cda4 Merge branch 'master' of https://github.com/cappuccino/cappuccino into table_header_divider_thickness 2013-08-20 09:44:17 +02:00
Alexander Ljungberg 594ea6e5cb Simplify. 2013-08-19 22:31:21 +01:00
Alexander Ljungberg 957a572bcd Fixed: missing imports. 2013-08-19 22:31:21 +01:00
Alexander Ljungberg 08eff6ec22 New: grey out Edit menu non applicable items for text fields.
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.
2013-08-19 22:31:21 +01:00
Alexander Ljungberg 5958220bdd New: CPTextField deleteForward:.
This enables delete forward to be activated through action connections to text fields (or the first responder).
2013-08-19 22:31:21 +01:00
Alexander Ljungberg 648dc6e86c New: Edit > Delete menu item support for text fields.
This menu item deletes the current selection if there is one.

Refs #1964.
2013-08-19 22:31:21 +01:00
Alexander Ljungberg 9d43a559fe Fixed: - CPTextField deleteBackward: required selection.
According to the spec, deleteBackward: should remove the element before the insertion point if there is no selection (e.g. actually delete backwards).
2013-08-19 22:31:21 +01:00
Alexander Ljungberg 168738fb93 Return false for mouse handler if propagation is stopped.
Refs #1964.
2013-08-19 22:31:20 +01:00
Alexander Ljungberg 376b3a496e Fixed: copy and paste by Cappuccino Edit menu not working.
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.
2013-08-19 22:31:20 +01:00
Alexander Ljungberg 58d5d7d731 Fixed: selectable text deselected when a menu was clicked.
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.
2013-08-19 22:31:20 +01:00
Antoine Mercadal f637931ba7 FIXED: Bug introduced with my previous commit, preventing popover to open in some cases.
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.
2013-08-15 19:40:40 -07:00
Alexandre Wilhelm ec4b348369 Fixed: a disabled CPMenuItem could still have a selected background
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.
2013-08-15 17:15:51 -07:00
Antoine Mercadal 1e7dd0dc59 FIXED: Bug that could open a child window in the wrong platform window
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.
2013-08-15 13:33:50 -07:00
Alexander Ljungberg 2065c7fbc8 Fixed: CPTextField deleteBackward: leaving 1 character.
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.
2013-08-14 16:23:57 +01:00
Aparajita Fishman 987d2a2d73 Formatting 2013-08-12 23:31:34 -04:00
Aparajita Fishman d6f1c2bc57 Fixed: attempting to use an unsupported built in image in IB would generate an error, but not explain why.
Previously, attempting to use an unsupported built in image such as NSActionTemplate would generate an error message that said, "The image “NSActionTemplate” cannot be found." This would lead the user to think that there was something wrong with nib2cib, instead of understanding that only certain built in images are supported (currently NSAddTemplate and NSRemoveTemplate).

With this commit, an attempt to use an unsupported built in image (where built in is assumed to be any name that matches /^NS[A-Z][A-Za-z]+$/) results in the error message "The built in image “<name>” is not supported."
2013-08-12 15:18:07 -04:00
Martin Carlberg 3b8aedf5aa Merge branch 'master' of https://github.com/cappuccino/cappuccino into protocol 2013-08-12 18:25:00 +02:00
Alexander Ljungberg 8bdbb5d333 Fixed: _CPImageAndTextView unguarded platform access.
This could cause issues during jake deploy or unit testing.
2013-08-12 16:57:50 +01:00
Alexander Ljungberg 638d8de472 New: triple click selectable text field to select all.
This matches Cocoa behaviour. Cocoa also supports double click to select the current word but we currently don't know what word is being clicked. In some browsers (e.g. Safari) this will work natively. Chrome on the other hand selects something random after double click on a non editable div.
2013-08-12 16:57:07 +01:00
Alexander Ljungberg 03acecdec9 New: selectable textfield Select All (Cmd-A, Ctrl-A) support.
Like in Cocoa, a non-editable but selectable text can now be clicked and all text can be selected with the Edit > Select All option or the associated keyboard equivalent. Just like in Cocoa this works on selectable text labels as well (text fields without a bezel).
2013-08-12 16:44:46 +01:00
Alexander Ljungberg 0e7b592786 Fixed: certain editing actions allowed for disabled text fields. 2013-08-12 15:52:36 +01:00
Martin Carlberg bb58a206a8 Fixed: Removed all warnings of conflicting return and parameter types caused by the new compiler 2013-08-12 16:46:14 +02:00
Alexander Ljungberg a90180a92f Fixed: CPTextField copy: only worked for editable text fields.
A non-editable text field does not use an input field, and so does not track what is selected within it. We will use a workaround for now but in a CoreText based text field in the future we'd be likely to always have a correct selectedRange and be able to remove this hack.

Fixes #1972.
2013-08-12 15:43:24 +01:00
Alexander Ljungberg 377618dcd4 New: non-editable but selectable text fields can become the first responder.
Without this change, text fields with setEditable:NO but setSelectable:YES could not become the first responder, and so would not listen for copy: events.

This change allows selectable fields to become the first responder, taking advantage of the distinction between first responder and first key responder maintained internally in CPTextField - a merely selectable field does not become the first key responder.

Refs #1972.
2013-08-12 15:41:10 +01:00
Martin Carlberg 1cfc8139b9 Fixed: Removed double declared ivar 2013-08-12 16:39:54 +02:00
Alexander Ljungberg 4b4ac5d8b7 Fixed: certain actions would edit a non-editable text field. 2013-08-12 15:36:16 +01:00
Aparajita Fishman 8d47b3f048 Fixed: CGContextAddArc would fail if the path was empty.
Previously, CGContextAddArc would not work with an empty path. In Cocoa, CGContextAddArc implicitly starts a path, so it does not require a non-empty path.

This commit allows CGContextAddArc to be used with an empty path.
2013-08-10 17:51:20 -04:00
Aparajita Fishman 06e392ee22 Fixed: CPApplicationDidChangeScreenParametersNotification was sent once for each window.
Should be sent only once per resize.
2013-08-09 15:01:30 -04:00
Aparajita Fishman 3beb753c63 Fixed: when constraining a window resize, the horizontal margin was fixed (and too large).
Previously a fixed margin of 40px was maintained at the left/right of a window when resizing it, which was excessive.

Now the minimum size allowed during a resize is the same as the minimum margin allowed when moving a window, which is determined based on the type of window.
2013-08-09 09:16:43 -04:00
Aparajita Fishman d751fea510 Fixed: constraining window's to the screen did not respect a window's minSize.
Previously, when the platform window was resized, windows were moved/resized to stay within the virtual screen, but if the window had a minimum size, it was not respected.

This commit ensures that if a window has a minimum size, it will always be respected.
2013-08-09 09:12:07 -04:00
Aparajita Fishman 6bec4064b5 Fixed: window width was not constrained when platform window was resized.
Previously window heights were constrained to the usable screen when the platform window (virtual screen) resized, but widths were not. The code was there to constrain the width, but it wasn't being used.

This commit ensures the width constraining code is executed.
2013-08-09 08:28:36 -04:00