Implement Cocoa zoom API on CPWindow and enable zoom button for resizable windows. Zoom window on double-click where drag moves it.
* CPWindow.j:
- Add zoom:, performZoom: and isZoomed, toggling between standard frame and user frame; treat frame within 4 points of standard frame as zoomed.
- Add windowWillUseStandardFrame:defaultFrame: and windowShouldZoom:toFrame: to CPWindowDelegate; consult window subclass when delegate lacks them.
- Take default frame from platform window's usable content frame; keep standard frame within minimum and maximum sizes and usable area.
- Enable performZoom: and zoom: menu items only when window can zoom.
* _CPStandardWindowView.j: Enable zoom button for resizable windows and target window's zoom:.
* _CPWindowView.j: Call performZoom: on double-click where drag moves window.
* CPWindowTest.j: Add tests for zoom toggling, default frame, delegate refusal, maximum size, missing user frame, window subclass standard frame, performZoom: on fixed-size window, menu validation and title bar double-click.
* DropInCompatibilityTest.j: Add test for zoom button enabled only for resizable windows.
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.
- It turns out Cocoa DOES recalculate the loop when calling recalculateKeyViewLoop. It does not wait until selectNext/PreviousKeyView is called.
- Cocoa calculates the key view loop for nibs that do not have one, but does not call recalculateKeyViewLoop.
- If there is no first responder and no initial first responder when a window first becomes key, use the first valid key view, not the first geometric key view.
- Made allViews function a method, not sure why it was a function.
- Unit tests now pass.