Commit Graph
108 Commits
Author SHA1 Message Date
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 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
Martin Carlberg 458fa9d02e Fixed a lot of small bugs found by new warning message from compiler 2013-01-18 14:24:37 +01:00
Martin Carlberg c297e926f9 Compiler now works with jake and can compiler the whole Cappuccino framework. A lot of test cases still fail 2012-12-16 17:38:47 +01:00
Aparajita Fishman 6e40020906 Allow nil value in presence of formatter, the formatter may want to format that 2012-08-09 20:31:26 -07:00
Aparajita Fishman 8444f808f6 By default controls will track the system font size
Use current system font size elsewhere
2012-07-18 09:53:09 -07:00
Aparajita Fishman 73fea44aa2 CPControl now archives/unarchives its formatter
This allows you to use a formatter with a table column's data view.
2012-07-09 21:30:09 -07:00
Aparajita Fishman cae5486ec6 Added missing class checks in +initialize, regularized checking code 2012-06-28 12:05:18 -07:00
Adam Radabaugh 84c8427bb4 Merge branch master 2012-06-23 14:21:45 -06:00
Aparajita Fishman 45da163230 text tweak 2012-06-18 09:31:34 -07:00
Adam Radabaugh 909c6ed171 Fix style issue in CPControl 2012-05-19 16:56:57 -06:00
Adam Radabaugh 919bfb7960 Fix style issue in CPControl 2012-05-18 17:11:04 -06:00
Adam Radabaugh ea0107f67f Enable additional button types in CPButton with manual test. 2012-05-01 15:11:34 -06:00
Aparajita Fishman aeb2671fc0 CPImageView enhancements
- Changed from deprecated image scaling constants to new ones.
- Added support for CPImageScaleProportionallyUpOrDown (thanks BlairDuncan).
- Cleaned up image layout code.
2012-04-12 14:55:46 -04:00
Aparajita Fishman 37d92c1182 Revert "Merge pull request #1438 from aradabaugh/master", it broke a few things
This reverts commit e081dbf127, reversing
changes made to 71e8f0201a.
2012-02-16 08:21:31 -08:00
aradabaugh edd09ef06a Enables additional buttonTypes for CPButton 2012-01-24 22:50:01 -07:00
Aparajita Fishman 918f6fbb8f CPFormatter support, bug fixes...
- Test application.

CPControl
---------
- Moved _formatter declaration up next to value, it was in the Target-Action Support section before.

- sendAction:to: should return a BOOL.

- Support for CPFormatter -editingStringForObjectValue.

- If a nil string is passed to -setStringValue in Cocoa, it raises an invalid parameter assertion and does nothing.

- Per Cocoa, if setting a string value fails, it tries again with an empty string.

- Removed a few extra blank lines.

- Changed NULL to nil.

CPTextField
-----------
- The string value is now cached in _stringValue to avoid constant calls to the formatter.

- There were several places where references to _inputElement were not wrapped with #if PLATFORM(DOM).

- When resigning first responder, if there is a formatter and formatting fails, reject the resignation and keep focus. Also, if the delegate responds to control:didFailToFormatString:errorDescription:, invoke it.

- _willBecomeFirstResponderByClick was not being set to NO when resigning. As a result, if you clicked in a field, tabbed to another field, and tabbed back to the original field, it would not select the text because it thought there was a mouse click.

- Don't send _sendStringValue: in keyUp: if the value has not changed. Previously it would do that for non-printing keys like navigation keys.

- insertNewLine: validates the string the same way resigning does.

- insertNewLine: would not send textDidEndEditing: if the field had no action, but it should.

- insertNewLine: should select all text (per Cocoa).

- insertNewLineIgnoringFieldEditor: and insertTabIgnoringFieldEditor: were not replacing the selection, Cocoa docs say they should.

- Per Cocoa, when setting an object value and there is a formatter, the value is first formatted as a string. If that fails, an object value for an empty string is attempted.

CPFormatter
-----------
- Fixed up the docs to match the method signatures.

- Indicated with "Ref" in argument types if the argument is pass by reference.

- isPartialStringValid:newEditingString:errorDescription: has a default implementation in Cocoa that nils the return values and returns YES.

- Fixed the name of isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:

- isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription: has a default implementation in Cocoa that invokes isPartialStringValid:newEditingString:errorDescription:
2011-07-09 17:05:23 -07:00
Alexander LjungbergandKlaas Pieter Annema 3db61216e1 CPFormatter support for CPControl which actually works. 2011-07-07 16:04:11 +02:00
Alexander LjungbergandKlaas Pieter Annema 06670f2214 CPFormatter support for CPControl. 2011-07-07 16:04:11 +02:00
Alexander Ljungberg 1c0f679f50 Refs #1245. Fixed: setToolTip: belongs in CPView, not CPControl. 2011-05-11 21:36:49 -04:00
Alexander Ljungberg 345d48e224 Refs #1245. Make CPToolTip and CPAttachedWindow internal since they're not part of the Cocoa API. Refactored some code from CPControl to CPToolTip. 2011-05-11 20:35:13 -04:00
Alexander Ljungberg bb97c107c9 Refs #1245. Minor clean up. 2011-05-11 20:02:08 -04:00
Antoine Mercadal 3ddf6031fb Support for tooltips on CPControls 2011-04-26 14:46:30 +02:00
Alexander Ljungberg 11ab9a77ad Minor performance improvement to CPContinuouslyUpdatesValueBindingOption. 2011-03-28 20:12:32 -04:00
Alexander Ljungberg d3836c2a52 Global fixes. 2011-01-24 13:22:07 -03:00
Alexander Ljungberg ea8c29356d More typo and formatting fixes. 2011-01-24 13:17:48 -03:00
Stephen Ierodiaconou 6a942630e4 Fixing spelling mistakes 2011-01-24 11:05:48 +02:00
Randall Luecke 2aa806e52a Docs for CPControl. 2011-01-24 01:18:40 -05:00
Francisco Ryan Tolmasky I 688aed72cb Fix for CPPopUpButton's encoded prior to CPResponder/menu change.
Reviewed by me.
2011-01-18 23:09:43 -08:00
Klaas Pieter Annema 3d5232b308 give objects a chance to change their binder class
- make every object calling getBinding:forObject: aware of this change
- implement _CPCheckBoxValueBinder to handle binding to the value of a checkbox Closes: #1083
- re-implement CPTextField's behavior for controller markers using the new binder class
- disabled some tests that are not compliant with Cocoa
2011-01-07 14:14:19 +01:00
Klaas Pieter Annema 80ec35fd0a Merge branch 'hover-states' 2010-11-17 10:11:11 +01:00
Francisco Ryan Tolmasky I 52f7844aee Made it so .h files are automatically included in AppKit (avoiding needing to manually include Platform.h, etc.).
Also changed a bunch of <AppKit/*> imports to "*" imports.

Reviewed by me.
2010-11-01 11:10:01 -07:00
Aparajita Fishman 0a752be53c Moved methods defined by BRIDGE into real method declarations so they will be included in doxygen docs, lint cleanup. 2010-09-30 08:37:36 -04:00
Klaas Pieter Annema c481d55976 fix hovered state being removed when the mouse leaves a subview of a control 2010-09-17 13:21:54 +02:00
Klaas Pieter Annema 7aa7d61984 Implement hover states.
- Set CPWindow _acceptsMouseMovedEvents default to YES
- Add CPThemeStateHovered to CPTheme
- Add hovered logic to CPControl is hovered
2010-09-17 12:06:01 +02:00
Alexander Ljungberg 9b8cadb91c Fixed some additional accidental globals. Very addictive this. 2010-09-15 17:41:58 -04:00
Aparajita FishmanandAlexander Ljungberg 18696e6bc2 Ensure CPControl -performClick unhighlights the button if the action throws. 2010-08-27 15:58:35 -04:00
Klaas Pieter AnnemaandRoss Boucher 78fd972312 only reverse set the binding on end editing 2010-07-26 22:48:40 -07:00
Ross Boucher 19d5431f60 Revert "slightly delay triggering the action in CPControl performClick: to make sure the click is always visible"
This reverts commit eaf4fa240f.
2010-06-16 08:54:30 -07:00
Klaas Pieter Annema eaf4fa240f slightly delay triggering the action in CPControl performClick: to make sure the click is always visible 2010-06-16 14:16:17 +02:00
Randall Luecke d5ee07fe1b CPControl should not be allowed to performClick: if it's disabled. 2010-06-02 20:43:09 -05:00
Ross Boucher 8fd564b034 Minor cleanup to the current test cases. 2010-05-28 10:54:45 -07:00
Ross Boucher 7c3f94dd87 Merge remote branch 'klaaspieter/bindings-fixes' into bindings
Conflicts:
	AppKit/CPControl.j
	Foundation/CPValueTransformer.j
2010-05-28 10:23:47 -07:00
Klaas Pieter Annema 084da71420 exposed more bindings on CPControl 2010-05-27 15:22:40 +02:00
Alexander Ljungberg ef9d2d1775 Reverse update value binding when control editing stops, not only when the action fires. This causes tabbing out of a text field to update the binding source. Based on the description of the bindings option NSContinuouslyUpdatesValueBindingOption this is the right thing to do: if NSContinuouslyUpdatesValueBindingOption is on, update on every character; "otherwise the update is made only when the user interface item resigns as the responder." 2010-05-26 19:51:51 -04:00
Alexander Ljungberg be13a14330 Hack to make [textField bind:CPValueBinding ...] work. Without this, any observed change leads to a [textField setValue:X forKey:"value"] which in turn leads to a direct ivar access changing the value in textField._value. This means the text field has no idea the value changed and it doesn't update to show the new text. I'm not sure what the right solution should be here. It looks like _replacementKeyPathForBinding should play into this and change the end result to [textField setValue:X forKey:"objectValue"] which would work fine. But currently _replacementKeyPathForBinding applies to the observed key path, not the bound one. 2010-05-26 19:51:28 -04:00
Klaas Pieter Annema 51c90223fc exposed enabled binding on CPControl and made sure CPControl's bindings are only exposed once 2010-05-26 16:44:55 +02:00
Klaas Pieter Annema 6f0ca9d94c Merge branch 'master' into bindings
Conflicts:
	AppKit/CPTableView.j
	AppKit/_CPCornerView.j
	Foundation/CPArray.j
	Foundation/CPKeyValueCoding.j
	Foundation/CPKeyValueObserving.j
2010-04-15 10:57:46 +02:00
Ross Boucher 91681d7846 Move more constants to CPControl.j 2010-02-17 17:06:09 -08:00
Ross Boucher 1328bc732f Move around some imports and constant declarations. 2010-02-17 16:29:57 -08:00