Fixed: when clicking and dragging inside a menu, mouseEntered and mouseExited was mixed up for custom views.
Fixed: Using keyboard navigation in empty CPCollectionView threw exception.
Test: refactor token field test to not rely on ivars.

This will make it easier to extend the test with token fields in windows or popovers.
Fixed: transient popover windows would close on mouse interaction with certain controls.

Without this fix, a transient popover would close if the autocomplete menu of a token field contained in it was clicked.

This happened because the popover considered the click to be on a different window. Although not tested, it's likely the same thing would happen if the menu of a combo pop or a pop up button was clicked.

This fix makes it so that any child window of a popover can be clicked without the popover closing.
Test: manual test for most token field behaviour when in a popover.
Test: popovers in attached sheet 2 test.

The popover test now added exposes a bug:

1. Click Modal Window to open a modal window.
2. Click Popover to open a popover.
3. Click on the first window.

It should not be possible to interact with this window since a modal window is open, but a bug in the modal event handling when transient popovers are open will allow the event to incorrectly pass through to the window.

AttachedSheet2 is turning into a complete window/modality/sheets/alerts/popover interaction test.
Fixed: transient popovers broke modal windows.

Without this fix, opening a transient popover would allow windows other than the modal window (or its children) to be interacted with.

In general, setCallback:forNextEventMatchingMask: did not work right if more than 1 callback was installed.

In the popover case the modal window would install its "any event" callback to control the event loop, but then the popover would add a second callback for mouse down to detect clicks outside of it. This would disrupt the modal event handling and allow mouse clicks (and presumably other events) to escape the modal event catcher.

This fix makes multiple nextEvent callbacks work as one would expect, with later ones taking priority over older ones and reinserted callbacks remaining at a stable priority.

This allows the modal window callback to be at the "bottom" of the handler stack and the popover event handler to be "on top" of that, and to remain that way. In theory more layers of event handling could be layered on top such as 2 simultaneous popovers.

This fix also fixes the dequeue argument in forNextEvent callbacks.
CPTableView formatting

Formatting, whitespace and typo correction.
Added doc for -setItemPrototype: explaining how to setup the item prototype when you want to use bindings for the view.
Merge pull request #1848 from ahankinson/cptableview-documentation-formatting

Formatting: various CPTableView fixes
Uncomment import
Fixed: token field autocomplete menu not receiving mouse events in presence of modal window.

Without this fix, the presence of a modal ancestor window to a token field would lock down the autocomplete menu from mouse interaction.

This fix ensures the token field autocomplete menu accepts mouse events even during the presence of modal widows, just like other auxiliary windows such as pop up menus.
Remove //@class CPClipView
Fixed: platform windows resizable.

Without this fix, a platform window could be resized by clicking just under the menu bar and dragging downwards, even that platform windows are supposed to be the size of the browser window by definition.
Revert "don't allow views from another window to be next/previouskeyViews"

This reverts commit 7fab8d9782d4604c4441e48701f9207e4a2b4229.

This breaks the repsonder chain if it is defined in a view that has no window yet.
Details and reduction here: https://github.com/cappuccino/cappuccino/commit/7fab8d9782d4604c4441e48701f9207e4a2b4229#commitcomment-2781849
lint
Merge pull request #1845 from cacaodev/CPCollectionView-doc

Docs: CPCollectionView-setItemPrototype: method documentation
Merge pull request #1842 from stewa/empty-collectionview-keyboard-navigation-problem

Fixed: using keyboard navigation in empty CPCollectionView threw exception

Previously, if an empty CPCollectionView was first responder and keyboard navigation was used, a CPInvalidArgumentException (Range {-1, 1} is out of bounds) was thrown.

This commit checks for an empty collection, eliminating the exception.
Merge pull request #1811 from stewa/fix-menu-custom-views-reverse-mouse-event

Fixed: mouseEntered and mouseExited mixed up for custom views in menu

Previously, when clicking and dragging inside a menu, mouseEntered and mouseExited were sent to the wrong views.

This commit correctly sends mouseExited to the previous hovered view, then mouseEntered to the new hovered view.
Fixed: sheets should not be resizable from the top

Previously, sheets could be resized from the top, which would destroy the illusion of being attached to the top of the parent window.

With this commit, sheets are prevented from being resized by the user from the top edge.