Commit Graph
284 Commits
Author SHA1 Message Date
Aparajita Fishman a736bb4e93 fix (CPWindow): prevent empty content view when resizing a window
Previously, windows with no minimum size could be resized
by the user such that the content view was completely hidden, and then
resized such that the window was effectively turned inside out.
This obviously needed to be fixed.

Now, when the user resizes a window, each _CPWindowView subclass
is asked for the minimum resize size, with the size being additively
set by each subclass. This minimum size takes into account things
like the title bar, divider line, and close button, and always leaves
at least 2px height for the content view.

The user-requested size is then pinned to the minimum resize size.

In the process of fixing this bug, I discovered in the Cocoa docs
that the CPWindow -setFrame: methods should ignore minSize and maxSize.

Other changes:
- Take the divider height into account in contentRectForFrameRect for titled windows.
- Use _CG macros and fix formatting.

Closes #1753
2013-02-24 22:44:29 -05:00
Aparajita Fishman a011596231 CGContext fixes/enhancements
- NEW: Retrieve the underlying Image element from a CPImage with -image.
- NEW: You can now render any arbitrary drawing to a pattern context and use that as a fill or stroke pattern. See CGContextCreatePatternContext, CGContextSetFillPattern and CGContextSetStrokePattern. Works in all canvas-enabled browsers, including IE 9+.
- NEW: An example of using a custom rendered pattern is in Tests/Manual/PatternFillTest.
- NEW: Test if a CPImage is a single image (vs. three/nine part) with -isSingleImage.
- FIXED: With canvas, we have to track ourselves whether the context has a path or not.
- FIXED: All shapes except rects may not be added to a path with no context. If you attempt to do so, an error is logged.
- FIXED: CGPath was not setting the start and current point correctly in some cases.
- FIXED: CGContextAddPath was not moving to the path's start point at the beginning.
- FIXED: Removed superfluous CGContextClosePath commands, fixed some drawing sequences.
- FIXED: Misc. formatting.

Sorry, these changes are canvas only (including IE 9+)! I am not going to spend the time to port these fixes to VML (IE 8).
2013-02-23 13:53:20 -05:00
Randall Luecke 041f21d117 Small fix to the CPWindow docs so we dont suggest using "window" as a param name. 2013-02-17 15:23:03 -05:00
Aparajita Fishman abaa1e81f2 Support for multiple-value bindings
- CPView and subclasses support multiple-value hidden bindings.
- CPControl and subclasses support multiple-value enabled bindings.
- CPWindow and CPBox support multiple-value title with pattern bindings.
- CPButton supports multiple argument + target bindings.
- CPImageView and CPTextField support multiple-value editable bindings.
- CPMenuItem supports multiple-value enabled bindings.
- Fixed bugs in CPObjectController with simple collection operators.
- CPColorWell uses black as the placeholder color.
- Runtime object attributes from a cib are applied as they are read, not deferred.
- NSNumberFormatter now reads the number style from the xib.
- Normalized some parameter names.
- Formatting.
- Test app for all binding types.
2013-02-15 12:21:13 -05:00
Andrew Hankinson 933a1be8e1 Fix for #1633: setRepresentedFilename
Without this fix, CPWindow setRepresentedFilename is set as a string, not a CPURL (as specified by the variable type). (With tests)
2013-02-10 17:39:24 -05:00
Alexandre Wilhelm 67b006f385 Fixed the bug about the dividerColor in a standardView 2013-02-06 10:55:49 -08:00
Alexandre Wilhelm 114cd51971 Removed useless code in layoutSubviews 2013-02-04 16:32:51 -08:00
Alexandre Wilhelm eb6bade2cf Fixed the bug abouth the sheet shrinking 2013-02-04 13:05:53 -08:00
Aparajita Fishman d8e4769972 Misc. tweaks
- Removed stray console.error
- Made border of tooltips darker, they were almost invisible, even over a white background
- Added CGAlignStroke and CGAlignCoordinate, they are of general use
2013-02-03 08:39:30 +08:00
Aparajita Fishman 48d711023e Merge branch 'refs/heads/fix-CPWindow-cluster' into cappuccino 2013-02-01 18:42:18 +08:00
Antoine Mercadal 8cbfc79034 makes popover's background and stroke color (both minimal and hud style) themable 2013-01-31 15:25:18 -08:00
Aparajita Fishman 347e9cc811 Move CPWindow+CPDraggingAdditions to CPWindow to avoid circular dependency 2013-01-30 22:36:40 +08:00
Aparajita Fishman 1a26fbf6f4 Rework CPWindow cluster so CPWindow's code is in its file 2013-01-30 22:35:21 +08:00
Aparajita Fishman b7d1ccf9b6 Child window/popover fixes
- Added CPWindow -_parentWindowDidOrderInChild to notify a window when it is directly ordered in by a parent.
- Fixed observing of target view frame changes to work in all possible cases.
- Fixed typo in code introduced in last commit in CPApplication -sendEvent.
2013-01-28 12:36:59 +08:00
Aparajita Fishman fdbef474f0 Final fixes for popovers as child windows
- Fixed case where a dangling transition function was left when closing a popover.
- Fixed case where closing a popover, moving the target view, then reopening the same popover would not reposition the popover when resizing the target view's window.
- Optimized repositioning of popover on target view change.
- Implemented transitional popovers via trapped mouse down events.
- Implemented dequeue: argument of CPApplication -setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue: and -setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue:.
- Fixed some child window behavior when ordering/closing.
- Eliminated no longer necessary window close notification in CPPopover.
- Fixed window title in theme so it doesn't dim when window is main but not key.
2013-01-28 09:32:37 +08:00
Aparajita Fishman c29a54e21a More work on child windows
- Popovers are implemented as child windows.
- Renamed _CPAttachedWindow/_CPAttachedWindowView to _CPPopoverWindow/_CPPopoverWindowView, since that is its only use.
- The default for CPView -acceptsFirstMouse is now NO, per Cocoa. Subclasses override this as necessary.
- _CPWindowView -hitTest returns self it the mouse is within a resize region, which may be outside the window's frame.
- Fixed an off by one bug in CPDomWindowLayer -insertWindow:atIndex:, where inserting a visible window behind a window it is already behind would cause it to move up one from its intended position.
- Updated the ChildWindows and CPPopover test apps.
2013-01-27 10:32:23 +08:00
Aparajita Fishman 25633f03c5 Child window support
- Added child window support with test app
- Miscellaneous cleanup
- Reformatted switches
2013-01-27 10:32:23 +08:00
Aparajita Fishman 93fb849296 Import fixes 2013-01-24 19:18:39 +08:00
Antoine Mercadal fcad7a7fe4 Fix _CPToolTip.j never properly imported 2013-01-23 10:45:42 -08:00
Aparajita Fishman 866e1f00f7 Objj2 compiler fixes
- Each file compiles individually with no errors or warnings.
- Added missing imports.
- Fixed imports to remove circularity.
- Removed unnecessary imports.
- Added missing headers.
- Added missing action_button.png.
- Replace CPMakeRect with CGRectMake.
2013-01-23 15:48:56 +07:00
Aparajita Fishman 4f377bcebe Objj2 compiler fixes
Compiled all files individually:

- Added missing imports.
- Added @class/@global declarations to break circular dependencies.
- Misc. code cleanup.

Conflicts:
	AppKit/CPWindow/_CPWindow.j
	AppKit/Platform/DOM/CPPlatformWindow+DOM.j
2013-01-23 15:48:55 +07:00
Aparajita Fishman e292bf01d7 Fixed mouse down within the resize slop outside a window not resizing 2013-01-20 09:13:17 +07:00
Aparajita Fishman 17f07ee888 capp_lint will not flag CPRectEdge, more linking 2013-01-20 07:24:00 +07:00
Aparajita Fishman 7c831fa19d capp_lint flags deprecated CPPoint/Rect/Size types/functions
- Changed to corresponding CG types/functions in all files
- Fixed some demo app bugs
2013-01-19 16:51:56 +07:00
Aparajita Fishman 24c0f2aedc Merge branch 'refs/heads/inactive-window'
Conflicts:
	AppKit/Themes/Aristo/ThemeDescriptors.j
	AppKit/Themes/Aristo2/ThemeDescriptors.j
2013-01-19 15:15:51 +07:00
Aparajita Fishman 3b7262681c Added inactive state to window title bar
- When a window is neither key nor main the title bar is clearly different
- capp_lint ThemeDescriptors.j
- Renamed some layers in Aristo2 PSD to be more descriptive
- New artwork files for window close buttons
- Removed stray Aristo2 image
2013-01-19 14:20:51 +07:00
Antoine Mercadal a4bfd2c9f7 Add missing imports 2013-01-18 10:38:03 -08:00
Antoine Mercadal 7a419c262e Add missing @class 2013-01-18 10:37:51 -08:00
Antoine Mercadal 40ac3210c4 Add missing import 2013-01-18 10:37:37 -08:00
Antoine Mercadal c9eeab09a1 Add missing import in _CPWindow.j 2013-01-18 10:17:19 -08:00
Martin Carlberg 458fa9d02e Fixed a lot of small bugs found by new warning message from compiler 2013-01-18 14:24:37 +01:00
Antoine Mercadal 6aeb6199f7 Restore line 2013-01-16 18:10:46 -08:00
Alexandre Wilhelm f1fa185383 Fixed bug about sheet/titled/window 2013-01-16 18:06:42 -08:00
Antoine Mercadal a0f4c46cb5 Add missing import 2013-01-16 13:35:01 -08:00
Antoine Mercadal e5de031423 Merge branch 'objj_compiler2' into objj2integration
Conflicts:
	AppKit/CPWindow/CPWindow.j
2013-01-14 11:43:24 -08:00
Antoine Mercadal c0d33a1a19 Merge branch 'master' into Aristo2
Conflicts:
	AppKit/CPAlert.j
2013-01-14 10:57:03 -08:00
Martin Carlberg 6210bd2e6d Merge branch 'master' of https://github.com/cappuccino/cappuccino into objj_compiler2
Conflicts:
	AppKit/CPWindow/CPWindow.j
2013-01-13 22:01:43 +01:00
Aparajita Fishman e464900f8b Merge branch 'key-view-loop'
Conflicts:
	AppKit/CPWindow/CPWindow.j
2013-01-12 09:38:07 +07:00
Alexandre Wilhelm 78949f3620 Changed the way to theme the head of a window 2013-01-11 17:38:54 -08:00
Antoine Mercadal 6432528d37 Merge branch 'master' into Aristo2
Conflicts:
	AppKit/CPWindow/CPWindow.j
2013-01-11 14:05:27 -08:00
Martin Carlberg ed6c35a59f Merge branch 'master' of https://github.com/cappuccino/cappuccino into objj_compiler2
Conflicts:
	AppKit/CPWindow/CPWindow.j
2013-01-11 20:40:35 +01:00
Aparajita Fishman 95511b5311 Window resize tweak...
- If a window is fixed width or fixed height, then no resize cursor is shown and no resize area is active on the edges that cannot be resized.
- Optimized CG calls in CPWindow.
- Added fixed height window to test app.
2013-01-11 21:56:04 +07:00
Antoine Mercadal b6c31757a7 fix a bug in CPWindow using old AppKit resource 2013-01-10 17:55:06 -08:00
Alexandre Wilhelm 18d0cf51ef Removed unused code 2013-01-10 17:32:47 -08:00
Antoine Mercadal 35e29a0615 Fix bug introducing during previous merge 2013-01-10 10:38:10 -08:00
Martin Carlberg 74ad0faffa Merge branch 'master' of https://github.com/cappuccino/cappuccino into objj_compiler2
Conflicts:
	AppKit/CPWindow/CPWindow.j
2013-01-10 19:28:42 +01:00
Antoine Mercadal e13948957c Merge branch 'master' into Aristo2
Conflicts:
	AppKit/CPWindow/CPWindow.j
	AppKit/CPWindow/_CPWindowView.j
2013-01-10 10:24:33 -08:00
aparajita 64915f18ff Merge pull request #1711 from slevenbits/new-window-resize
This commit provides resizing of windows from all sides. The legacy style, which displays a resize thumb in the lower right, can be restored with [CPWindow setGlobalResizeStyle:CPWindowResizeStyleLegacy].
2013-01-10 09:53:07 -08:00
Aparajita Fishman cdc88dbe18 Key view...
- Factored out blur handler from CPTokenField into CPTextField.
- CPTextField will no longer lose focus unnecessarily.
- Changed switch style in CPWindow -sendEvent.
- Added menu bar to KeyViewLoop test app.
2013-01-11 00:18:38 +07:00
Aparajita Fishman b59f96d238 Key view loop enhancements...
- Nested views are now handled recursively as they are in Cocoa.
- Added a nested view test in the test app.
2013-01-10 21:49:54 +07:00