Compare commits

...
134 Commits
Author SHA1 Message Date
release 961cb2f6ed Changed version number to 1.0.0.008 2011-08-29 15:42:34 -05:00
alenovo 4dca2bbb85 Edited Buildfile via GitHub 2011-08-29 22:25:30 -03:00
alenovo 892d3d7120 Edited Buildfile via GitHub 2011-08-29 21:46:34 -03:00
alenovo c0fe499937 Edited Buildfile via GitHub 2011-08-29 21:26:34 -03:00
alenovo 01e8e9e597 Edited Buildfile via GitHub 2011-08-29 21:25:32 -03:00
alenovo 08b740c36f Edited Buildfile via GitHub 2011-08-29 21:24:23 -03:00
alenovo 31918bc0cd Edited Buildfile via GitHub 2011-08-29 21:22:21 -03:00
aparajita d45aeed224 Merge pull request #1 from correa-intalio/master
Changing version number
2011-08-29 07:47:40 -07:00
Diego Martin Correa 7d2835c522 Changing version numbre to complete build process 2011-08-29 11:45:47 -03:00
Aparajita Fishman cff26bd4e6 Instead of specifying a list class, pass a list delegate. 2011-08-24 13:51:57 -04:00
Aparajita Fishman 936ae1d563 Fixed the license 2011-08-24 13:24:55 -04:00
Aparajita Fishman 3d52935be0 Fixed no border CPTextField inset to match the default, changed license to LGPL 3.0, added missing PLATFORM(DOM) guard 2011-08-24 10:50:15 -04:00
Aparajita Fishman 777b167a2a Restored KVO exception, added mutating operations to test app 2011-08-24 09:58:03 -04:00
Aparajita Fishman c5d602bd6d Removed mistaken exception, it's okay if didChangeValueForKey: is called without willChangeValueForKey: 2011-08-24 01:35:33 -04:00
Aparajita Fishman 8545195cd7 Updated README 2011-08-24 00:58:58 -04:00
Aparajita Fishman 74fd73c18d Merge branch 'refs/heads/CPComboBox'
Conflicts:
	AppKit/Themes/Aristo/Resources/textfield-bezel-square-2.png
	AppKit/Themes/Aristo/Resources/textfield-bezel-square-8.png
	AppKit/Themes/Aristo/Resources/textfield-bezel-square-disabled-2.png
	AppKit/Themes/Aristo/Resources/textfield-bezel-square-disabled-3.png
	AppKit/Themes/Aristo/Resources/textfield-bezel-square-disabled-5.png
	AppKit/Themes/Aristo/Resources/textfield-bezel-square-disabled-6.png
	AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-0.png
	AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-1.png
	AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-2.png
	AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-3.png
	AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-5.png
	AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-6.png
	AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-7.png
	AppKit/Themes/Aristo/Resources/textfield-bezel-square-focused-8.png
	AppKit/Themes/Aristo/ThemeDescriptors.j
	Tests/Manual/NewTextField/AppController.j
2011-08-24 00:46:01 -04:00
Aparajita Fishman 2479f15b6b Merge remote branch 'refs/remotes/280north/master' 2011-08-24 00:30:39 -04:00
Aparajita Fishman 75875f4032 Reverted to previous theme layout system 2011-08-23 19:20:14 -04:00
Aparajita Fishman 0752b63b03 Adjusted tweak to match new bezel 2011-08-23 17:56:30 -04:00
Aparajita Fishman bde2f20fa3 - Tweaks to layout
- Fixed sizing of popup list to take intercell spacing into account
2011-08-23 17:17:01 -04:00
Aparajita Fishman c12305f40a Fixed a typo in CPTextField, CPComboBox should be using border-inset to account for the button, not content-inset. 2011-08-22 08:10:47 -04:00
Aparajita Fishman 2be149c486 Finished theming CPComboBox and reworked related themes...
- Using more logical scheme for widget layout. bezel-inset is inset from frame to the bezel image. border-inset is the inset from the frame to the visible border (if any), which usually is the width of a focus ring. content-inset is the inset from the border rect to the content frame, including the width of the border. This scheme makes it much easier to visualize what is happening, and also makes it possible to ensure a consistent margin between the content and the surrounding bezel border. It also allowed me to remove the funky +1 pixel hack in [CPTextField becomeFirstResponder].

- CPTextField (square and rounded) and CPTokenField had their theme insets reworked to fit the new scheme.

- Added missing disabled bezel for rounded textfield.

- All textfield focus rings look much nicer now (more like Cocoa). Previously the actual border of a textfield would shrink when focused, now it stays the same.

- In CPTokenField, wrapped all references to _inputElement in #if PLATFORM(DOM).

- Placeholder state was not being set correctly because a recent change to [CPTextField _updatePlaceholderState] uses the cached _stringValue instead of [self stringValue]. CPTokenField has its own override now that checks the token count.
2011-08-21 01:40:10 -04:00
Aparajita Fishman c7a16deb6f Fixed some edge case bugs, added full nib2cib support 2011-08-20 00:58:43 -04:00
Aparajita Fishman 1fb8c95b5d Merge branch 'refs/heads/CPTextField' 2011-08-18 09:22:56 -04:00
Aparajita Fishman ad630c840b Much more efficient test for first character of string 2011-08-18 00:51:59 -04:00
Aparajita Fishman 16b52035c1 Much more efficient test for first character of string 2011-08-18 00:51:37 -04:00
Aparajita Fishman e98cd9e069 New bezel for CPTextField 2011-08-18 00:47:32 -04:00
Aparajita Fishman e99f7261f3 New bezel for CPTextField 2011-08-18 00:46:53 -04:00
Aparajita Fishman 85b370e6cf Merge remote branch 'refs/remotes/280north/master' 2011-08-17 18:06:25 -04:00
Aparajita Fishman c5ab90ae52 Test app for bindings fixes. 2011-08-17 11:28:23 -04:00
Aparajita Fishman 776cdf93fe Bindings fixes...
- [CPArrayController setSelectionIndexes] should NOT obey avoidsEmptySelection. This was preventing an empty selection in a CPTableView. In addition, when calling _selectionDidChange it should suppress notifications, because the reverseSetValueFor:@"selectionIndexes" in [CPArrayController __setSelectionIndexes] does the notifications.

- Added CPContentBinding and CPContentValuesBinding constants.

- [CPObjectController valueForKeyPath:] should return CPNotApplicableMarker for undefined keys.

- Spelling fix and consolidated var blocks in CPKeyValueObserving.j
2011-08-17 11:09:36 -04:00
Aparajita Fishman 2bbba19aba Merge branch 'refs/heads/suppress-notifications' into CPComboBox 2011-08-15 09:14:48 -04:00
Aparajita Fishman 635a57b036 Implemented mechanism to suppress KVO notifications, used this mechanism to prevent unwanted notifications when mutating arrangedObjects in CPArrayController. 2011-08-15 09:12:22 -04:00
Aparajita Fishman 5b231867dc Merge remote branch 'refs/remotes/280north/master'
Conflicts:
	AppKit/CPTextField.j
2011-08-15 08:42:07 -04:00
Aparajita Fishman 6eee5543f9 First pass at CPComboBox. All functionality is there except for the drop-down button. 2011-08-10 16:03:35 -07:00
Aparajita Fishman 1918528710 Fixed range checking for insertObject:atIndex: 2011-08-08 15:13:37 -07:00
Aparajita Fishman b007f9899d Added some missing range checking. 2011-08-05 14:36:24 -07:00
Aparajita Fishman 8a460b65ed Bumped version 2011-08-03 08:02:06 -07:00
Aparajita Fishman 8fa12b874e Framework capp template 2011-07-17 11:29:52 +03:00
Aparajita Fishman a9edc868f1 Support for postinstall scripts 2011-07-17 11:29:43 +03:00
Aparajita Fishman 7e465689e4 Whitespace cleanup 2011-07-09 17:06:54 -07:00
Aparajita Fishman 1cab9463ad 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:03:12 -07:00
Aparajita Fishman 3974a483d1 Merge remote branch 'refs/remotes/280north/master' 2011-07-09 15:03:57 -07:00
Aparajita Fishman ecf8f7b143 Have to set _themeClass when class changes 2011-07-08 19:03:30 -07:00
Aparajita Fishman f57755ce46 Merge remote branch 'refs/remotes/280north/master' 2011-07-06 12:01:47 -07:00
Aparajita Fishman eaa51835ef Exit with error if conversion fails. 2011-07-05 16:08:22 -07:00
Aparajita Fishman 9038b7cfa9 Merge remote branch 'refs/remotes/280north/master'
Conflicts:
	Tools/nib2cib/main.j
2011-07-05 16:04:20 -07:00
release 8dd174d1e3 Changed version number to 1.0.0.006 2011-06-30 03:06:48 -05:00
Aparajita Fishman b9b0eb79d8 Make sure CPPlatformString +sizeOfString and +metricsOfFont work with CommonJS, so that OJUnitTest will work. 2011-06-29 10:40:14 -07:00
Aparajita Fishman a5832aa66b Theme tweaks.
- Don't need the CPTheme hack any more, I'm giving up on auxiliary themes for now.
- Added CPView -registerThemeValues: and -registerThemeValues:inherit:
2011-06-29 09:37:37 -07:00
Aparajita Fishman 9472f76ad5 Added missing type in method signature 2011-06-29 09:06:22 -07:00
release 4da5669ecb Changed version number to 1.0.0.006-SNAPSHOT 2011-06-24 05:37:02 -05:00
release c232680600 Changed version number to 1.0.0.005 2011-06-24 05:36:56 -05:00
release bd25b6fb48 Changed version number to 1.0.0.005-SNAPSHOT 2011-06-24 04:36:49 -05:00
release 834d878a4d Changed version number to 1.0.0.004 2011-06-24 04:36:38 -05:00
release 4cb5ccbc3a Changed version number to 1.0.0.004-SNAPSHOT 2011-06-24 03:05:58 -05:00
release 929cd78bae Changed version number to 1.0.0.003 2011-06-24 03:05:51 -05:00
hmalphettes f5961b9e06 remove the web-fragment.xml. it is not used and could be harmful. 2011-06-15 14:42:01 +08:00
Pascal Belloncle 7fb17e9f41 added Gemfile 2011-06-14 14:55:18 -03:00
hmalphettes dd70bdc698 use '/' for development. use the BundleShape to be able to be published by the latest version of tycho eventually 2011-06-13 17:14:35 +08:00
release 59d619d190 Changed version number to 1.0.0.003-SNAPSHOT 2011-06-13 03:31:35 -05:00
release dd160d6bed Changed version number to 1.0.0.002 2011-06-13 03:31:30 -05:00
hmalphettes ae5a2c4164 CARBON-183 and remove harful servlet-3.0 web-fragment.xml. Remove the dependency on buildr4osgi 2011-06-13 16:15:15 +08:00
hmalphettes a939bed8e0 CORE-153 pad the buildnumber 2011-06-13 15:51:15 +08:00
release c686a4384b Changed version number to 1.0.0.2-SNAPSHOT 2011-06-11 13:19:43 -05:00
release 6bb2dd2a16 Changed version number to 1.0.0.1 2011-06-11 13:19:38 -05:00
Pascal Belloncle 2ec574173a correct path for patch in archive 2011-06-10 17:17:00 -07:00
Pascal Belloncle 743feb5360 stupid copy paste typo 2011-06-10 16:52:14 -07:00
Pascal Belloncle bc4dc041e5 Merge branch 'master' of github.com:intalio/cappuccino 2011-06-10 16:37:40 -07:00
Pascal Belloncle 8c8d1ae3d3 osgi build 2011-06-10 16:37:30 -07:00
Aparajita Fishman a9781016be Look for frameworks in the app/Frameworks directory before the install directory. Document framework search path and CPAuxiliaryThemes support in the man page. 2011-06-04 22:53:31 -07:00
Aparajita Fishman 4be0bb3a30 Load userland NS classes from the main bundle as well as frameworks, and temporarily change the class of NSSwapper classes to the target class when calling KVC methods. 2011-06-04 18:03:53 -07:00
Aparajita Fishman a74267e937 Merge remote branch 'refs/remotes/280north/master' 2011-06-04 16:20:50 -07:00
Alexander LjungbergandAparajita Fishman 6dea853ef3 Decode but mostly ignore NSImages in nib2cib. Fixed: radio groups in IB come with an NSImage and so would not nib2cib anymore after the recent addition of template image support in NSButton. 2011-06-04 16:19:59 -07:00
Aparajita Fishman 94df530580 Another overhaul of nib2cib.
- Added support for userland NS classes.
- Added support for auxiliary themes.
- NSView should be writing _themeClass, otherwise custom themed classes do not get the correct _themeClass when unarchived.
- Added support for stored options, this is critical. For example, if you are using custom frameworks, you have to ensure they are loaded during automatic nib2cib'ing that occurs when building an app or using xcodecapp. Stored options makes this easy to do.
- Finally did the right thing and made nib2cib into an Objective-J class.
2011-06-04 16:07:00 -07:00
Aparajita Fishman d038c50531 Added ability to specify bundle, which makes this usable with non-main bundle images. 2011-06-04 12:01:19 -07:00
Aparajita Fishman 83546d58db Tweak language of error message to be clearer, currently it sounds like it was searching in the cib file for the class, not the other way around. 2011-06-04 10:59:49 -07:00
Aparajita Fishman 8de587d4fc Only log the connection info if _source and _destination are defined. Runtime attribute connections do not have both. Correctly show boolean value types as BOOL, not CPNumber. 2011-06-04 10:58:38 -07:00
Aparajita Fishman bd9a6ea150 A few more fixes to support multiple themes. 2011-06-04 10:46:29 -07:00
Aparajita Fishman fe69142567 Merge remote branch 'refs/remotes/aparajita/runtime-attributes'
Conflicts:
	Tools/nib2cib/NSNibConnector.j
2011-06-04 10:39:50 -07:00
Aparajita Fishman 5f85f7bef1 Removed unused variable, fixed typo 2011-06-03 18:08:33 -07:00
Aparajita Fishman 397e314cc9 Use Menlo if Consolas is not available 2011-06-01 18:19:49 -07:00
Aparajita Fishman c87d96676c Merge remote branch 'refs/remotes/280north/master' 2011-06-01 12:21:27 -07:00
Aparajita Fishman 13d4e36d39 Lost this change in the merge 2011-05-30 23:39:44 -07:00
Aparajita Fishman a5c06c8f27 Merge remote branch 'refs/remotes/280north/master'
Conflicts:
	AppKit/CPTableView.j
2011-05-30 23:37:16 -07:00
Aparajita Fishman 76bdbb660e clickedRow should be -1 initially, remove leftover setTheme. 2011-05-30 23:31:28 -07:00
Aparajita Fishman a7929e6c1e Enable escape as key equivalent. 2011-05-30 23:18:43 -07:00
Aparajita Fishman b3cbc7e362 Test app and unit test to validate pinned ranges in beginsWith/endsWith predicate comparison. 2011-05-26 14:29:51 -07:00
Aparajita Fishman d6b3efaae8 Pin ranges to valid values. 2011-05-26 13:00:46 -07:00
Aparajita Fishman 33345f65ce Restored space, backspace and escape as key equivalents, but only if the first responder is not a CPTextField. Updated test app to show clearly the effect of this change. 2011-05-23 16:31:15 -07:00
Aparajita Fishman 3fe5ec5d6d Fixed set of keys that can be considered a key equivalent, removed redundant call to performKeyEquivalent, test app 2011-05-22 18:05:08 -07:00
Aparajita Fishman 142b982577 Documentation tweaks 2011-05-22 17:19:06 -07:00
Aparajita Fishman 147c65b962 On WebKit (at least on Mac), right Command key code is 93, not 91. This was not being interpreted correctly. 2011-05-22 17:06:25 -07:00
Aparajita Fishman 89dbccd74e Use CPLog instead of console.log 2011-05-20 08:01:22 -07:00
Aparajita Fishman a4647f2b82 CPColor and CPImage enhancements
- Enhanced -description method of CPImage and CPColor to show the exact content, especially for pattern colors.

- Added CPColorWithImages() convenience function, analogous to PatternColor() function used in theme descriptors.

- Added @cond/@endcond in CPColor to ignore local variables.

- Sample app included.
2011-05-20 00:23:17 -07:00
Aparajita Fishman 94336ebcbb Merge remote branch 'refs/remotes/280north/master'
Conflicts:
	Tools/Documentation/preprocess/003.make_headers.rb
2011-05-19 23:19:08 -07:00
Aparajita Fishman 5dfa43ce5f Oops, accessor methods weren't being synthesized, removed some cruft 2011-05-19 17:10:26 -07:00
Aparajita Fishman ff7774976e Major fix to documentation generation:
- It turns out doxygen would not generate documentation for the first method in a file (or sometimes any methods at all) if there was no ivar block or an empty ivar block. Now a dummy __doxygen__ ivar is inserted in empty blocks to force correct behavior.

- Added a missing @endverbatim to CPExpression.j.

- Tweaked class documentation for CPPredicate.j.
2011-05-19 16:46:41 -07:00
Aparajita Fishman a435e54a67 Stupid Uber Glory bundle duplicated the file a few times when stripping whitespace. 2011-05-18 17:32:59 -07:00
Aparajita Fishman 852597f11d Fixed formatting of lists and code in class description. The code did not change, I don't know why git says it did. 2011-05-18 16:55:15 -07:00
Aparajita Fishman 806fea9222 Whitespace cleanup 2011-05-18 16:53:51 -07:00
Aparajita Fishman 972bb4100f If there is no header view, there should be no corner view. This is what Cocoa does. Also for correctness -enclosingScrollView should be used to get the table's scrollview. Test app included. 2011-05-18 10:29:54 -07:00
Aparajita Fishman 6a6b83635f More documentation enhancements...
- Changed to centered, fixed-width layout, it results in shorter line lengths which reads more easily.
- Moved support files to separate support directory.
- Removed blank lines at end of multi-parameter method prototypes.
2011-05-18 07:49:52 -07:00
Aparajita Fishman d8f202fc1f Missed a text substitution, darkened up the method header a bit 2011-05-17 21:11:31 -07:00
Aparajita Fishman 2322743252 Documentation tweak 2011-05-17 10:51:09 -07:00
Aparajita Fishman 8b3f9c5557 Merge remote branch 'refs/remotes/280north/master'
Conflicts:
	Tools/Documentation/doxygen.css
	Tools/Documentation/processor_setup.sh
2011-05-17 10:48:22 -07:00
Aparajita Fishman b573daf59b NSColorWell was not setting its enabled state 2011-05-16 11:12:48 -07:00
Aparajita Fishman 4f8fa778d5 Style cleanup 2011-05-14 14:03:51 -04:00
Aparajita Fishman 30d5a7f7a2 Tweak the class list page 2011-05-12 23:15:13 -04:00
Aparajita Fishman b01a4436b6 Lightened up box around method prototype 2011-05-12 16:55:32 -04:00
Aparajita Fishman 9ad8f75a08 Another overhaul of doc generation.
- Added generic facility for pre- and post-processor scripts to be run.
- Added support utility script for inclusion by processors.
- Totally overhauled css to make the pages more readable (I hope).
- Fixed some doc errors in CPTableView.
- Don't generate XML.
- Added colorize() and colorPrint() functions to common.jake.
- Added docs-no-frame task for generating docs without a sidebar frame.
2011-05-12 14:40:19 -04:00
Aparajita Fishman 2bf9afa97a Whitespace cleanup 2011-05-11 23:58:20 -04:00
Aparajita Fishman 9e892d4eea Added CPMenu -removeAll method, removed unused internal _itemIsHighlighted method, test app 2011-05-11 23:56:01 -04:00
Aparajita Fishman d2407d1c2a Don't generate XML for docs, updated ThemeDescriptor capp template 2011-05-11 12:18:21 -04:00
Aparajita Fishman 17dc96ad2f Merge remote branch 'refs/remotes/280north/master' 2011-05-11 08:13:33 -04:00
Aparajita Fishman b3a427ba18 Correct performKeyEquivalent documentation 2011-05-10 19:17:32 -04:00
Aparajita Fishman 4cdefcc2c7 Merge remote branch 'refs/remotes/280north/master' 2011-05-10 11:12:05 -04:00
Aparajita Fishman b7c0dcf050 Added textFrame method to locate the text within the view 2011-05-09 21:14:02 -04:00
Aparajita Fishman fe9573e5b8 Merge branch 'refs/heads/object-union-operators' 2011-05-09 17:12:54 -04:00
Aparajita Fishman 9fcf0258e0 Fix the content inset on CPTextField so there are 2 pixels below and 3 pixels above a text selection. 2011-05-09 17:12:27 -04:00
Aparajita Fishman e22faa0d79 Added distinctUnionOfObjects and unionOfObjects object operators. 2011-05-09 15:31:12 -04:00
Aparajita Fishman 175b204bb6 Improvements to the ThemeDescriptor capp template:
- New/improved jake tasks: debug, release, all, clean, clobber, test, test-release, help.
- help task shows comprehensive, formatted documentation for the available tasks.
- BlendKit is automatically symlinked into the Frameworks directory if necessary as part of the build process, so that the showcase will always work.
- User can easily change the build directory by changing one line.
- Fixed incorrect placeholders in main.j.
2011-05-07 13:10:33 -04:00
Aparajita Fishman b126b2946d Revert "Using objects to encapsulate a bit more"
This reverts commit f0a2a91837.
5c10615c9f fixes the root cause,
thus obviating the reverted commit.
2011-05-06 18:04:36 -04:00
Aparajita Fishman fec200c835 Merge remote branch 'refs/remotes/280north/master' 2011-05-06 17:56:00 -04:00
Aparajita Fishman ea0a47a845 _CPThemeAttribute -setValue should not blow away existing values. 2011-05-06 08:51:17 -04:00
Aparajita Fishman 835d89774a Merge remote branch 'refs/remotes/origin/nib2cib-fix-load-theme' 2011-05-05 15:00:01 -04:00
Aparajita Fishman f0a2a91837 Using objects to encapsulate a bit more 2011-05-05 14:40:19 -04:00
Aparajita Fishman 8614bab724 Merge branch 'master' of git://github.com/280north/cappuccino 2011-05-05 08:07:16 -04:00
Aparajita Fishman 9c181cc9c9 Allow class to be used with +themeForView, fix to image load notification 2011-05-05 08:06:31 -04:00
Aparajita Fishman a0a7b126ab When multiple _CPImageAndTextViews to share a common image, update them all when the image loads. 2011-05-04 10:59:23 -04:00
Aparajita Fishman 78ddc2db70 Automated support for multiple themes and simple theme inheritance 2011-04-29 16:45:00 -04:00
Aparajita Fishman e80cbc89b2 Added debug logging, some more samples in AppController 2011-03-28 19:24:13 -04:00
Aparajita Fishman c0f5ed1f87 Fixed the copyright 2011-03-28 07:50:15 -04:00
Aparajita Fishman 51a8975f0a Implement support for user defined runtime attributes in nib2cib 2011-03-27 22:14:43 -04:00
193 changed files with 11075 additions and 1259 deletions
+1
View File
@@ -9,3 +9,4 @@ WebSite
*.xcodeproj/*.perspectivev3
xcuserdata/
!*.xcodeproj/project.pbxproj
target
+2
View File
@@ -0,0 +1,2 @@
rvm_install_on_use_flag=1
rvm jruby-head@buildr
+2
View File
@@ -37,12 +37,14 @@
@import "CPCibControlConnector.j"
@import "CPCibLoading.j"
@import "CPCibOutletConnector.j"
@import "CPCibRuntimeAttributesConnector.j"
@import "CPClipView.j"
@import "CPCollectionView.j"
@import "CPCollectionViewItem.j"
@import "CPColor.j"
@import "CPColorPanel.j"
@import "CPColorWell.j"
@import "CPComboBox.j"
@import "CPCompatibility.j"
@import "CPControl.j"
@import "CPCookie.j"
+47 -16
View File
@@ -107,7 +107,7 @@ CPRunContinuesResponse = -1002;
CPPanel _aboutPanel;
CPThemeBlend _themeBlend @accessors(property=themeBlend);
CPArray _themeBlends @accessors(property=themeBlends);
}
/*!
@@ -141,6 +141,8 @@ CPRunContinuesResponse = -1002;
_windows = [];
[_windows addObject:nil];
_themeBlends = [];
}
return self;
@@ -338,7 +340,7 @@ CPRunContinuesResponse = -1002;
Copyright - Human readable copyright information.
</pre>
If you choose not the include any of the above keys, they will default
If you choose not the include any of the above keys, they will default
to the following respective keys in your info.plist file.
<pre>
@@ -1003,7 +1005,7 @@ CPRunContinuesResponse = -1002;
}
/*!
Sets the arguments of your application.
Sets the arguments of your application.
That is, set the slash seperated values of an array as the window location hash.
For example if you pass an array:
@@ -1156,6 +1158,16 @@ CPRunContinuesResponse = -1002;
userInfo:nil];
}
- (CPThemeBlend)themeBlend
{
return (_themeBlends.length > 0 ? _themeBlends[0] : nil);
}
- (void)setThemeBlend:(CPThemeBlend)aThemeBlend
{
_themeBlends[0] = aThemeBlend;
}
+ (CPString)defaultThemeName
{
return ([[CPBundle mainBundle] objectForInfoDictionaryKey:"CPDefaultTheme"] || @"Aristo");
@@ -1218,15 +1230,14 @@ function CPApplicationMain(args, namedArgs)
[_CPAppBootstrapper performActions];
}
var _CPAppBootstrapperActions = nil;
var _CPAppBootstrapperActions = nil,
_CPAppThemeURLsToLoad = [];
@implementation _CPAppBootstrapper : CPObject
{
}
+ (CPArray)actions
{
return [@selector(bootstrapPlatform), @selector(loadDefaultTheme), @selector(loadMainCibFile)];
return [@selector(bootstrapPlatform), @selector(loadThemes), @selector(loadMainCibFile)];
}
+ (void)performActions
@@ -1250,17 +1261,30 @@ var _CPAppBootstrapperActions = nil;
return [CPPlatform bootstrap];
}
+ (BOOL)loadDefaultTheme
+ (BOOL)loadThemes
{
var defaultThemeName = [CPApplication defaultThemeName],
themeURL = nil;
_CPAppThemeURLsToLoad.push([CPApplication defaultThemeName]);
if (defaultThemeName === @"Aristo")
themeURL = [[CPBundle bundleForClass:[CPApplication class]] pathForResource:defaultThemeName + @".blend"];
var auxiliaryThemes = ([[CPBundle mainBundle] objectForInfoDictionaryKey:@"CPAuxiliaryThemes"] || []);
_CPAppThemeURLsToLoad = _CPAppThemeURLsToLoad.concat(auxiliaryThemes);
[self loadNextTheme];
return YES;
}
+ (BOOL)loadNextTheme
{
var themeName = _CPAppThemeURLsToLoad.shift();
if (themeName === @"Aristo")
themeURL = [[CPBundle bundleForClass:[CPApplication class]] pathForResource:themeName + @".blend"];
else
themeURL = [[CPBundle mainBundle] pathForResource:defaultThemeName + @".blend"];
themeURL = [[CPBundle mainBundle] pathForResource:themeName + @".blend"];
var blend = [[CPThemeBlend alloc] initWithContentsOfURL:themeURL];
[blend loadWithDelegate:self];
return YES;
@@ -1268,10 +1292,17 @@ var _CPAppBootstrapperActions = nil;
+ (void)blendDidFinishLoading:(CPThemeBlend)aThemeBlend
{
[[CPApplication sharedApplication] setThemeBlend:aThemeBlend];
[CPTheme setDefaultTheme:[CPTheme themeNamed:[CPApplication defaultThemeName]]];
var themeBlends = [CPApp themeBlends];
[self performActions];
[themeBlends addObject:aThemeBlend];
if ([themeBlends count] === 1)
[CPTheme setDefaultTheme:[CPTheme themeNamed:[CPApplication defaultThemeName]]];
if (_CPAppThemeURLsToLoad.length === 0)
[self performActions];
else
[self loadNextTheme];
}
+ (BOOL)loadMainCibFile
+100 -50
View File
@@ -27,6 +27,7 @@
@import "CPObjectController.j"
@import "CPKeyValueBinding.j"
/*!
@class CPArrayController
@@ -284,8 +285,7 @@
if (value === nil)
value = [];
if (![value isKindOfClass:[CPArray class]])
else if (![value isKindOfClass:[CPArray class]])
value = [value];
var oldSelectedObjects = nil,
@@ -339,14 +339,6 @@
[self setContent:anArray];
}
/*!
@ignore
*/
- (void)_setContentSet:(id)aSet
{
[self setContent:[aSet allObjects]];
}
/*!
Returns the content array of the controller.
@return id the content array of the receiver
@@ -356,6 +348,14 @@
return [self content];
}
/*!
@ignore
*/
- (void)_setContentSet:(id)aSet
{
[self setContent:[aSet allObjects]];
}
/*!
Returns the content of the receiver as a CPSet.
@@ -564,8 +564,13 @@
- (BOOL)setSelectionIndexes:(CPIndexSet)indexes
{
[self _selectionWillChange]
[self __setSelectionIndexes:indexes];
[self _selectionDidChange];
// When explicitly setting the selection, ignore avoidsEmptySelection
var changed = [self __setSelectionIndexes:indexes obeyAvoidsEmptySelection:NO];
[self _selectionDidChangeNotify:NO];
return changed;
}
/*
@@ -574,7 +579,7 @@
*/
- (BOOL)__setSelectionIndex:(int)theIndex
{
[self __setSelectionIndexes:[CPIndexSet indexSetWithIndex:theIndex]];
return [self __setSelectionIndexes:[CPIndexSet indexSetWithIndex:theIndex] obeyAvoidsEmptySelection:YES];
}
/*
@@ -582,13 +587,22 @@
@ignore
*/
- (BOOL)__setSelectionIndexes:(CPIndexSet)indexes
{
[self __setSelectionIndexes:indexes obeyAvoidsEmptySelection:YES];
}
/*
Like setSelectionIndexes but don't fire any change notifications.
@ignore
*/
- (BOOL)__setSelectionIndexes:(CPIndexSet)indexes obeyAvoidsEmptySelection:(BOOL)obeyAvoidsEmptySelection
{
if (!indexes)
indexes = [CPIndexSet indexSet];
if (![indexes count])
{
if (_avoidsEmptySelection && [[self arrangedObjects] count])
if (obeyAvoidsEmptySelection && _avoidsEmptySelection && [[self arrangedObjects] count])
indexes = [CPIndexSet indexSetWithIndex:0];
}
else
@@ -636,10 +650,10 @@
[self willChangeValueForKey:@"selectionIndexes"];
[self _selectionWillChange];
[self __setSelectedObjects:objects];
[self __setSelectedObjects:objects obeyAvoidsEmptySelection:NO];
[self didChangeValueForKey:@"selectionIndexes"];
[self _selectionDidChange];
[self _selectionDidChangeNotify:NO];
}
/*
@@ -647,6 +661,15 @@
@ignore
*/
- (BOOL)__setSelectedObjects:(CPArray)objects
{
[self __setSelectedObjects:objects obeyAvoidsEmptySelection:YES];
}
/*
Like setSelectedObjects but don't fire any change notifications.
@ignore
*/
- (BOOL)__setSelectedObjects:(CPArray)objects obeyAvoidsEmptySelection:(BOOL)obeyAvoidsEmptySelection
{
var set = [CPIndexSet indexSet],
count = [objects count],
@@ -660,7 +683,7 @@
[set addIndex:index];
}
[self __setSelectionIndexes:set];
[self __setSelectionIndexes:set obeyAvoidsEmptySelection:obeyAvoidsEmptySelection];
return YES;
}
@@ -729,21 +752,13 @@
}
[self willChangeValueForKey:@"content"];
/*
If the content array is bound then our addObject: message below will cause the observed
array to change. The binding will call setContent:_contentObject on this array
controller to let it know about the change. We want to ignore that message since we
A) already have the right _contentObject and B) properly update _arrangedObjects
by hand below.
*/
_disableSetContent = YES;
[self _willModifyContent];
[_contentObject addObject:object];
// Allow handlesContentAsCompoundValue reverse sets to trigger.
[[CPBinder getBinding:@"contentArray" forObject:self] _contentArrayDidChange];
_disableSetContent = NO;
[self _didModifyContent];
if (willClearPredicate)
{
@@ -764,14 +779,15 @@
[_selectionIndexes shiftIndexesStartingAtIndex:pos by:1];
}
/*
else if (_filterPredicate !== nil)
...
// Implies _filterPredicate && ![_filterPredicate evaluateWithObject:object], so the new object does
// not appear in arrangedObjects and we do not have to update at all.
else if (_filterPredicate !== nil)
...
Implies _filterPredicate && ![_filterPredicate evaluateWithObject:object], so the new object does
not appear in arrangedObjects and we do not have to update at all.
*/
// This will also send notificaitons for arrangedObjects.
[self didChangeValueForKey:@"content"];
if (willClearPredicate)
[self didChangeValueForKey:@"filterPredicate"];
}
@@ -797,10 +813,7 @@
[self willChangeValueForKey:@"content"];
/*
See _disableSetContent explanation in addObject:.
*/
_disableSetContent = YES;
[self _willModifyContent];
// The atArrangedObjectIndex: part of this method's name only refers to where the
// object goes in arrangedObjects, not in the content array. So use addObject:,
@@ -809,7 +822,7 @@
// Allow handlesContentAsCompoundValue reverse sets to trigger.
[[CPBinder getBinding:@"contentArray" forObject:self] _contentArrayDidChange];
_disableSetContent = NO;
[self _didModifyContent];
if (willClearPredicate)
[self __setFilterPredicate:nil];
@@ -827,6 +840,7 @@
[self __setSelectionIndexes:[CPIndexSet indexSetWithIndex:0]];
[self didChangeValueForKey:@"content"];
if (willClearPredicate)
[self didChangeValueForKey:@"filterPredicate"];
}
@@ -839,15 +853,13 @@
- (void)removeObject:(id)object
{
[self willChangeValueForKey:@"content"];
// See _disableSetContent explanation in addObject:.
_disableSetContent = YES;
[self _willModifyContent];
[_contentObject removeObject:object];
// Allow handlesContentAsCompoundValue reverse sets to trigger.
[[CPBinder getBinding:@"contentArray" forObject:self] _contentArrayDidChange];
_disableSetContent = NO;
[self _didModifyContent];
if (_filterPredicate === nil || [_filterPredicate evaluateWithObject:object])
{
@@ -898,6 +910,15 @@
[self removeObjectsAtArrangedObjectIndexes:_selectionIndexes];
}
/*!
Removes the object at the specified index in the controller's arranged objects from the content array.
@param int index - index of the object to remove.
*/
- (void)removeObjectAtArrangedObjectIndex:(int)index
{
[self removeObjectsAtArrangedObjectIndexes:[CPIndexSet indexSetWithIndex:index]];
}
/*!
Removes the objects at the specified indexes in the controller's arranged objects from the content array.
@param CPIndexSet indexes - indexes of the objects to remove.
@@ -906,20 +927,21 @@
{
[self willChangeValueForKey:@"content"];
/*
See _disableSetContent explanation in addObject:.
*/
_disableSetContent = YES;
var arrangedObjects = [self arrangedObjects],
index = [anIndexSet lastIndex],
position = CPNotFound,
newSelectionIndexes = [_selectionIndexes copy];
newSelectionIndexes = [_selectionIndexes copy],
proxy = [_CPKVOProxy proxyForObject:self];
while (index !== CPNotFound)
{
var object = [arrangedObjects objectAtIndex:index];
// Make sure arrangedObjects does not notify because of content change
[proxy suppressNotificationsForKeyPath:@"arrangedObjects"];
// First try the simple case which should work if there are no sort descriptors.
if ([_contentObject objectAtIndex:index] === object)
[_contentObject removeObjectAtIndex:index];
@@ -933,6 +955,9 @@
contentIndex = [_contentObject indexOfObjectIdenticalTo:object];
[_contentObject removeObjectAtIndex:contentIndex];
}
// Now arrangedObjects can notify
[proxy unsuppressNotificationsForKeyPath:@"arrangedObjects"];
[arrangedObjects removeObjectAtIndex:index];
// Deselect this row if it was selected, and either way shift all selection indexes
@@ -942,6 +967,7 @@
index = [anIndexSet indexLessThanIndex:index];
}
// Allow handlesContentAsCompoundValue reverse sets to trigger.
[[CPBinder getBinding:@"contentArray" forObject:self] _contentArrayDidChange];
_disableSetContent = NO;
@@ -988,15 +1014,13 @@
- (void)_removeObjects:(CPArray)objects
{
[self willChangeValueForKey:@"content"];
// See _disableSetContent explanation in addObject:.
_disableSetContent = YES;
[self _willModifyContent];
[_contentObject removeObjectsInArray:objects];
// Allow handlesContentAsCompoundValue reverse sets to trigger.
[[CPBinder getBinding:@"contentArray" forObject:self] _contentArrayDidChange];
_disableSetContent = NO;
[self _didModifyContent];
var arrangedObjects = [self arrangedObjects],
position = [arrangedObjects indexOfObject:[objects objectAtIndex:0]];
@@ -1033,13 +1057,39 @@
return [self isEditable];
}
// Internal
- (void)_willModifyContent
{
/*
If the content array is bound then our addObject: message below will cause the observed
array to change. The binding will call setContent:_contentObject on this array
controller to let it know about the change. We want to ignore that message since we
A) already have the right _contentObject and B) properly update _arrangedObjects
by hand below.
*/
_disableSetContent = YES;
/*
When mutating arrangedObjects, we mutate the content first. But mutating the content
will trigger a notification that the arrangedObjects have changed, which we want to
suppress, since the arrangedObjects mutation will do the correct notification.
*/
[[_CPKVOProxy proxyForObject:self] suppressNotificationsForKeyPath:@"arrangedObjects"];
}
- (void)_didModifyContent
{
_disableSetContent = NO;
[[_CPKVOProxy proxyForObject:self] unsuppressNotificationsForKeyPath:@"arrangedObjects"];
}
@end
@implementation CPArrayController (CPBinder)
+ (Class)_binderClassForBinding:(CPString)theBinding
{
if (theBinding == @"contentArray")
if (theBinding === @"content" || theBinding === @"contentArray")
return [_CPArrayControllerContentBinder class];
return [super _binderClassForBinding:theBinding];
@@ -1054,7 +1104,7 @@
var destination = [_info objectForKey:CPObservedObjectKey],
keyPath = [_info objectForKey:CPObservedKeyPathKey],
options = [_info objectForKey:CPOptionsKey],
isCompound = [self handlesContentAsCompoundValue];
isCompound = [self handlesContentAsCompoundValue] || keyPath.indexOf("@") !== -1;
if (!isCompound)
{
+99 -6
View File
@@ -27,6 +27,7 @@
@import "CPCompatibility.j"
@import "CPImage.j"
/// @cond IGNORE
var _redComponent = 0,
_greenComponent = 1,
@@ -54,6 +55,66 @@ var cachedBlackColor,
cachedShadowColor,
cachedClearColor;
/// @endcond
/*!
Orientation to use with \c CPColorPattern for vertical patterns.
*/
CPColorPatternIsVertical = YES,
/*!
Orientation to use with \c CPColorPattern for horizontal patterns.
*/
CPColorPatternIsHorizontal = NO;
/*!
To create a simple color with a pattern image:
<code>CPColorWithImages(name, width, height{, bundle})</code>
To create a color with a three part pattern image:
<code>CPColorWithImages(slices{, orientation})</code>
where slices is an array of three [name, width, height{, bundle}] arrays,
and orientation is \c CPColorPatternIsVertical or \ref CPColorPatternIsHorizontal.
If orientatation is not passed, it defaults to \ref CPColorPatternIsHorizontal.
To create a color with a nine part pattern image:
<code>CPColorWithImages(slices);</code>
where slices is an array of nine [name, width, height{, bundle}] arrays.
*/
function CPColorWithImages()
{
if (arguments.length < 3)
{
var slices = arguments[0],
imageSlices = [];
for (var i = 0; i < slices.length; ++i)
{
var slice = slices[i];
imageSlices.push(slice ? CPImageInBundle(slice[0], CGSizeMake(slice[1], slice[2]), slice[3]) : nil);
}
if (imageSlices.length === 3)
return [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:imageSlices isVertical:arguments[1] || CPColorPatternIsHorizontal]];
else
return [CPColor colorWithPatternImage:[[CPNinePartImage alloc] initWithImageSlices:imageSlices]];
}
else if (arguments.length === 3 || arguments.length === 4)
{
return [CPColor colorWithPatternImage:CPImageInBundle(arguments[0], CGSizeMake(arguments[1], arguments[2]), arguments[3])];
}
else
{
return nil;
}
}
/*!
@ingroup appkit
@@ -633,7 +694,36 @@ url("data:image/png;base64,BASE64ENCODEDDATA") // if there is a pattern image
- (CPString)description
{
return [super description]+" "+[self cssString];
var description = [super description],
patternImage = [self patternImage];
if (!patternImage)
return description + " " + [self cssString];
description += " {\n";
if ([patternImage isThreePartImage] || [patternImage isNinePartImage])
{
var slices = [patternImage imageSlices];
if ([patternImage isThreePartImage])
description += " orientation: " + ([patternImage isVertical] ? "vertical" : "horizontal") + ",\n";
description += " patternImage (" + slices.length + " part): [\n";
for (var i = 0; i < slices.length; ++i)
{
var imgDescription = [slices[i] description];
description += imgDescription.replace(/^/mg, " ") + ",\n";
}
description = description.substr(0, description.length - 2) + "\n ]\n}";
}
else
description += [patternImage description].replace(/^/mg, " ") + "\n}";
return description;
}
@end
@@ -678,8 +768,10 @@ url("data:image/png;base64,BASE64ENCODEDDATA") // if there is a pattern image
@end
/// @cond IGNORE
var CPColorComponentsKey = @"CPColorComponentsKey",
CPColorPatternImageKey = @"CPColorPatternImageKey";
/// @endcond
@implementation CPColor (CPCoding)
@@ -710,13 +802,12 @@ var CPColorComponentsKey = @"CPColorComponentsKey",
@end
/// @cond IGNORE
var hexCharacters = "0123456789ABCDEF";
/*!
Used for the CPColor \c +colorWithHexString: implementation
@ignore
@class CPColor
@return an array of rgb components
/*
Used for the CPColor +colorWithHexString: implementation.
Returns an array of rgb components.
*/
var hexToRGB = function(hex)
{
@@ -754,3 +845,5 @@ var byteToHex = function(n)
return hexCharacters.charAt((n - n % 16) / 16) +
hexCharacters.charAt(n % 16);
};
/// @endcond
+1223
View File
File diff suppressed because it is too large Load Diff
+20 -1
View File
@@ -44,7 +44,8 @@ CPImageNameColorPanel = @"CPImageNameColorPanel";
CPImageNameColorPanelHighlighted = @"CPImageNameColorPanelHighlighted";
var imagesForNames = { },
AppKitImageForNames = { };
AppKitImageForNames = { },
ImageDescriptionFormat = "%s {\n filename: \"%s\",\n size: { width:%f, height:%f }\n}";
AppKitImageForNames[CPImageNameColorPanel] = CGSizeMake(26.0, 29.0);
AppKitImageForNames[CPImageNameColorPanelHighlighted] = CGSizeMake(26.0, 29.0);
@@ -324,6 +325,24 @@ function CPAppKitImage(aFilename, aSize)
return NO;
}
- (CPString)description
{
var filename = [self filename],
size = [self size];
if (filename.indexOf("data:") === 0)
{
var index = filename.indexOf(",");
if (index > 0)
filename = [CPString stringWithFormat:@"%s,%s...%s", filename.substr(0, index), filename.substr(index + 1, 10), filename.substr(filename.length - 10)];
else
filename = "data:<unknown type>";
}
return [CPString stringWithFormat:ImageDescriptionFormat, [super description], filename, size.width, size.height];
}
/* @ignore */
- (void)_derefFromImage
{
+4 -3
View File
@@ -204,7 +204,6 @@ var CPBindingOperationAnd = 0,
if (valueTransformer)
aValue = [valueTransformer transformedValue:aValue];
if (aValue === undefined || aValue === nil || aValue === [CPNull null])
aValue = [options objectForKey:CPNullPlaceholderBindingOption] || nil;
@@ -311,7 +310,7 @@ var CPBindingOperationAnd = 0,
- (void)bind:(CPString)aBinding toObject:(id)anObject withKeyPath:(CPString)aKeyPath options:(CPDictionary)options
{
if (!anObject || !aKeyPath)
return CPLog.error("Invalid object or path on "+self+" for "+aBinding);
return CPLog.error("Invalid object or path on " + self + " for " + aBinding);
//if (![[self exposedBindings] containsObject:aBinding])
// CPLog.warn("No binding exposed on "+self+" for "+aBinding);
@@ -488,6 +487,8 @@ CPSelectedIndexBinding = @"selectedIndex";
CPTextColorBinding = @"textColor";
CPToolTipBinding = @"toolTip";
CPValueBinding = @"value";
CPContentBinding = @"content";
CPContentValuesBinding = @"contentValues";
//Binding options constants
CPAllowsEditingMultipleValuesSelectionBindingOption = @"CPAllowsEditingMultipleValuesSelection";
@@ -518,4 +519,4 @@ CPValueTransformerBindingOption = @"CPValueTransformer";
CPIsControllerMarker = function(/*id*/anObject)
{
return anObject === CPMultipleValuesMarker || anObject === CPNoSelectionMarker || anObject === CPNotApplicableMarker || anObject === CPNullMarker;
}
}
+30 -7
View File
@@ -323,12 +323,22 @@
@ignore
*/
- (void)_selectionDidChange
{
[self _selectionDidChangeNotify:YES];
}
/*!
@ignore
*/
- (void)_selectionDidChangeNotify:(BOOL)notify
{
if (_selection === undefined || _selection === nil)
_selection = [[CPControllerSelectionProxy alloc] initWithController:self];
[_selection controllerDidChange];
[self didChangeValueForKey:@"selection"];
if (notify)
[self didChangeValueForKey:@"selection"];
}
/*!
@@ -666,21 +676,21 @@ var CPObjectControllerContentKey = @"CPObjectControllerCo
var count = [theValues count];
if (!count)
value = CPNoSelectionMarker;
return CPNoSelectionMarker;
else if (count === 1)
value = [theValues objectAtIndex:0];
else
{
if ([_controller alwaysUsesMultipleValuesMarker])
value = CPMultipleValuesMarker;
return CPMultipleValuesMarker;
else
{
value = [theValues objectAtIndex:0];
for (var i = 0, count= [theValues count]; i < count && value != CPMultipleValuesMarker; i++)
for (var i = 0, count = [theValues count]; i < count; i++)
{
if (![value isEqual:[theValues objectAtIndex:i]])
value = CPMultipleValuesMarker;
return CPMultipleValuesMarker;
}
}
}
@@ -693,8 +703,21 @@ var CPObjectControllerContentKey = @"CPObjectControllerCo
- (id)valueForKeyPath:(CPString)theKeyPath
{
var values = [[_controller selectedObjects] valueForKeyPath:theKeyPath];
value = [self _controllerMarkerForValues:values];
// If valueForKeyPath fails because of an undefined key, return CPNotApplicableMarker
var value;
try
{
var values = [[_controller selectedObjects] valueForKeyPath:theKeyPath];
value = [self _controllerMarkerForValues:values];
}
catch (ex)
{
if ([ex name] === CPUndefinedKeyException)
value = CPNotApplicableMarker;
else
throw ex;
}
[_cachedValues setObject:value forKey:theKeyPath];
+10 -10
View File
@@ -332,18 +332,18 @@ CPTableColumnUserResizingMask = 1 << 1;
individual cell that is shown. As a result, changes made after calling this method won't be reflected.
Example:
@code
[tableColumn setDataView:someView]; // snapshot taken
[[tableColumn dataView] setSomething:x]; //won't work
@endcode
@code
[tableColumn setDataView:someView]; // snapshot taken
[[tableColumn dataView] setSomething:x]; //won't work
@endcode
This doesn't work because the snapshot is taken before the new property is applied. Instead, do:
@code
[someView setSomething:x];
[tableColumn setDataView:someView];
@endcode
@code
[someView setSomething:x];
[tableColumn setDataView:someView];
@endcode
@note you should implement CPKeyedArchiving otherwise you might see unexpected results.
@note You should implement CPKeyedArchiving otherwise you might see unexpected results.
This is done by adding the following methods to your class:
@endnote
@@ -380,7 +380,7 @@ CPTableColumnUserResizingMask = 1 << 1;
}
@endcode
@section Themeing
@section Theming
When you set a dataview and it is added to the tableview the theme state will be set to \c CPThemeStateTableDataView
When the dataview becomes selected the theme state will be set to \c CPThemeStateSelectedDataView.
+1
View File
@@ -323,6 +323,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
{
_tableViewFlags = 0;
_lastSelectedRow = -1;
_clickedRow = -1;
_selectedColumnIndexes = [CPIndexSet indexSet];
_selectedRowIndexes = [CPIndexSet indexSet];
+20 -13
View File
@@ -169,8 +169,8 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[_CGInsetMakeZero(), _CGInsetMake(2.0, 2.0, 2.0, 2.0), [CPNull null]]
forKeys:[@"bezel-inset", @"content-inset", @"bezel-color"]];
return [CPDictionary dictionaryWithObjects:[_CGInsetMakeZero(), _CGInsetMake(2.0, 2.0, 2.0, 2.0), _CGInsetMake(3.0, 3.0, 3.0, 3.0), [CPNull null]]
forKeys:[@"bezel-inset", @"content-inset", @"border-inset", @"bezel-color"]];
}
/* @ignore */
@@ -507,31 +507,32 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
}
var contentRect = [self contentRectForBounds:[self bounds]],
verticalAlign = [self currentValueForThemeAttribute:"vertical-alignment"];
verticalAlign = [self currentValueForThemeAttribute:"vertical-alignment"],
lineHeight = [font defaultLineHeightForFont];
switch (verticalAlign)
{
case CPTopVerticalTextAlignment:
var topPoint = (_CGRectGetMinY(contentRect) + 1) + "px"; // for the same reason we have a -1 for the left, we also have a + 1 here
var topPoint = _CGRectGetMinY(contentRect) + "px"; // for the same reason we have a -1 for the left, we also have a + 1 here
break;
case CPCenterVerticalTextAlignment:
var topPoint = (_CGRectGetMidY(contentRect) - (font._lineHeight / 2) + 1) + "px";
var topPoint = (_CGRectGetMidY(contentRect) - (lineHeight / 2)) + "px";
break;
case CPBottomVerticalTextAlignment:
var topPoint = (_CGRectGetMaxY(contentRect) - font._lineHeight) + "px";
var topPoint = (_CGRectGetMaxY(contentRect) - lineHeight) + "px";
break;
default:
var topPoint = (_CGRectGetMinY(contentRect) + 1) + "px";
var topPoint = _CGRectGetMinY(contentRect) + "px";
break;
}
element.style.top = topPoint;
element.style.left = (_CGRectGetMinX(contentRect) - 1) + "px"; // why -1?
element.style.width = _CGRectGetWidth(contentRect) + "px";
element.style.height = font._lineHeight + "px"; // private ivar for the line height of the DOM text at this particular size
element.style.height = lineHeight + "px";
_DOMElement.appendChild(element);
@@ -1024,7 +1025,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
maxSize = [self currentValueForThemeAttribute:@"max-size"],
lineBreakMode = [self lineBreakMode],
text = (_stringValue || @" "),
textSize = _CGSizeMakeCopy(frameSize),
textSize = CGSizeMakeCopy(frameSize),
font = [self currentValueForThemeAttribute:@"font"];
textSize.width -= contentInset.left + contentInset.right;
@@ -1294,10 +1295,8 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
- (CGRect)contentRectForBounds:(CGRect)bounds
{
var contentInset = [self currentValueForThemeAttribute:@"content-inset"];
if (!contentInset)
return bounds;
var bezelInset = [self currentValueForThemeAttribute:@"bezel-inset"],
contentInset = [self currentValueForThemeAttribute:@"content-inset"];
bounds.origin.x += contentInset.left;
bounds.origin.y += contentInset.top;
@@ -1322,6 +1321,14 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
return bounds;
}
- (CGInset)borderInset
{
var bezelInset = [self currentValueForThemeAttribute:@"bezel-inset"],
borderInset = [self currentValueForThemeAttribute:@"border-inset"];
return CGInsetUnion(bezelInset, borderInset);
}
- (CGRect)rectForEphemeralSubviewNamed:(CPString)aName
{
if (aName === "bezel-view")
+56 -3
View File
@@ -25,9 +25,10 @@
@import <Foundation/CPKeyedUnarchiver.j>
var CPThemesByName = { },
CPThemeDefaultTheme = nil,
CPThemeDefaultHudTheme = nil;
var CPThemesByName = { },
CPThemeNamesByInheritance = [],
CPThemeDefaultTheme = nil,
CPThemeDefaultHudTheme = nil;
/*!
@@ -76,6 +77,52 @@ var CPThemesByName = { },
return CPThemesByName[aName];
}
/*!
Returns an array of names of all loaded themes, in the order they were loaded.
*/
+ (CPArray)allThemeNames
{
return [CPThemeNamesByInheritance copy];
}
/*!
Returns the closest matching theme for a given view or view class.
The matching proceeds as follows:
- The default theme class name for the class is retrieved.
- Starting with the last loaded theme and proceeding towards the default theme,
each theme is checked to see if it defines that theme class.
- If the theme defines the class name, that theme is returned.
- If no themes match, the default theme is returned.
@param aViewOrClass The view or view class to match with a theme
@return The first matching theme
*/
+ (CPTheme)themeForView:(id)aViewOrClass
{
var themeClass = nil;
if (class_isMetaClass(aViewOrClass.isa))
themeClass = [aViewOrClass defaultThemeClass];
else
themeClass = [aViewOrClass themeClass];
if (themeClass)
{
var count = CPThemeNamesByInheritance.length;
while (count--)
{
var theme = CPThemesByName[CPThemeNamesByInheritance[count]];
if ([theme._attributes containsKey:themeClass])
return theme;
}
}
return CPThemeDefaultTheme;
}
- (id)initWithName:(CPString)aName
{
self = [super init];
@@ -86,6 +133,9 @@ var CPThemesByName = { },
_attributes = [CPDictionary dictionary];
CPThemesByName[_name] = self;
if (![CPThemeNamesByInheritance containsObject:_name])
CPThemeNamesByInheritance.push(_name);
}
return self;
@@ -299,6 +349,9 @@ var CPThemeNameKey = @"CPThemeNameKey",
_attributes = [aCoder decodeObjectForKey:CPThemeAttributesKey];
CPThemesByName[_name] = self;
if (![CPThemeNamesByInheritance containsObject:_name])
CPThemeNamesByInheritance.push(_name);
}
return self;
+46 -24
View File
@@ -93,7 +93,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
return "tokenfield";
}
- (id)initWithFrame:(CPRect)frame
- (id)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame])
{
@@ -116,12 +116,12 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
{
var frame = [self frame];
_tokenScrollView = [[CPScrollView alloc] initWithFrame:CGRectMakeZero()];
_tokenScrollView = [[CPScrollView alloc] initWithFrame:_CGRectMakeZero()];
[_tokenScrollView setHasHorizontalScroller:NO];
[_tokenScrollView setHasVerticalScroller:NO];
[_tokenScrollView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
var contentView = [[CPView alloc] initWithFrame:CGRectMakeZero()];
var contentView = [[CPView alloc] initWithFrame:_CGRectMakeZero()];
[contentView setAutoresizingMask:CPViewWidthSizable];
[_tokenScrollView setDocumentView:contentView];
@@ -129,15 +129,15 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
_cachedCompletions = [];
_autocompleteContainer = [[CPView alloc] initWithFrame:CPRectMake(0.0, 0.0, frame.size.width, 92.0)];
_autocompleteContainer = [[CPView alloc] initWithFrame:_CGRectMake(0.0, 0.0, frame.size.width, 92.0)];
[_autocompleteContainer setBackgroundColor:[_CPMenuWindow backgroundColorForBackgroundStyle:_CPMenuWindowPopUpBackgroundStyle]];
_autocompleteScrollView = [[CPScrollView alloc] initWithFrame:CPRectMake(1.0, 1.0, frame.size.width - 2.0, 90.0)];
_autocompleteScrollView = [[CPScrollView alloc] initWithFrame:_CGRectMake(1.0, 1.0, frame.size.width - 2.0, 90.0)];
[_autocompleteScrollView setAutohidesScrollers:YES];
[_autocompleteScrollView setHasHorizontalScroller:NO];
[_autocompleteContainer addSubview:_autocompleteScrollView];
_autocompleteView = [[CPTableView alloc] initWithFrame:CPRectMakeZero()];
_autocompleteView = [[CPTableView alloc] initWithFrame:_CGRectMakeZero()];
var tableColumn = [[CPTableColumn alloc] initWithIdentifier:CPTokenFieldTableColumnIdentifier];
[tableColumn setResizingMask:CPTableColumnAutoresizingMask];
@@ -163,12 +163,16 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
{
var indexOfSelectedItem = 0;
#if PLATFORM(DOM)
_cachedCompletions = [self tokenField:self completionsForSubstring:[self _inputElement].value indexOfToken:0 indexOfSelectedItem:indexOfSelectedItem];
#endif
[_autocompleteView selectRowIndexes:[CPIndexSet indexSetWithIndex:indexOfSelectedItem] byExtendingSelection:NO];
[_autocompleteView reloadData];
}
#if PLATFORM(DOM)
- (void)_autocompleteWithDOMEvent:(JSObject)DOMEvent
{
if (!_cachedCompletions || ![self hasThemeState:CPThemeStateAutoCompleting])
@@ -222,6 +226,8 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
[self _autocompleteWithDOMEvent:nil];
}
#endif
- (void)_selectToken:(_CPTokenFieldToken)token byExtendingSelection:(BOOL)extend
{
var indexOfToken = [[self _tokens] indexOfObject:token];
@@ -372,10 +378,10 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
[self unsetThemeState:CPThemeStateEditing];
[self _autocomplete];
#if PLATFORM(DOM)
[self _autocomplete];
var element = [self _inputElement];
CPTokenFieldInputResigning = YES;
@@ -658,7 +664,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
rowRect = [autocompleteView rectOfRow:index],
owner = CPTokenFieldInputOwner;
if (rowRect && !CPRectContainsRect([clipView bounds], rowRect))
if (rowRect && !CGRectContainsRect([clipView bounds], rowRect))
[clipView scrollToPoint:[autocompleteView rectOfRow:index].origin];
if (aDOMEvent.keyCode === CPReturnKeyCode || aDOMEvent.keyCode === CPTabKeyCode)
@@ -748,7 +754,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
else if (aDOMEvent.keyCode === CPDeleteKeyCode)
{
// Highlight the previous token if backspace was pressed in an empty input element or re-show the completions view
if (CPTokenFieldDOMInputElement.value == @"")
if (CPTokenFieldDOMInputElement.value.length === 0)
{
[self _hideCompletions];
@@ -868,6 +874,15 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
}
#endif
// In the context of a token field, it is empty when there are no tokens
- (void)_updatePlaceholderState
{
if (([[self _tokens] count] === 0) && ![self hasThemeState:CPThemeStateEditing])
[self setThemeState:CPTextFieldStatePlaceholder];
else
[self unsetThemeState:CPTextFieldStatePlaceholder];
}
// - (void)setTokenStyle: (NSTokenStyle) style;
// - (NSTokenStyle)tokenStyle;
//
@@ -950,9 +965,9 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
// Manually sizeToFit because CPTableView's sizeToFit doesn't work properly
[_autocompleteContainer setHidden:NO];
var frameOrigin = [self convertPoint:[self bounds].origin toView:[_autocompleteContainer superview]];
[_autocompleteContainer setFrameOrigin:CPPointMake(frameOrigin.x, frameOrigin.y + frame.size.height)];
[_autocompleteContainer setFrameSize:CPSizeMake(CPRectGetWidth([self bounds]), 92.0)];
[_autocompleteScrollView setFrameSize:CPSizeMake([_autocompleteContainer frame].size.width - 2.0, 90.0)];
[_autocompleteContainer setFrameOrigin:_CGPointMake(frameOrigin.x, frameOrigin.y + frame.size.height)];
[_autocompleteContainer setFrameSize:_CGSizeMake(_CGRectGetWidth([self bounds]), 92.0)];
[_autocompleteScrollView setFrameSize:_CGSizeMake([_autocompleteContainer frame].size.width - 2.0, 90.0)];
}
else
[_autocompleteContainer setHidden:YES];
@@ -962,11 +977,11 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
return;
// Move each token into the right position.
var contentRect = CGRectMakeCopy([contentView bounds]),
var contentRect = _CGRectMakeCopy([contentView bounds]),
contentOrigin = contentRect.origin,
contentSize = contentRect.size,
offset = CPPointMake(contentOrigin.x, contentOrigin.y),
spaceBetweenTokens = CPSizeMake(2.0, 2.0),
offset = _CGPointMake(contentOrigin.x, contentOrigin.y),
spaceBetweenTokens = _CGSizeMake(2.0, 2.0),
isEditing = [[self window] firstResponder] == self,
tokenToken = [_CPTokenFieldToken new];
@@ -977,7 +992,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
var fitAndFrame = function(width, height)
{
var r = CGRectMake(0, 0, width, height);
var r = _CGRectMake(0, 0, width, height);
if (offset.x + width >= contentSize.width && offset.x > contentOrigin.x)
{
@@ -990,7 +1005,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
// Make sure the frame fits.
if (CGRectGetHeight([contentView bounds]) < offset.y + height)
[contentView setFrame:CGRectMake(0, 0, CGRectGetWidth([_tokenScrollView bounds]), offset.y + height)];
[contentView setFrame:_CGRectMake(0, 0, CGRectGetWidth([_tokenScrollView bounds]), offset.y + height)];
offset.x += width + spaceBetweenTokens.width;
@@ -999,6 +1014,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
var placeEditor = function(useRemainingWidth)
{
#if PLATFORM(DOM)
var element = [self _inputElement],
textWidth = 1;
@@ -1008,6 +1024,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
// without clipping. Since different fonts might have different sizes of "X" this
// solution is not ideal, but it works.
textWidth = [(element.value || @"") + "X" sizeWithFont:[self font]].width;
if (useRemainingWidth)
textWidth = MAX(contentSize.width - offset.x - 1, textWidth);
}
@@ -1022,6 +1039,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
// When editing, always scroll to the cursor.
if (_selectedRange.length == 0)
[[_tokenScrollView documentView] scrollRectToVisible:inputFrame];
#endif
}
for (var i = 0, count = [tokens count]; i < count; i++)
@@ -1048,6 +1066,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
if (isEditing && CPMaxRange(_selectedRange) >= [tokens count])
placeEditor(true);
#if PLATFORM(DOM)
// Hide the editor if there are selected tokens, but still keep it active
// so we can continue using our standard keyboard handling events.
if (isEditing && _selectedRange.length)
@@ -1055,24 +1074,27 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
[self _inputElement].style.left = "-10000px";
[self _inputElement].focus();
}
#endif
// Trim off any excess height downwards.
if (CGRectGetHeight([contentView bounds]) > offset.y + tokenHeight)
[contentView setFrame:CGRectMake(0, 0, CGRectGetWidth([_tokenScrollView bounds]), offset.y + tokenHeight)];
[contentView setFrame:_CGRectMake(0, 0, CGRectGetWidth([_tokenScrollView bounds]), offset.y + tokenHeight)];
if (_shouldScrollTo !== CPScrollDestinationNone)
{
// Only carry out the scroll if the cursor isn't visible.
if (!(isEditing && _selectedRange.length == 0))
{
var scrollToToken = _shouldScrollTo;
if (scrollToToken === CPScrollDestinationLeft)
scrollToToken = tokens[_selectedRange.location]
else if (scrollToToken === CPScrollDestinationRight)
scrollToToken = tokens[MAX(0, CPMaxRange(_selectedRange) - 1)];
[self _scrollTokenViewToVisible:scrollToToken];
}
_shouldScrollTo = CPScrollDestinationNone;
}
}
@@ -1188,11 +1210,11 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
return "tokenfield-token";
}
- (id)initWithFrame:(CPRect)frame
- (id)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame])
{
_deleteButton = [[_CPTokenFieldTokenCloseButton alloc] initWithFrame:CPRectMakeZero()];
_deleteButton = [[_CPTokenFieldTokenCloseButton alloc] initWithFrame:_CGRectMakeZero()];
[self addSubview:_deleteButton];
[self setEditable:NO];
@@ -1253,7 +1275,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
buttonOffset = [_deleteButton currentValueForThemeAttribute:@"offset"],
buttonSize = [_deleteButton currentValueForThemeAttribute:@"min-size"];
[_deleteButton setFrame:CPRectMake(CPRectGetMaxX(frame) - buttonOffset.x, CPRectGetMinY(frame) + buttonOffset.y, buttonSize.width, buttonSize.height)];
[_deleteButton setFrame:_CGRectMake(_CGRectGetMaxX(frame) - buttonOffset.x, _CGRectGetMinY(frame) + buttonOffset.y, buttonSize.width, buttonSize.height)];
}
}
@@ -1329,4 +1351,4 @@ var CPTokenFieldTokenizingCharacterSetKey = "CPTokenFieldTokenizingCharacterSe
[aCoder encodeDouble:_completionDelay forKey:CPTokenFieldCompletionDelayKey];
}
@end
@end
+28 -2
View File
@@ -295,7 +295,7 @@ var CPViewFlags = { },
_DOMImageSizes = [];
#endif
_theme = [CPTheme defaultTheme];
_theme = [CPTheme themeForView:self];
_themeState = CPThemeStateNormal;
[self setupViewFlags];
@@ -2543,6 +2543,32 @@ setBoundsOrigin:
return (_themeAttributes && _themeAttributes[aName] !== undefined);
}
- (void)registerThemeValues:(CPArray)themeValues
{
for (var i = 0; i < themeValues.length; ++i)
{
var attributeValueState = themeValues[i],
attribute = attributeValueState[0],
value = attributeValueState[1],
state = attributeValueState[2];
if (state)
[self setValue:value forThemeAttribute:attribute inState:state];
else
[self setValue:value forThemeAttribute:attribute];
}
}
- (void)registerThemeValues:(CPArray)themeValues inherit:(CPArray)inheritedValues
{
// Register inherited values first, then override those with the subtheme values.
if (inheritedValues)
[self registerThemeValues:inheritedValues];
if (themeValues)
[self registerThemeValues:themeValues];
}
- (CPView)createEphemeralSubviewNamed:(CPString)aViewName
{
return nil;
@@ -2695,7 +2721,7 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
[self setupViewFlags];
_theme = [CPTheme defaultTheme];
_theme = [CPTheme themeForView:self];
_themeClass = [aCoder decodeObjectForKey:CPViewThemeClassKey];
_themeState = CPThemeState([aCoder decodeIntForKey:CPViewThemeStateKey]);
_themeAttributes = {};
@@ -0,0 +1,64 @@
/*
* CPCibRuntimeAttributesConnector.j
* AppKit
*
* Created by Aparajita Fishman.
* Copyright 2011, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPCibConnector.j"
var CPCibRuntimeAttributesConnectorObjectKey = @"CPCibRuntimeAttributesConnectorObjectKey",
CPCibRuntimeAttributesConnectorKeyPathsKey = @"CPCibRuntimeAttributesConnectorKeyPathsKey",
CPCibRuntimeAttributesConnectorValuesKey = @"CPCibRuntimeAttributesConnectorValuesKey";
@implementation CPCibRuntimeAttributesConnector : CPCibConnector
{
id _keyPaths;
id _values;
}
- (id)initWithCoder:(CPCoder)aCoder
{
if (self = [super initWithCoder:aCoder])
{
_source = [aCoder decodeObjectForKey:CPCibRuntimeAttributesConnectorObjectKey];
_keyPaths = [aCoder decodeObjectForKey:CPCibRuntimeAttributesConnectorKeyPathsKey];
_values = [aCoder decodeObjectForKey:CPCibRuntimeAttributesConnectorValuesKey];
}
return self;
}
- (void)encodeWithCoder:(CPCoder)aCoder
{
[super encodeWithCoder:aCoder];
[aCoder encodeObject:_source forKey:CPCibRuntimeAttributesConnectorObjectKey];
[aCoder encodeObject:_keyPaths forKey:CPCibRuntimeAttributesConnectorKeyPathsKey];
[aCoder encodeObject:_values forKey:CPCibRuntimeAttributesConnectorValuesKey];
}
- (void)establishConnection
{
var count = [_keyPaths count];
while (count--)
[_source setValue:_values[count] forKeyPath:_keyPaths[count]];
}
@end
+2 -2
View File
@@ -61,14 +61,14 @@ var _CPCibClassSwapperClassNameKey = @"_CPCibClassSwapperClassNameKey",
if (!object)
{
CPLog.error("Unable to find class " + theClassName + " in cib file.");
CPLog.error("Unable to find class " + theClassName + " referenced in cib file.");
object = [self allocObjectWithCoder:aCoder className:[aCoder decodeObjectForKey:_CPCibClassSwapperOriginalClassNameKey]];
}
}
if (!object)
[CPException raise:CPInvalidArgumentException reason:@"Unable to find class " + theClassName + " in cib file."];
[CPException raise:CPInvalidArgumentException reason:@"Unable to find class " + theClassName + " referenced in cib file."];
return object;
}
+17 -1
View File
@@ -43,6 +43,11 @@ var _CPCibCustomResourceClassNameKey = @"_CPCibCustomResourceClassNameKey",
return [[self alloc] initWithClassName:@"CPImage" resourceName:aResourceName properties:[CPDictionary dictionaryWithObject:aSize forKey:@"size"]];
}
+ (id)imageResourceWithName:(CPString)aResourceName size:(CGSize)aSize bundleClass:(CPString)aBundleClass
{
return [[self alloc] initWithClassName:@"CPImage" resourceName:aResourceName properties:[CPDictionary dictionaryWithObjects:[aSize, aBundleClass] forKeys:[@"size", @"bundleClass"]]];
}
- (id)initWithClassName:(CPString)aClassName resourceName:(CPString)aResourceName properties:(CPDictionary)properties
{
self = [super init];
@@ -89,7 +94,18 @@ var _CPCibCustomResourceClassNameKey = @"_CPCibCustomResourceClassNameKey",
else if (_resourceName == "CPRemoveTemplate")
return [[CPImage alloc] initWithContentsOfFile:[[CPBundle bundleForClass:[CPButtonBar class]] pathForResource:@"minus_button.png"] size:CGSizeMake(11, 4)];
return [[CPImage alloc] initWithContentsOfFile:[[aCoder bundle] pathForResource:_resourceName] size:_properties.valueForKey(@"size")];
var bundleClass = _properties.valueForKey(@"bundleClass"),
bundle = nil;
if (bundleClass)
{
bundleClass = CPClassFromString(bundleClass);
if (bundleClass)
bundle = [CPBundle bundleForClass:bundleClass];
}
return [[CPImage alloc] initWithContentsOfFile:[(bundle || [aCoder bundle]) pathForResource:_resourceName] size:_properties.valueForKey(@"size")];
}
return self;
+21 -2
View File
@@ -29,6 +29,7 @@
@import "CPCibControlConnector.j"
@import "CPCibOutletConnector.j"
@import "CPCibBindingConnector.j"
@import "CPCibRuntimeAttributesConnector.j"
@implementation _CPCibObjectData : CPObject
@@ -257,11 +258,29 @@ var _CPCibObjectDataNamesKeysKey = @"_CPCibObjectDataNamesKeysKey
_replacementObjects[[_fileOwner UID]] = anOwner;
var index = 0,
count = _connections.length;
count = _connections.length,
runtimeAttributeConnectors = [],
connection = nil;
for (; index < count; ++index)
{
var connection = _connections[index];
connection = _connections[index];
if ([connection isKindOfClass:[CPCibRuntimeAttributesConnector class]])
// Defer runtime attribute connections until after all other connections are made
runtimeAttributeConnectors.push(connection);
else
{
[connection replaceObjects:_replacementObjects];
[connection establishConnection];
}
}
count = runtimeAttributeConnectors.length;
for (index = 0; index < count; ++index)
{
connection = runtimeAttributeConnectors[index];
[connection replaceObjects:_replacementObjects];
[connection establishConnection];
+26
View File
@@ -267,6 +267,32 @@ function CGPointFromEvent(anEvent)
return _CGPointMake(anEvent.clientX, anEvent.clientY);
}
/*!
Combines two insets by adding their individual elements and returns the result.
@group CGInset
*/
function CGInsetUnion(lhsInset, rhsInset)
{
return _CGInsetMake(lhsInset.top + rhsInset.top,
lhsInset.right + rhsInset.right,
lhsInset.bottom + rhsInset.bottom,
lhsInset.left + rhsInset.left);
}
/*!
Subtract one inset from another by subtracting their individual elements and returns the result.
@group CGInset
*/
function CGInsetDifference(lhsInset, rhsInset)
{
return _CGInsetMake(lhsInset.top - rhsInset.top,
lhsInset.right - rhsInset.right,
lhsInset.bottom - rhsInset.bottom,
lhsInset.left - rhsInset.left);
}
function CGInsetFromString(aString)
{
var numbers = aString.substr(1, aString.length - 2).split(',');
Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 B

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 757 B

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 B

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 559 B

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 B

After

Width:  |  Height:  |  Size: 515 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1004 B

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 994 B

After

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 991 B

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 994 B

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 997 B

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1004 B

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 994 B

After

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 991 B

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 994 B

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 997 B

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1012 B

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1012 B

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 991 B

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1007 B

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 212 B

+155 -51
View File
@@ -762,46 +762,47 @@ var themedButtonValues = nil,
bezelColor = PatternColor(
[
["textfield-bezel-square-0.png", 3.0, 4.0],
["textfield-bezel-square-1.png", 1.0, 4.0],
["textfield-bezel-square-2.png", 3.0, 4.0],
["textfield-bezel-square-3.png", 3.0, 1.0],
["textfield-bezel-square-0.png", 6.0, 6.0],
["textfield-bezel-square-1.png", 1.0, 6.0],
["textfield-bezel-square-2.png", 6.0, 6.0],
["textfield-bezel-square-3.png", 6.0, 1.0],
["textfield-bezel-square-4.png", 1.0, 1.0],
["textfield-bezel-square-5.png", 3.0, 1.0],
["textfield-bezel-square-6.png", 3.0, 4.0],
["textfield-bezel-square-7.png", 1.0, 4.0],
["textfield-bezel-square-8.png", 3.0, 4.0]
["textfield-bezel-square-5.png", 6.0, 1.0],
["textfield-bezel-square-6.png", 6.0, 6.0],
["textfield-bezel-square-7.png", 1.0, 6.0],
["textfield-bezel-square-8.png", 6.0, 6.0]
]),
bezelFocusedColor = PatternColor(
[
["textfield-bezel-square-focused-0.png", 7.0, 7.0],
["textfield-bezel-square-focused-1.png", 1.0, 7.0],
["textfield-bezel-square-focused-2.png", 7.0, 7.0],
["textfield-bezel-square-focused-3.png", 7.0, 1.0],
["textfield-bezel-square-focused-0.png", 6.0, 6.0],
["textfield-bezel-square-focused-1.png", 1.0, 6.0],
["textfield-bezel-square-focused-2.png", 6.0, 6.0],
["textfield-bezel-square-focused-3.png", 6.0, 1.0],
["textfield-bezel-square-focused-4.png", 1.0, 1.0],
["textfield-bezel-square-focused-5.png", 7.0, 1.0],
["textfield-bezel-square-focused-6.png", 7.0, 7.0],
["textfield-bezel-square-focused-7.png", 1.0, 7.0],
["textfield-bezel-square-focused-8.png", 7.0, 7.0]
["textfield-bezel-square-focused-5.png", 6.0, 1.0],
["textfield-bezel-square-focused-6.png", 6.0, 6.0],
["textfield-bezel-square-focused-7.png", 1.0, 6.0],
["textfield-bezel-square-focused-8.png", 6.0, 6.0]
]),
bezelDisabledColor = PatternColor(
[
["textfield-bezel-square-disabled-0.png", 3.0, 4.0],
["textfield-bezel-square-disabled-1.png", 1.0, 4.0],
["textfield-bezel-square-disabled-2.png", 3.0, 4.0],
["textfield-bezel-square-disabled-3.png", 3.0, 1.0],
["textfield-bezel-square-disabled-0.png", 6.0, 6.0],
["textfield-bezel-square-disabled-1.png", 1.0, 6.0],
["textfield-bezel-square-disabled-2.png", 6.0, 6.0],
["textfield-bezel-square-disabled-3.png", 6.0, 1.0],
["textfield-bezel-square-disabled-4.png", 1.0, 1.0],
["textfield-bezel-square-disabled-5.png", 3.0, 1.0],
["textfield-bezel-square-disabled-6.png", 3.0, 4.0],
["textfield-bezel-square-disabled-7.png", 1.0, 4.0],
["textfield-bezel-square-disabled-8.png", 3.0, 4.0]
["textfield-bezel-square-disabled-5.png", 6.0, 1.0],
["textfield-bezel-square-disabled-6.png", 6.0, 6.0],
["textfield-bezel-square-disabled-7.png", 1.0, 6.0],
["textfield-bezel-square-disabled-8.png", 6.0, 6.0]
]),
textDisabledColor = [CPColor colorWithCalibratedWhite:0.60 alpha:1.0],
placeholderColor = [CPColor colorWithCalibratedRed:189.0 / 255.0 green:199.0 / 255.0 blue:211.0 / 255.0 alpha:1.0];
// Global for reuse by CPTokenField.
// Global for reuse by subclasses
themedTextFieldValues =
[
[@"vertical-alignment", CPTopVerticalTextAlignment, CPThemeStateBezeled],
@@ -810,30 +811,37 @@ var themedButtonValues = nil,
[@"bezel-color", bezelDisabledColor, CPThemeStateBezeled | CPThemeStateDisabled],
[@"font", [CPFont systemFontOfSize:12.0], CPThemeStateBezeled],
[@"content-inset", CGInsetMake(8.0, 7.0, 5.0, 8.0), CPThemeStateBezeled],
[@"content-inset", CGInsetMake(7.0, 7.0, 5.0, 8.0), CPThemeStateBezeled | CPThemeStateEditing],
[@"bezel-inset", CGInsetMake(3.0, 4.0, 3.0, 4.0), CPThemeStateBezeled],
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBezeled | CPThemeStateEditing],
// no border
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0)],
[@"content-inset", CGInsetMake(2.0, 2.0, 2.0, 2.0)], // as defined in [CPTextField +themeAttributes]
// with border
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBezeled],
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBezeled | CPThemeStateEditing],
[@"border-inset", CGInsetMake(3.0, 3.0, 3.0, 3.0), CPThemeStateBezeled],
[@"content-inset", CGInsetMake(8.0, 8.0, 7.0, 8.0), CPThemeStateBezeled],
[@"content-inset", CGInsetMake(8.0, 8.0, 7.0, 8.0), CPThemeStateBezeled | CPThemeStateEditing],
[@"text-color", textDisabledColor, CPThemeStateBezeled | CPThemeStateDisabled],
[@"text-color", placeholderColor, CPTextFieldStatePlaceholder],
[@"line-break-mode", CPLineBreakByTruncatingTail, CPThemeStateTableDataView],
[@"vertical-alignment", CPCenterVerticalTextAlignment, CPThemeStateTableDataView],
[@"content-inset", CGInsetMake(0.0, 0.0, 0.0, 5.0), CPThemeStateTableDataView],
[@"content-inset", CGInsetMake(0.0, 0.0, 0.0, 4.0), CPThemeStateTableDataView],
[@"text-color", [CPColor colorWithCalibratedWhite:51.0 / 255.0 alpha:1.0], CPThemeStateTableDataView],
[@"text-color", [CPColor whiteColor], CPThemeStateTableDataView | CPThemeStateSelectedTableDataView],
[@"font", [CPFont boldSystemFontOfSize:12.0], CPThemeStateTableDataView | CPThemeStateSelectedTableDataView],
[@"text-color", [CPColor blackColor], CPThemeStateTableDataView | CPThemeStateEditing],
[@"content-inset", CGInsetMake(7.0, 7.0, 5.0, 8.0), CPThemeStateTableDataView | CPThemeStateEditing],
[@"content-inset", CGInsetMake(8.0, 8.0, 7.0, 4.0), CPThemeStateTableDataView | CPThemeStateEditing],
[@"font", [CPFont systemFontOfSize:12.0], CPThemeStateTableDataView | CPThemeStateEditing],
[@"bezel-inset", CGInsetMake(-2.0, -2.0, -2.0, -2.0), CPThemeStateTableDataView | CPThemeStateEditing],
[@"bezel-inset", CGInsetMake(-1.0, -1.0, -1.0, -1.0), CPThemeStateTableDataView | CPThemeStateEditing],
[@"text-color", [CPColor colorWithCalibratedWhite:125.0 / 255.0 alpha:1.0], CPThemeStateTableDataView | CPThemeStateGroupRow],
[@"text-color", [CPColor colorWithCalibratedWhite:1.0 alpha:1.0], CPThemeStateTableDataView | CPThemeStateGroupRow | CPThemeStateSelectedTableDataView],
[@"text-shadow-color", [CPColor whiteColor], CPThemeStateTableDataView | CPThemeStateGroupRow],
[@"text-shadow-offset", CGSizeMake(0,1), CPThemeStateTableDataView | CPThemeStateGroupRow],
[@"text-shadow-color", [CPColor colorWithCalibratedWhite:0.0 alpha:0.6], CPThemeStateTableDataView | CPThemeStateGroupRow | CPThemeStateSelectedTableDataView],
[@"text-shadow-color", [CPColor colorWithCalibratedWhite:0.0 alpha:0.6], CPThemeStateTableDataView | CPThemeStateGroupRow | CPThemeStateSelectedTableDataView],
[@"font", [CPFont boldSystemFontOfSize:12.0], CPThemeStateTableDataView | CPThemeStateGroupRow]
];
@@ -853,35 +861,45 @@ var themedButtonValues = nil,
var textfield = [[CPTextField alloc] initWithFrame:CGRectMake(0.0, 0.0, 60.0, 30.0)],
bezelColor = PatternColor(
[
["textfield-bezel-rounded-left.png", 13.0, 22.0],
["textfield-bezel-rounded-center.png", 1.0, 22.0],
["textfield-bezel-rounded-right.png", 13.0, 22.0]
["textfield-bezel-rounded-left.png", 15.0, 30.0],
["textfield-bezel-rounded-center.png", 1.0, 30.0],
["textfield-bezel-rounded-right.png", 15.0, 30.0]
],
PatternIsHorizontal),
bezelFocusedColor = PatternColor(
[
["textfield-bezel-rounded-focused-left.png", 17.0, 30.0],
["textfield-bezel-rounded-focused-left.png", 15.0, 30.0],
["textfield-bezel-rounded-focused-center.png", 1.0, 30.0],
["textfield-bezel-rounded-focused-right.png", 17.0, 30.0]
["textfield-bezel-rounded-focused-right.png", 15.0, 30.0]
],
PatternIsHorizontal),
bezelDisabledColor = PatternColor(
[
["textfield-bezel-rounded-disabled-left.png", 15.0, 30.0],
["textfield-bezel-rounded-disabled-center.png", 1.0, 30.0],
["textfield-bezel-rounded-disabled-right.png", 15.0, 30.0]
],
PatternIsHorizontal),
placeholderColor = [CPColor colorWithCalibratedRed:189.0 / 255.0 green:199.0 / 255.0 blue:211.0 / 255.0 alpha:1.0];
// Global for reuse by CPSearchField
// Global for reuse by subclasses
themedRoundedTextFieldValues =
[
[@"bezel-color", bezelColor, CPTextFieldStateRounded | CPThemeStateBezeled],
[@"bezel-color", bezelFocusedColor, CPTextFieldStateRounded | CPThemeStateBezeled | CPThemeStateEditing],
[@"bezel-color", bezelDisabledColor, CPTextFieldStateRounded | CPThemeStateBezeled | CPThemeStateDisabled],
[@"font", [CPFont systemFontOfSize:12.0]],
[@"content-inset", CGInsetMake(8.0, 14.0, 6.0, 14.0), CPTextFieldStateRounded | CPThemeStateBezeled],
[@"content-inset", CGInsetMake(7.0, 14.0, 6.0, 14.0), CPTextFieldStateRounded | CPThemeStateBezeled | CPThemeStateEditing],
[@"bezel-inset", CGInsetMake(4.0, 4.0, 4.0, 4.0), CPTextFieldStateRounded | CPThemeStateBezeled],
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPTextFieldStateRounded | CPThemeStateBezeled],
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPTextFieldStateRounded | CPThemeStateBezeled | CPThemeStateEditing],
// There is one extra empty pixel at the bottom for size compatibility with an earlier version.
[@"content-inset", CGInsetMake(8.0, 15.0, 8.0, 15.0), CPTextFieldStateRounded | CPThemeStateBezeled],
[@"content-inset", CGInsetMake(8.0, 15.0, 8.0, 15.0), CPTextFieldStateRounded | CPThemeStateBezeled | CPThemeStateEditing],
[@"text-color", placeholderColor, CPTextFieldStateRounded | CPTextFieldStatePlaceholder],
[@"min-size", CGSizeMake(0.0, 30.0), CPTextFieldStateRounded | CPThemeStateBezeled],
@@ -914,11 +932,17 @@ var themedButtonValues = nil,
overrides =
[
[@"content-inset", CGInsetMake(8.0, 0.0, 4.0, 0.0)],
// Placeholder is displayed as regular text, not tokens; requires a different inset.
[@"content-inset", CGInsetMake(9.0, 0.0, 5.0, 2.0), CPTextFieldStatePlaceholder],
[@"content-inset", CGInsetMake(6.0, 5.0, 5.0, 6.0), CPThemeStateBezeled],
[@"content-inset", CGInsetMake(9.0, 7.0, 6.0, 8.0), CPThemeStateBezeled | CPTextFieldStatePlaceholder],
// Non-bezeled token field with tokens
[@"content-inset", CGInsetMake(5.0, 8.0, 4.0, 8.0)],
// Non-bezeled token field with no tokens
[@"content-inset", CGInsetMake(7.0, 8.0, 6.0, 8.0), CPTextFieldStatePlaceholder],
// Bezeled token field with tokens
[@"content-inset", CGInsetMake(6.0, 8.0, 5.0, 8.0), CPThemeStateBezeled],
// Bezeled token field with no tokens
[@"content-inset", CGInsetMake(8.0, 8.0, 7.0, 8.0), CPThemeStateBezeled | CPTextFieldStatePlaceholder],
];
[self registerThemeValues:overrides forView:tokenfield inherit:themedTextFieldValues];
@@ -958,13 +982,13 @@ var themedButtonValues = nil,
[@"text-color", textHighlightedColor, CPThemeStateHighlighted],
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBezeled],
[@"content-inset", CGInsetMake(1.0, 24.0, 2.0, 16.0), CPThemeStateBezeled],
[@"content-inset", CGInsetMake(1.0, 23.0, 3.0, 15.0), CPThemeStateBezeled],
// Minimum height == maximum height since tokens are fixed height.
[@"min-size", CGSizeMake(0.0, 19.0)],
[@"max-size", CGSizeMake(-1.0, 19.0)],
[@"vertical-alignment", CPCenterTextAlignment],
[@"vertical-alignment", CPCenterTextAlignment]
];
[self registerThemeValues:themeValues forView:token];
@@ -990,7 +1014,7 @@ var themedButtonValues = nil,
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBordered],
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBordered | CPThemeStateHighlighted],
[@"offset", CGPointMake(18, 6), CPThemeStateBordered]
[@"offset", CGPointMake(17, 6), CPThemeStateBordered]
];
[self registerThemeValues:themeValues forView:button];
@@ -998,6 +1022,86 @@ var themedButtonValues = nil,
return button;
}
+ (CPComboBox)themedComboBox
{
var combo = [[CPComboBox alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 29.0)],
bezelColor = PatternColor(
[
["combobox-bezel-left.png", 6.0, 29.0],
["combobox-bezel-center.png", 1.0, 29.0],
["combobox-bezel-right.png", 24.0, 29.0]
],
PatternIsHorizontal),
bezelFocusedColor = PatternColor(
[
["combobox-bezel-focused-left.png", 6.0, 29.0],
["combobox-bezel-focused-center.png", 1.0, 29.0],
["combobox-bezel-focused-right.png", 24.0, 29.0]
],
PatternIsHorizontal),
bezelDisabledColor = PatternColor(
[
["combobox-bezel-disabled-left.png", 6.0, 29.0],
["combobox-bezel-disabled-center.png", 1.0, 29.0],
["combobox-bezel-disabled-right.png", 24.0, 29.0]
],
PatternIsHorizontal),
bezelNoBorderColor = PatternColor(
[
["combobox-bezel-no-border-left.png", 6.0, 29.0],
["combobox-bezel-no-border-center.png", 1.0, 29.0],
["combobox-bezel-no-border-right.png", 24.0, 29.0]
],
PatternIsHorizontal),
bezelNoBorderFocusedColor = PatternColor(
[
["combobox-bezel-no-border-focused-left.png", 6.0, 29.0],
["combobox-bezel-no-border-focused-center.png", 1.0, 29.0],
["combobox-bezel-no-border-focused-right.png", 24.0, 29.0]
],
PatternIsHorizontal),
bezelNoBorderDisabledColor = PatternColor(
[
["combobox-bezel-no-border-disabled-left.png", 6.0, 29.0],
["combobox-bezel-no-border-disabled-center.png", 1.0, 29.0],
["combobox-bezel-no-border-disabled-right.png", 24.0, 29.0]
],
PatternIsHorizontal),
overrides =
[
[@"bezel-color", bezelColor, CPThemeStateBezeled | CPComboBoxStateButtonBordered],
[@"bezel-color", bezelFocusedColor, CPThemeStateBezeled | CPComboBoxStateButtonBordered | CPThemeStateEditing],
[@"bezel-color", bezelDisabledColor, CPThemeStateBezeled | CPComboBoxStateButtonBordered | CPThemeStateDisabled],
[@"bezel-color", bezelNoBorderColor, CPThemeStateBezeled],
[@"bezel-color", bezelNoBorderFocusedColor, CPThemeStateBezeled | CPThemeStateEditing],
[@"bezel-color", bezelNoBorderDisabledColor, CPThemeStateBezeled | CPThemeStateDisabled],
// The right border inset has to make room for the focus ring and popup button
[@"content-inset", CGInsetMake(8.0, 27.0, 7.0, 8.0), CPThemeStateBezeled | CPComboBoxStateButtonBordered],
[@"content-inset", CGInsetMake(8.0, 24.0, 7.0, 8.0), CPThemeStateBezeled],
[@"content-inset", CGInsetMake(8.0, 24.0, 7.0, 8.0), CPThemeStateBezeled | CPThemeStateEditing],
[@"popup-button-size", CGSizeMake(21.0, 23.0), CPThemeStateBezeled | CPComboBoxStateButtonBordered],
[@"popup-button-size", CGSizeMake(17.0, 23.0), CPThemeStateBezeled],
// Because combo box uses a three-part bezel, the height is fixed
[@"min-size", CGSizeMake(0, 29.0)],
[@"max-size", CGSizeMake(-1, 29.0)]
];
[self registerThemeValues:overrides forView:combo inherit:themedTextFieldValues];
return combo;
}
+ (CPRadioButton)themedRadioButton
{
var button = [CPRadio radioWithTitle:@"Hello Friend!"],
+24
View File
@@ -288,6 +288,30 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0,
return _textShadowOffset;
}
- (CGRect)textFrame
{
[self layoutIfNeeded];
var textFrame = CGRectMakeZero();
#if PLATFORM(DOM)
if (_DOMTextElement)
{
var textStyle = _DOMTextElement.style;
textFrame.origin.y = parseInt(textStyle.top.substr(0, textStyle.top.length - 2), 10),
textFrame.origin.x = parseInt(textStyle.left.substr(0, textStyle.left.length - 2), 10),
textFrame.size.width = parseInt(textStyle.width.substr(0, textStyle.width.length - 2), 10),
textFrame.size.height = parseInt(textStyle.height.substr(0, textStyle.height.length - 2), 10);
textFrame.size.width += _textShadowOffset.width;
textFrame.size.height += _textShadowOffset.height;
}
#endif
return textFrame;
}
- (void)setImage:(CPImage)anImage
{
if (_image == anImage)
+715
View File
@@ -0,0 +1,715 @@
/*
* _CPPopUpList.j
* AppKit
*
* Created by Aparajita Fishman.
* Copyright (c) 2011, Intalio, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPTableView.j"
/*!
Notification sent when the list is about to pop up. \c object is the _CPPopUpList.
*/
_CPPopUpListWillPopUpNotification = @"_CPPopUpListWillPopUpNotification";
/*!
Notification sent when the list is about to be dismissed. \c object is the _CPPopUpList.
*/
_CPPopUpListWillDismissNotification = @"_CPPopUpListWillDismissNotification";
/*!
Notification sent when the list is dismissed. \c object is the _CPPopUpList.
*/
_CPPopUpListDidDismissNotification = @"_CPPopUpListDidDismissNotification";
/*!
Notification sent when the selection of the list changes. \c object is the _CPPopUpList.
*/
_CPPopUpListDidDismissNotification = @"_CPPopUpListDidDismissNotification";
/*!
Notification sent when the list is dismissed. \c object is the _CPPopUpList.
*/
_CPPopUpListDidDismissNotification = @"_CPPopUpListDidDismissNotification";
/*!
Notification sent by when an item is selected. \c object is the _CPPopUpList.
When this is received the list has already been dismissed and the dismiss notification has been sent.
*/
_CPPopUpListItemWasClickedNotification = @"_CPPopUpListItemWasClickedNotification";
/*!
@ignore
The minimum number of items that must be visible below the related field.
If less than this number would be completely visible, and there is room for this many complete items
above the field, the list is displayed above.
*/
var ListMinimumItems = 3;
/*! @ignore */
var ListColumnIdentifier = @"1";
/*!
This class is a controller for a panel that can pop up and display a scrollable list of items in a CPTableView.
For tables that display single-line rows of scalar data, no subclassing should be necessary.
The delegate of this class MUST implement the following methods:
numberOfItems The number of items the list should display
numberOfVisibleItems The maximum number of items to display at once
objectValueForItemAtIndex: Retrieves an object value for an item in the range 0..(numberOfItems - 1)
Objects of this class send the following notifications:
_CPPopUpListWillPopUpNotification
_CPPopUpListWillDismissNotification
_CPPopUpListDidDismissNotification
_CPPopUpListItemWasClickedNotification
*/
@implementation _CPPopUpList : CPObject
{
_CPPopUpListDelegate _delegate;
BOOL _itemWasClicked;
BOOL _listWasClicked;
int _listWidth;
_CPPopUpPanel _panel @accessors(readonly, property=panel);
CPScrollView _scrollView @accessors(readonly, property=scrollView);
_CPPopUpTableView _tableView @accessors(readonly, property=tableView);
CPTableColumn _tableColumn;
}
/*!
Creates a pop up list of choices which will display relative to the given rect in base coordinates.
@param aDelegate The object that usually is controlling this list.
*/
- (id)initWithDelegate:(_CPPopUpListDelegate)aDelegate
{
self = [super init];
if (self)
{
_delegate = aDelegate;
_itemWasClicked = NO;
_listWasClicked = NO;
_listWidth = 0;
_tableView = [self makeTableView];
// Start with a default size, we will resize it later
frame = CGRectMake(0, 0, 200, 200);
_tableColumn = [[CPTableColumn alloc] initWithIdentifier:ListColumnIdentifier];
[_tableColumn setWidth:CGRectGetWidth(frame) - [CPScroller scrollerWidth]];
[_tableColumn setResizingMask:CPTableColumnAutoresizingMask];
[_tableView addTableColumn:_tableColumn];
_scrollView = [self makeScrollViewWithFrame:CGRectMake(0, 0, CGRectGetWidth(frame), CGRectGetHeight(frame))];
[_scrollView setDocumentView:_tableView];
// This has to be done after setDocumentView so that the table knows which scroll view to update
[_tableView setHeaderView:nil];
_panel = [self makeListPanelWithFrame:frame];
[[_panel contentView] addSubview:_scrollView];
[_panel setInitialFirstResponder:_tableView];
if ([_delegate numberOfItems] > 0)
[_tableView selectRowIndexes:[CPIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
else
[_tableView setEnabled:NO];
[_scrollView scrollToBeginningOfDocument:nil];
[self finalizeTableView:_tableView];
}
return self;
}
/*!
Create and configure the panel containing the table view.
Subclasses should override this (and usually call super first)
if they want to customize the list panel.
*/
- (CPPanel)makeListPanelWithFrame:(CGRect)aFrame
{
var panel = [[_CPPopUpPanel alloc] initWithContentRect:aFrame styleMask:CPBorderlessWindowMask];
[panel setTitle:@""];
[panel setFloatingPanel:YES];
[panel setBecomesKeyOnlyIfNeeded:YES];
[panel setHasShadow:YES];
[panel setShadowStyle:CPMenuWindowShadowStyle];
[panel setDelegate:self];
return panel;
}
/*!
Create and configure the table view. Subclasses should use \ref finalizeTableView:.
*/
- (_CPPopUpTableView)makeTableView
{
[self removeTableViewObservers];
var table = [[_CPPopUpTableView alloc] initWithFrame:CGRectMakeZero()];
[table setDelegate:self];
[table setDataSource:self];
[table setColumnAutoresizingStyle:CPTableViewLastColumnOnlyAutoresizingStyle];
[table setUsesAlternatingRowBackgroundColors:NO];
[table setAllowsMultipleSelection:NO];
[table setIntercellSpacing:CGSizeMake(3, 2)];
[table setTarget:self];
[table setDoubleAction:@selector(tableViewClickAction:)];
[table setAction:@selector(tableViewClickAction:)];
[table setRowHeight:[self rowHeightForTableView:table]];
return table;
}
- (void)removeTableViewObservers
{
if (_tableView)
{
var defaultCenter = [CPNotificationCenter defaultCenter];
[defaultCenter removeObserver:self name:CPTableViewSelectionIsChangingNotification object:_tableView];
[defaultCenter removeObserver:self name:CPTableViewSelectionDidChangeNotification object:_tableView];
}
}
/*!
If subclasses want to configure the table view after it has been
completely configured, for example to set a custom data view,
this is the place. Such customization can also be done by an
observer of _CPPopUpListListWillDisplayNotification.
*/
- (void)finalizeTableView:(CPTableView)aTableView
{
}
/*!
Creates and configures the scroll view containing the table view.
Subclasses should override this (and usually call super first)
if they want to customize the scroll view.
*/
- (CPScrollView)makeScrollViewWithFrame:(CGRect)aFrame
{
var scroll = [[CPScrollView alloc] initWithFrame:aFrame];
[scroll setBorderType:CPLineBorder];
[scroll setAutohidesScrollers:NO];
[scroll setHasVerticalScroller:YES];
[scroll setHasHorizontalScroller:NO];
[scroll setLineScroll:[_tableView rowHeight]];
[scroll setVerticalPageScroll:0.0];
return scroll;
}
/*!
Returns the desired width of the list.
*/
- (int)listWidth
{
return _listWidth;
}
/*!
Sets the desired width of the list for the next call to \ref showListForfield:relativeTo:.
Note that the actual display width may be larger if the given width is less than the width of the associated
field.
*/
- (void)setListWidth:(int)width
{
_listWidth = width;
}
- (void)setFont:(CPFont)aFont
{
var oldDataView = [_tableColumn dataView],
newDataView = [CPTextField new];
[newDataView setFont:aFont];
[newDataView setAlignment:[oldDataView alignment]];
[_tableColumn setDataView:newDataView];
// Force the data view cache to flush
[_tableView reloadData];
}
- (void)setAlignment:(CPTextAlignment)alignment
{
var oldDataView = [_tableColumn dataView],
newDataView = [CPTextField new];
[newDataView setAlignment:alignment];
[newDataView setFont:[oldDataView font]];
[_tableColumn setDataView:newDataView];
// Force the data view cache to flush
[_tableView reloadData];
}
/*!
Pop up the list if it is not already visible.
If it is not visible, a _CPPopUpListWillPopUpNotification will be sent.
@param aRect A rect (in \c aView coordinates) to display relative to
@param aView The view whose coordinate system \c aRect is in
@param offset How far to offset the list from \c aRect
*/
- (void)popUpRelativeToRect:(CGRect)aRect view:(CPView)aView offset:(int)offset
{
if ([_panel isVisible])
return;
var rowRect = [_tableView rectOfRow:[self numberOfRowsInTableView:_tableView] - 1],
frame = CGRectMake(0, 0, MAX(_listWidth, CGRectGetWidth(aRect)), CGRectGetMaxY(rowRect));
// Place the frame relative to aRect and constrain it to the screen bounds
frame = [self constrain:frame relativeToRect:aRect view:aView offset:offset];
[_panel setFrame:frame];
[_scrollView setFrameSize:CGSizeMakeCopy(frame.size)];
[self scrollItemAtIndexToTop:[_tableView selectedRow]];
[self listWillPopUp];
[_panel orderFront:nil];
}
/*!
Return a frame in platform window base coordinates such that the list, when displayed, will show at least ListMinimumItems
items completely on screen. Normally the list should be displayed below \c aRect, but if there is not room
for at least ListMinimumItems items, an attempt should be made to display that many
items above \c aRect. If the minimum cannot be displayed on top, whichever direction can display more items
is chosen.
*/
- (CGRect)constrain:(CGRect)aFrame relativeToRect:(CGRect)aRect view:(CPView)aView offset:(int)offset
{
// Convert from the view's coordinate system to the coordinate system of the primary platform window
var baseOrigin = [aView convertPointToBase:aRect.origin],
windowOrigin = [[aView window] convertBaseToPlatformWindow:baseOrigin],
rowHeight = [self rowHeightForTableView:_tableView] + [_tableView intercellSpacing].height,
// Be sure to clip the number of displayed rows to what the field wants
numberOfRows = MIN([self numberOfRowsInTableView:_tableView], [_delegate numberOfVisibleItems]),
// Add 2 to height for border
frame = CGRectMake(windowOrigin.x, windowOrigin.y + CGRectGetHeight(aRect) + offset, MAX(_listWidth, CGRectGetWidth(aFrame)), (rowHeight * numberOfRows) + 2),
// Get the bottom coordinate of the frame and the platform window
bottomFrame = CGRectMakeCopy(frame),
bottom = CGRectGetMaxY(bottomFrame),
viewRect = [[CPPlatformWindow primaryPlatformWindow] visibleFrame],
visibleBottom = CGRectGetMaxY(viewRect),
bottomVisibleRows = numberOfRows;
// Make sure it will fit in the screen. If not, reduce the number of items till we reach the minimum.
while (bottom > visibleBottom && bottomVisibleRows >= ListMinimumItems)
{
bottom -= rowHeight;
bottomFrame.size.height -= rowHeight;
--bottomVisibleRows;
}
if (bottom >= visibleBottom || bottomVisibleRows < ListMinimumItems)
{
// The minimum number of items will not fit, try above
var topFrame = CGRectMakeCopy(frame);
topFrame.origin.y = windowOrigin.y - offset - CGRectGetHeight(topFrame);
var visibleTop = CGRectGetMinY(viewRect),
topVisibleRows = numberOfRows;
while (topFrame.origin.y <= visibleTop && topVisibleRows >= ListMinimumItems)
{
topFrame.origin.y += rowHeight;
topFrame.size.height -= rowHeight;
--topVisibleRows;
}
// If there is room on the top or it can display more than at the bottom, show it there
if ((topFrame.origin.y > visibleTop && topVisibleRows >= ListMinimumItems) || topVisibleRows > bottomVisibleRows)
frame = topFrame;
else
frame = bottomFrame;
}
else
frame = bottomFrame;
return frame;
}
/*!
Returns whether the list is currently visible.
*/
- (BOOL)isVisible
{
return [_panel isVisible];
}
/*!
Subclasses MUST call this method just before the list is about to display.
*/
- (void)listWillPopUp
{
[[CPNotificationCenter defaultCenter] postNotificationName:_CPPopUpListWillPopUpNotification object:self];
}
/*!
Select the next item in the list if there one. If there is currently no selected item,
the first item is selected. Returns YES if the selection changed.
*/
- (BOOL)selectNextItem
{
if (![_tableView isEnabled])
return NO;
var row = [_tableView selectedRow];
if (row < ([_delegate numberOfItems] - 1))
return [self selectRow:++row];
else
return NO;
}
/*!
Select the previous item in the list. If there is currently no selected item,
nothing happens. Returns YES if the selection changed.
*/
- (BOOL)selectPreviousItem
{
if (![_tableView isEnabled])
return NO;
var row = [_tableView selectedRow];
if (row > 0)
return [self selectRow:--row];
else
return NO;
}
/*!
Scroll the list down one page.
*/
- (void)scrollPageDown
{
[_scrollView scrollPageDown:nil];
}
/*!
Scroll the list up one page.
*/
- (void)scrollPageUp
{
[_scrollView scrollPageUp:nil];
}
/*!
Scroll to the top of the list.
*/
- (void)scrollToTop
{
[_scrollView scrollToBeginningOfDocument:nil];
}
/*!
Scroll to the bottom of the list.
*/
- (void)scrollToBottom
{
[_scrollView scrollToEndOfDocument:nil];
}
- (BOOL)selectRow:(int)row
{
if (row === [_tableView selectedRow])
return NO;
var indexes = row >= 0 ? [CPIndexSet indexSetWithIndex:row] : [CPIndexSet indexSet];
[_tableView selectRowIndexes:indexes byExtendingSelection:NO];
if (row >= 0)
{
[_tableView scrollRowToVisible:row];
return YES;
}
else
return NO;
}
- (void)scrollItemAtIndexToTop:(int)row
{
var rect = [_tableView rectOfRow:row];
[[_tableView superview] scrollToPoint:rect.origin];
}
/*!
Returns the selected value as a single-line string. If no value is selected,
returns nil.
*/
- (CPString)selectedStringValue
{
var row = [_tableView selectedRow];
return (row >= 0) ? [self stringValueForObjectValue:[_delegate objectValueForItemAtIndex:row] row:row] : nil;
}
/*!
Returns whether an item in the list was clicked since it was opened.
If there are no items, \ref itemWasClicked will always return NO.
*/
- (BOOL)itemWasClicked
{
return _itemWasClicked && ([_delegate numberOfItems] > 0);
}
/*!
Sets whether an item in the list was clicked since it was opened.
If there are no items, \ref itemWasClicked will always return NO.
Subclasses will usually want to set this in the mouseDown:
of the control.
*/
- (void)setItemWasClicked:(BOOL)flag
{
_itemWasClicked = ([_delegate numberOfItems] > 0) && flag;
}
/*!
Returns whether any view in the list was clicked since it was opened.
If there are no items, \ref listWasClicked will always return NO.
*/
- (BOOL)listWasClicked
{
return _listWasClicked && ([_delegate numberOfItems] > 0);
}
/*!
Sets whether any view in the list was clicked since it was opened.
If there are no items, \ref listWasClicked will always return NO.
Subclasses will usually want to use a subclass of CPPanel and override
sendEvent: to set this flag when the event type is CPLeftMouseDown
or CPRightMouseDown. This is distinct from \ref itemWasClicked because,
for example, a scroller in the list may be clicked without clicking an
item in the list.
*/
- (void)setListWasClicked:(BOOL)flag
{
_listWasClicked = ([_delegate numberOfItems] > 0) && flag;
}
/*!
Close the list if it is currently visible. If it is visible,
a CPComboBoxWillDismissNotification will be sent. If the
list is being closed after an item was clicked, the close
is delayed slightly so the user can briefly see the clicked row
get highlighted.
*/
- (void)close
{
if (![_panel isVisible])
return;
if ([self listWasClicked])
{
[self setListWasClicked:NO];
// Wait until we get through the run loop and delay a little
// so the user can briefly see the clicked row get highlighted.
if ([self itemWasClicked])
{
[self setItemWasClicked:NO];
[CPTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(closeListAfterItemClick) userInfo:nil repeats:NO];
return;
}
}
[[CPNotificationCenter defaultCenter] postNotificationName:_CPPopUpListWillDismissNotification object:self];
[_panel close];
[[CPNotificationCenter defaultCenter] postNotificationName:_CPPopUpListDidDismissNotification object:self];
}
/*!
Close the list after an item was clicked.
*/
- (void)closeListAfterItemClick
{
[self close];
[[CPNotificationCenter defaultCenter] postNotificationName:_CPPopUpListItemWasClickedNotification object:self];
}
/*!
Returns the desired row height for the table view.
Subclasses should override this if they want something other than the default.
*/
- (int)rowHeightForTableView:(CPTableView)aTableView
{
return [aTableView rowHeight];
}
/*!
Returns a value to display for a single row in the list. Subclasses should override
this if the table data needs to be converted or formatted in some way to be displayed.
If there are no search results, an empty string is returned.
If subclasses use a data representation other than CPStrings, they must override
this method and return the appropriate data when there are no search results.
If the table uses a custom data view, this method should return a value suitable
for sending to the setObjectValue: method of the data view.
@param aValue Table data for the given row
@param aRow The row being displayed
@return A value to be displayed in the list
*/
- (id)displayValueForObjectValue:(id)aValue row:(int)aRow
{
return aValue || @"";
}
/*!
Returns a single-line string for use in an autocomplete field. Subclasses should override
this if the row data is not convertable to a simple string, and return the data as a single-line string.
@param aValue Table data to be converted to a string
@param aRow The row whose data is being converted
@return A value to be displayed in the autocomplete field
*/
- (CPString)stringValueForObjectValue:(id)aValue row:(int)aRow
{
return String(aValue);
}
- (void)tableViewClickAction:(id)sender
{
[self close];
}
@end
var _CPPopUpListFieldKey = @"_CPPopUpListDelegateKey",
_CPPopUpListListWidthKey = @"_CPPopUpListListWidthKey",
_CPPopUpListListPanelKey = @"_CPPopUpListListPanelKey",
_CPPopUpListScrollViewKey = @"_CPPopUpListScrollViewKey",
_CPPopUpListTableViewKey = @"_CPPopUpListTableViewKey";
@implementation _CPPopUpList (CPCoding)
- (id)initWithCoder:(CPCoder)aCoder
{
self = [super initWithCoder:aCoder];
if (self)
{
_listWasClicked = NO;
_itemWasClicked = NO;
_delegate = [aCoder decodeObjectForKey:_CPPopUpListDelegateKey];
_listWidth = [aCoder decodeIntForKey:_CPPopUpListListWidthKey];
_panel = [aCoder decodeObjectForKey:_CPPopUpListListPanelKey];
_scrollView = [aCoder decodeObjectForKey:_CPPopUpListScrollViewKey];
_tableView = [aCoder decodeObjectForKey:_CPPopUpListTableViewKey];
_tableColumn = [_tableView tableColumnWithIdentifier:ListColumnIdentifier];
[_scrollView setDocumentView:_tableView];
}
return self;
}
- (void)encodeWithCoder:(CPCoder)aCoder
{
[super encodeWithCoder:aCoder];
[aCoder encodeObject:_delegate forKey:_CPPopUpListDelegateKey];
[aCoder encodeObject:_listWidth forKey:_CPPopUpListListWidthKey];
[aCoder encodeObject:_panel forKey:_CPPopUpListListPanelKey];
[aCoder encodeObject:_scrollView forKey:_CPPopUpListScrollViewKey];
[aCoder encodeObject:_tableView forKey:_CPPopUpListTableViewKey];
}
@end
@implementation _CPPopUpList (CPTableViewDataSource)
- (int)numberOfRowsInTableView:(id)aTableView
{
return MAX([_delegate numberOfItems], 1);
}
- (id)tableView:(id)aTableView objectValueForTableColumn:(CPTableColumn)aColumn row:(int)aRow
{
return [self displayValueForObjectValue:[_delegate objectValueForItemAtIndex:aRow] row:aRow];
}
@end
@implementation _CPPopUpTableView : CPTableView
- (void)mouseDown:(CPEvent)anEvent
{
if (![self isEnabled])
return;
[[self delegate] setItemWasClicked:YES];
[super mouseDown:anEvent];
}
/*
We always want the autocomplete to have focus
*/
- (BOOL)acceptsFirstResponder
{
return NO;
}
/*!
Return the column used for the list.
*/
- (CPTableColumn)listColumn
{
return _tableColumn;
}
@end
@implementation _CPPopUpPanel : CPPanel
- (void)sendEvent:(CPEvent)anEvent
{
var type = [anEvent type];
if (type === CPLeftMouseDown || type === CPRightMouseDown)
[[self delegate] setListWasClicked:YES];
return [super sendEvent:anEvent];
}
@end
+54
View File
@@ -0,0 +1,54 @@
require File.join(File.dirname(__FILE__), "repositories.rb")
require File.join(File.dirname(__FILE__), "dependencies.rb")
# Keep this structure to allow the build system to update version numbers.
VERSION_NUMBER = "1.0.0.008"
# Shorten expressions
def jars(*args)
args.collect {|arg| project(arg).package(:jar)}
end
desc "Cappuccino Distribution"
define "cappuccino" do
project.version = VERSION_NUMBER
project.group = "com.intalio.cloud.cappuccino"
file(_("target/patch")).enhance do
mkdir_p "target/patch"
end
file(_("target/Frameworks")).enhance do
mkdir_p "target/Frameworks/Debug"
system <<-BASH
export BUILD_PATH="target/Build"
jake debug release
BASH
cp_r "target/Build/Release/AppKit", "target/Frameworks/"
cp_r "target/Build/Release/Foundation", "target/Frameworks/"
cp_r "target/Build/Release/Objective-J", "target/Frameworks/"
cp_r "target/Build/Debug/AppKit", "target/Frameworks/Debug/"
cp_r "target/Build/Debug/Foundation", "target/Frameworks/Debug/"
cp_r "target/Build/Debug/Objective-J", "target/Frameworks/Debug/"
end
# file(_("target/Build")).enhance do
# end
read_m = ::Buildr::Packaging::Java::Manifest.parse(File.read(_("META-INF/MANIFEST.MF"))).main
read_m["Copyright"]="Intalio, Inc 2011"
read_m["Bundle-Version"]=VERSION_NUMBER.gsub(/SNAPSHOT/, "#{Time.now.to_i}")
read_m.delete("Jetty-WarFragmentFolderPath")
read_m.delete("Jetty-WarPatchFragmentFolderPath")
package(:jar).with :manifest => read_m
#package(:jar).include _("target/patch"), :as => "patch"
package(:jar).include _("target/Frameworks"), :as => "META-INF/resources/Frameworks"
#do not include those: they are at best not read harmful.
#package(:bundle).include _("build.properties"), :as => "build.properties"
#package(:bundle).meta_inf << file('META-INF/web-fragment.xml')
end
+15 -1
View File
@@ -428,7 +428,9 @@ var avgOperator,
maxOperator,
minOperator,
countOperator,
sumOperator;
sumOperator,
distinctUnionOfObjectsOperator,
unionOfObjectsOperator;
kvoOperators["avg"] = function avgOperator(self, _cmd, param)
{
@@ -495,6 +497,18 @@ kvoOperators["sum"] = function sumOperator(self, _cmd, param)
return sum;
}
kvoOperators["distinctUnionOfObjects"] = function distinctUnionOfObjectsOperator(self, _cmd, param)
{
var objects = [self valueForKeyPath:param];
return [[CPSet setWithArray:objects] allObjects];
}
kvoOperators["unionOfObjects"] = function unionOfObjectsOperator(self, _cmd, param)
{
return [self valueForKeyPath:param];
}
@implementation CPArray (KeyValueObserving)
- (void)addObserver:(id)anObserver toObjectsAtIndexes:(CPIndexSet)indexes forKeyPath:(CPString)aKeyPath options:(unsigned)options context:(id)context
+25 -12
View File
@@ -231,6 +231,7 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
Object _observersForKey;
int _observersForKeyLength;
CPSet _replacedKeys;
CPSet _suppressedNotifications;
}
+ (id)proxyForObject:(CPObject)anObject
@@ -247,11 +248,12 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
{
if (self = [super init])
{
_targetObject = aTarget;
_nativeClass = [aTarget class];
_observersForKey = {};
_changesForKey = {};
_observersForKeyLength = 0;
_targetObject = aTarget;
_nativeClass = [aTarget class];
_observersForKey = {};
_changesForKey = {};
_observersForKeyLength = 0;
_suppressedNotifications = [CPSet set];
[self _replaceClass];
aTarget[KVOProxyKey] = self;
@@ -629,12 +631,12 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
{
// Fire change events for the dependent keys
var dependentKeysForClass = _nativeClass[DependentKeysKey],
dependantKeys = [dependentKeysForClass[theKeyPath] allObjects];
dependentKeys = [dependentKeysForClass[theKeyPath] allObjects],
isBeforeFlag = !![theChanges objectForKey:CPKeyValueChangeNotificationIsPriorKey];
var isBeforeFlag = !![theChanges objectForKey:CPKeyValueChangeNotificationIsPriorKey];
for (var i = 0; i < [dependantKeys count]; i++)
for (var i = 0; i < [dependentKeys count]; i++)
{
var dependantKey = [dependantKeys objectAtIndex:i];
var dependantKey = [dependentKeys objectAtIndex:i];
[self _sendNotificationsForKey:dependantKey changeOptions:theChanges isBefore:isBeforeFlag];
}
}
@@ -842,12 +844,23 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
{
var keyPath = dependentKeyPaths[index];
[self _sendNotificationsForKey:keyPath
changeOptions:isBefore ? [changeOptions copy] : _changesForKey[keyPath]
isBefore:isBefore];
if (![_suppressedNotifications containsObject:keyPath])
[self _sendNotificationsForKey:keyPath
changeOptions:isBefore ? [changeOptions copy] : _changesForKey[keyPath]
isBefore:isBefore];
}
}
- (void)suppressNotificationsForKeyPath:(CPString)keyPath
{
[_suppressedNotifications addObject:keyPath];
}
- (void)unsuppressNotificationsForKeyPath:(CPString)keyPath
{
[_suppressedNotifications removeObject:keyPath];
}
@end
@implementation _CPKVOModelSubclass
+25
View File
@@ -0,0 +1,25 @@
source "http://rubygems.org"
gem "atoulme-Antwrap", "0.7.1" # -java
gem "bouncy-castle-java", "1.5.0146.1"
gem "builder", "2.1.2"
gem "buildr", "1.4.5" # -java
gem "buildr4osgi", "0.9.6"
gem "bundler", "1.0.0.rc.5"
gem "diff-lcs", "1.1.2"
gem "highline", "1.5.1"
gem "hoe", "2.3.3"
gem "jruby-openssl", "0.7.4"
gem "json_pure", "1.4.3"
gem "manifest", "0.0.8"
gem "minitar", "0.5.3"
gem "net-sftp", "2.0.4"
gem "net-ssh", "2.0.23" # 2.1.4
gem "rake", "0.8.7" # 0.9.1
gem "rspec", "2.1.0"
gem "rspec-core", "2.1.0"
gem "rspec-expectations", "2.1.0"
gem "rspec-mocks", "2.1.0"
gem "rubyforge", "2.0.3"
gem "rubyzip", "0.9.4"
gem "xml-simple", "1.0.12"
+81
View File
@@ -0,0 +1,81 @@
GEM
remote: http://rubygems.org/
specs:
atoulme-Antwrap (0.7.1-java)
bouncy-castle-java (1.5.0146.1)
builder (2.1.2)
buildr (1.4.5-java)
atoulme-Antwrap (= 0.7.1)
builder (= 2.1.2)
diff-lcs (= 1.1.2)
highline (= 1.5.1)
hoe (= 2.3.3)
jruby-openssl (>= 0.7)
json_pure (= 1.4.3)
minitar (= 0.5.3)
net-sftp (= 2.0.4)
net-ssh (= 2.0.23)
rake (= 0.8.7)
rspec (= 2.1.0)
rspec-core (= 2.1.0)
rspec-expectations (= 2.1.0)
rspec-mocks (= 2.1.0)
rubyforge (= 2.0.3)
rubyzip (= 0.9.4)
xml-simple (= 1.0.12)
buildr4osgi (0.9.6)
manifest (= 0.0.8)
diff-lcs (1.1.2)
highline (1.5.1)
hoe (2.3.3)
rake (>= 0.8.7)
rubyforge (>= 1.0.4)
jruby-openssl (0.7.4)
bouncy-castle-java
json_pure (1.4.3)
manifest (0.0.8)
minitar (0.5.3)
net-sftp (2.0.4)
net-ssh (>= 2.0.9)
net-ssh (2.0.23)
rake (0.8.7)
rspec (2.1.0)
rspec-core (~> 2.1.0)
rspec-expectations (~> 2.1.0)
rspec-mocks (~> 2.1.0)
rspec-core (2.1.0)
rspec-expectations (2.1.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.1.0)
rubyforge (2.0.3)
json_pure (>= 1.1.7)
rubyzip (0.9.4)
xml-simple (1.0.12)
PLATFORMS
java
DEPENDENCIES
atoulme-Antwrap (= 0.7.1)
bouncy-castle-java (= 1.5.0146.1)
builder (= 2.1.2)
buildr (= 1.4.5)
buildr4osgi (= 0.9.6)
bundler (= 1.0.0.rc.5)
diff-lcs (= 1.1.2)
highline (= 1.5.1)
hoe (= 2.3.3)
jruby-openssl (= 0.7.4)
json_pure (= 1.4.3)
manifest (= 0.0.8)
minitar (= 0.5.3)
net-sftp (= 2.0.4)
net-ssh (= 2.0.23)
rake (= 0.8.7)
rspec (= 2.1.0)
rspec-core (= 2.1.0)
rspec-expectations (= 2.1.0)
rspec-mocks (= 2.1.0)
rubyforge (= 2.0.3)
rubyzip (= 0.9.4)
xml-simple (= 1.0.12)
+9
View File
@@ -0,0 +1,9 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: cappuccinofrag
Bundle-SymbolicName: com.intalio.cloud.cappuccino
Fragment-Host: com.intalio.cloud.carbon
Jetty-WarPatchFragmentFolderPath: /
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-BundleShape: dir
+152
View File
@@ -0,0 +1,152 @@
/*
* AppController.j
* BindingContentArrayTest
*
* Created by aparajita on August 17, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
@implementation Companies : CPObject
{
CPMutableArray items @accessors;
}
- (id)init
{
self = [super init];
if (self)
{
items = [CPMutableArray array];
[items addObject:[CPDictionary dictionaryWithObjectsAndKeys:@"Spacely Sprockets", @"name", [CPArray arrayWithObjects:@"Tom", @"Dick", @"Harry"], @"employees"]];
[items addObject:[CPDictionary dictionaryWithObjectsAndKeys:@"Cogswell Cogs", @"name", [CPArray arrayWithObjects:@"Jane", @"Mary", @"Vic"], @"employees"]];
}
return self;
}
@end
@implementation AppController : CPObject
{
CPString employee @accessors;
Companies companies @accessors;
CPArrayController companiesController;
CPArrayController employeesController;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView],
companiesScrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(30, 30, 200, 100)],
companiesTable = [[CPTableView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)],
employeesScrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(250, 30, 200, 100)],
employeesTable = [[CPTableView alloc] initWithFrame:CGRectMake(0, 0, 200, 100)],
text = [[CPTextField alloc] initWithFrame:CGRectMake(250, 140, 200, 29)];
companies = [Companies new];
var column = [[CPTableColumn alloc] initWithIdentifier:@"name"];
[column setResizingMask:CPTableColumnAutoresizingMask];
[companiesTable addTableColumn:column];
[companiesTable setAllowsMultipleSelection:YES];
[companiesTable setColumnAutoresizingStyle:CPTableViewLastColumnOnlyAutoresizingStyle];
[companiesScrollView setHasHorizontalScroller:NO];
[companiesScrollView setHasVerticalScroller:NO];
[companiesScrollView setDocumentView:companiesTable];
[companiesScrollView setBorderType:CPBezelBorder];
[companiesTable setHeaderView:nil];
[companiesTable setAllowsEmptySelection:NO];
[contentView addSubview:companiesScrollView];
column = [[CPTableColumn alloc] initWithIdentifier:@"name"];
[column setResizingMask:CPTableColumnAutoresizingMask];
[employeesTable addTableColumn:column];
[employeesTable setAllowsMultipleSelection:YES];
[employeesTable setColumnAutoresizingStyle:CPTableViewLastColumnOnlyAutoresizingStyle];
[employeesScrollView setHasHorizontalScroller:NO];
[employeesScrollView setHasVerticalScroller:NO];
[employeesScrollView setDocumentView:employeesTable];
[employeesScrollView setBorderType:CPBezelBorder];
[employeesTable setHeaderView:nil];
[employeesTable setAllowsEmptySelection:YES];
[contentView addSubview:employeesScrollView];
[contentView addSubview:text];
var button = [CPButton buttonWithTitle:@"Add Item"];
[button setFrameOrigin:CGPointMake(500, 30)];
[button setTarget:self];
[button setAction:@selector(addItem:)];
[contentView addSubview:button];
button = [CPButton buttonWithTitle:@"Insert Item"];
[button setFrameOrigin:CGPointMake(500, 70)];
[button setTarget:self];
[button setAction:@selector(insertItem:)];
[contentView addSubview:button];
button = [CPButton buttonWithTitle:@"Remove Item"];
[button setFrameOrigin:CGPointMake(500, 110)];
[button setTarget:self];
[button setAction:@selector(removeItem:)];
[contentView addSubview:button];
companiesController = [CPArrayController new];
[companiesController bind:@"contentArray" toObject:companies withKeyPath:@"items" options:nil];
employeesController = [CPArrayController new];
[employeesController bind:@"contentArray" toObject:companiesController withKeyPath:@"selection.employees" options:nil];
//var employeeController = [CPObjectController new];
//[employeeController bind:@"contentObject" toObject:self withKeyPath:@"employee" options:nil];
[[companiesTable tableColumnWithIdentifier:@"name"] bind:@"value" toObject:companiesController withKeyPath:@"arrangedObjects.name" options:nil];
[[employeesTable tableColumnWithIdentifier:@"name"] bind:@"value" toObject:employeesController withKeyPath:@"arrangedObjects" options:nil];
[text bind:@"value" toObject:employeesController withKeyPath:@"selection.self" options:nil];
[companiesController addObserver:self forKeyPath:@"selection" options:0 context:@"companies.selection"];
[companiesController addObserver:self forKeyPath:@"selectionIndexes" options:0 context:@"companies.selectionIndexes"];
[companiesController addObserver:self forKeyPath:@"arrangedObjects" options:0 context:@"companies.arrangedObjects"];
[employeesController addObserver:self forKeyPath:@"selectionIndexes" options:0 context:@"employees.selectionIndexes"];
[employeesController addObserver:self forKeyPath:@"selection" options:0 context:@"employees.selection"];
[employeesController addObserver:self forKeyPath:@"arrangedObjects" options:0 context:@"employees.arrangedObjects"];
[theWindow setInitialFirstResponder:companiesTable];
[theWindow orderFront:self];
}
- (void)observeValueForKeyPath:(CPString)keyPath ofObject:(id)object change:(CPDictionary)change context:(id)context
{
console.log("\nkeyPath: %s\ncontext: %s\nnew: %s\nold: %s", keyPath, context, [[change valueForKey:CPKeyValueChangeNewKey] description], [[change valueForKey:CPKeyValueChangeOldKey] description]);
}
- (void)addItem:(id)sender
{
var item = [CPDictionary dictionaryWithObjectsAndKeys:@"Seven Dwarves", @"name", [CPArray arrayWithObjects:@"Sneezy", @"Dopey", @"Sleepy", @"Doc", @"Bashful", @"Happy", @"Grumpy"], @"employees"];
[companiesController addObject:item];
}
- (void)insertItem:(id)sender
{
var item = [CPDictionary dictionaryWithObjectsAndKeys:@"Acme Corp", @"name", [CPArray arrayWithObjects:@"Road Runner", @"Wile E. Coyote"], @"employees"];
[companiesController insertObject:item atArrangedObjectIndex:1];
}
- (void)removeItem:(id)sender
{
if ([[companiesController arrangedObjects] count])
[companiesController removeObjectAtArrangedObjectIndex:0];
}
@end
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CPApplicationDelegateClass</key>
<string>AppController</string>
<key>CPBundleName</key>
<string>BindingContentArrayTest</string>
<key>CPPrincipalClass</key>
<string>CPApplication</string>
</dict>
</plist>
+93
View File
@@ -0,0 +1,93 @@
/*
* Jakefile
* BindingContentArrayTest
*
* Created by aparajita on August 17, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
var ENV = require("system").env,
FILE = require("file"),
JAKE = require("jake"),
task = JAKE.task,
FileList = JAKE.FileList,
app = require("cappuccino/jake").app,
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
OS = require("os");
app ("BindingContentArrayTest", function(task)
{
task.setBuildIntermediatesPath(FILE.join("Build", "BindingContentArrayTest.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("BindingContentArrayTest");
task.setIdentifier("com.aparajita.BindingContentArrayTest");
task.setVersion("1.0");
task.setAuthor("Victory-Heart Productions");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("BindingContentArrayTest");
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
task.setResources(new FileList("Resources/**"));
task.setIndexFilePath("index.html");
task.setInfoPlistPath("Info.plist");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
else
task.setCompilerFlags("-O");
});
task ("default", ["BindingContentArrayTest"], function()
{
printResults(configuration);
});
task ("build", ["default"]);
task ("debug", function()
{
ENV["CONFIGURATION"] = "Debug";
JAKE.subjake(["."], "build", ENV);
});
task ("release", function()
{
ENV["CONFIGURATION"] = "Release";
JAKE.subjake(["."], "build", ENV);
});
task ("run", ["debug"], function()
{
OS.system(["open", FILE.join("Build", "Debug", "BindingContentArrayTest", "index.html")]);
});
task ("run-release", ["release"], function()
{
OS.system(["open", FILE.join("Build", "Release", "BindingContentArrayTest", "index.html")]);
});
task ("deploy", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Deployment", "BindingContentArrayTest"));
OS.system(["press", "-f", FILE.join("Build", "Release", "BindingContentArrayTest"), FILE.join("Build", "Deployment", "BindingContentArrayTest")]);
printResults("Deployment")
});
task ("desktop", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Desktop", "BindingContentArrayTest"));
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "BindingContentArrayTest"), FILE.join("Build", "Desktop", "BindingContentArrayTest", "BindingContentArrayTest.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", "BindingContentArrayTest", "BindingContentArrayTest.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "BindingContentArrayTest"));
print("----------------------------");
}
+14
View File
@@ -0,0 +1,14 @@
Run this application with the current master, and note the following bugs:
- When you click on any item, there are two selection change notifications instead of one.
- If you compare the order of the notifications with Cocoa, they are slightly different.
- The right hand table is configured to allow an empty selection. If you click in the
empty area below the names, there is an empty selection notification, but then the
the current selection changes to the first item and generates another notification.
- If you select multiple items on the left, there is an error. This is a bug that will
have to be fixed in a later commit.
If you apply the changes in these commits, the first three bugs are fixed.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

+103
View File
@@ -0,0 +1,103 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index-debug.html
Bindings
Created by aparajita on August 17, 2011.
Copyright 2011, Victory-Heart Productions All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="Resources/icon.png" />
<link rel="apple-touch-startup-image" href="Resources/default.png" />
<title>Bindings</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
</script>
<script src="Frameworks/Debug/Objective-J/Objective-J.js" type="text/javascript" charset="UTF-8"></script>
<script type="text/javascript">
objj_msgSend_reset();
// DEBUG OPTIONS:
// Uncomment to enable printing of backtraces on exceptions:
//objj_msgSend_decorate(objj_backtrace_decorator);
// Uncomment to supress exceptions that take place inside a message
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
// Uncomment to enable runtime type checking:
//objj_msgSend_decorate(objj_typecheck_decorator);
// Uncomment (along with both above) to print backtraces on type check errors:
//objj_typecheck_prints_backtrace = true;
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
//CPLogUnregister(CPLogDefault);
// Uncomment to enable a specific logger:
//CPLogRegister(CPLogConsole);
//CPLogRegister(CPLogPopup);
</script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading Bindings...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
+78
View File
@@ -0,0 +1,78 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index.html
Bindings
Created by aparajita on August 17, 2011.
Copyright 2011, Victory-Heart Productions All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="Resources/icon.png" />
<link rel="apple-touch-startup-image" href="Resources/default.png" />
<title>Bindings</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
</script>
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading Bindings...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
+18
View File
@@ -0,0 +1,18 @@
/*
* AppController.j
* BindingContentArrayTest
*
* Created by aparajita on August 17, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "AppController.j"
function main(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}
@@ -0,0 +1,80 @@
/*
* AppController.j
* test
*
* Created by aparajita on May 19, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
@import <Foundation/CPObject.j>
function formatter(aString, aLevel, aTitle)
{
return aString;
}
@implementation AppController : CPObject
{
CPWindow theWindow; //this "outlet" is connected automatically by the Cib
CPView simpleColor;
CPView patternColor;
CPView threePartColor;
CPView ninePartColor;
CPImage imageView;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
}
- (void)awakeFromCib
{
CPLogRegister(CPLogConsole, null, formatter);
// In this case, we want the window from Cib to become our full browser window
[theWindow setFullPlatformWindow:YES];
var color = [CPColor colorWithHexString:@"88B3FF"];
CPLog([color description]);
[simpleColor setBackgroundColor:color];
color = CPColorWithImages("wheel_button.png", 32, 32, [CPBundle bundleForClass:[CPView class]]);
CPLog([color description]);
[patternColor setBackgroundColor:color];
var bundle = [CPBundle bundleForClass:[CPView class]];
color = CPColorWithImages([
["Aristo.blend/Resources/button-bezel-left.png", 4, 24, bundle],
["Aristo.blend/Resources/button-bezel-center.png", 1, 24, bundle],
["Aristo.blend/Resources/button-bezel-right.png", 4, 24, bundle]
]);
CPLog([color description]);
[threePartColor setBackgroundColor:color];
color = CPColorWithImages([
["Aristo.blend/Resources/textfield-bezel-square-focused-0.png", 7, 7, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-1.png", 1, 7, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-2.png", 7, 7, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-3.png", 7, 1, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-4.png", 1, 1, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-5.png", 7, 1, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-6.png", 7, 7, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-7.png", 1, 7, bundle],
["Aristo.blend/Resources/textfield-bezel-square-focused-8.png", 7, 7, bundle],
]);
CPLog([color description]);
[ninePartColor setBackgroundColor:color];
var image = CPImageInBundle("add1-32.png", CGSizeMake(32, 32));
CPLog([image description]);
[imageView setImage:image];
}
@end
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Main cib file base name</key>
<string>MainMenu.cib</string>
<key>CPBundleName</key>
<string>CPColor-CPImage-description</string>
</dict>
</plist>
@@ -0,0 +1,94 @@
/*
* Jakefile
* test
*
* Created by aparajita on May 19, 2011.
* Copyright 2011, Victory-Heart Productions All rights reserved.
*/
var ENV = require("system").env,
FILE = require("file"),
JAKE = require("jake"),
task = JAKE.task,
FileList = JAKE.FileList,
app = require("cappuccino/jake").app,
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
OS = require("os");
app ("test", function(task)
{
task.setBuildIntermediatesPath(FILE.join("Build", "test.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("test");
task.setIdentifier("com.aparajita.test");
task.setVersion("1.0");
task.setAuthor("Victory-Heart Productions");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("test");
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
task.setResources(new FileList("Resources/**"));
task.setIndexFilePath("index.html");
task.setInfoPlistPath("Info.plist");
task.setNib2CibFlags("-R Resources/");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
else
task.setCompilerFlags("-O");
});
task ("default", ["test"], function()
{
printResults(configuration);
});
task ("build", ["default"]);
task ("debug", function()
{
ENV["CONFIGURATION"] = "Debug";
JAKE.subjake(["."], "build", ENV);
});
task ("release", function()
{
ENV["CONFIGURATION"] = "Release";
JAKE.subjake(["."], "build", ENV);
});
task ("run", ["debug"], function()
{
OS.system(["open", FILE.join("Build", "Debug", "test", "index.html")]);
});
task ("run-release", ["release"], function()
{
OS.system(["open", FILE.join("Build", "Release", "test", "index.html")]);
});
task ("deploy", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Deployment", "test"));
OS.system(["press", "-f", FILE.join("Build", "Release", "test"), FILE.join("Build", "Deployment", "test")]);
printResults("Deployment")
});
task ("desktop", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Desktop", "test"));
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "test"), FILE.join("Build", "Desktop", "test", "test.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", "test", "test.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "test"));
print("----------------------------");
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,654 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">10J869</string>
<string key="IBDocument.InterfaceBuilderVersion">804</string>
<string key="IBDocument.AppKitVersion">1038.35</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">804</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="372"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomObject" id="1021">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSCustomObject" id="1014">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="1050">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="972006081">
<int key="NSWindowStyleMask">7</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{335, 370}, {389, 380}}</string>
<int key="NSWTFlags">1946157056</int>
<string key="NSWindowTitle">Window</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<object class="NSView" key="NSWindowView" id="439893737">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomView" id="1066696903">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{151, 297}, {159, 36}}</string>
<reference key="NSSuperview" ref="439893737"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSTextField" id="385245898">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{47, 307}, {82, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="12386750">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Simple color</string>
<object class="NSFont" key="NSSupport" id="710279137">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<reference key="NSControlView" ref="385245898"/>
<object class="NSColor" key="NSBackgroundColor" id="616930867">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor" id="968014435">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</object>
</object>
<object class="NSCustomView" id="605260233">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{151, 243}, {159, 36}}</string>
<reference key="NSSuperview" ref="439893737"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSTextField" id="179895693">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{47, 253}, {85, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="222300836">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Pattern color</string>
<reference key="NSSupport" ref="710279137"/>
<reference key="NSControlView" ref="179895693"/>
<reference key="NSBackgroundColor" ref="616930867"/>
<reference key="NSTextColor" ref="968014435"/>
</object>
</object>
<object class="NSCustomView" id="688674788">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{151, 186}, {159, 36}}</string>
<reference key="NSSuperview" ref="439893737"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSTextField" id="63869060">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{47, 196}, {85, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="828490958">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">3-part color</string>
<reference key="NSSupport" ref="710279137"/>
<reference key="NSControlView" ref="63869060"/>
<reference key="NSBackgroundColor" ref="616930867"/>
<reference key="NSTextColor" ref="968014435"/>
</object>
</object>
<object class="NSCustomView" id="100716157">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{151, 130}, {159, 36}}</string>
<reference key="NSSuperview" ref="439893737"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSTextField" id="488609560">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{47, 140}, {85, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="548167261">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">9-part color</string>
<reference key="NSSupport" ref="710279137"/>
<reference key="NSControlView" ref="488609560"/>
<reference key="NSBackgroundColor" ref="616930867"/>
<reference key="NSTextColor" ref="968014435"/>
</object>
</object>
<object class="NSTextField" id="696346150">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{47, 84}, {85, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="30856995">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Image</string>
<reference key="NSSupport" ref="710279137"/>
<reference key="NSControlView" ref="696346150"/>
<reference key="NSBackgroundColor" ref="616930867"/>
<reference key="NSTextColor" ref="968014435"/>
</object>
</object>
<object class="NSImageView" id="276994718">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<object class="NSMutableSet" key="NSDragTypes">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="set.sortedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>Apple PDF pasteboard type</string>
<string>Apple PICT pasteboard type</string>
<string>Apple PNG pasteboard type</string>
<string>NSFilenamesPboardType</string>
<string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
<string>NeXT TIFF v4.0 pasteboard type</string>
</object>
</object>
<string key="NSFrame">{{148, 68}, {48, 48}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="334634827">
<int key="NSCellFlags">130560</int>
<int key="NSCellFlags2">33554432</int>
<int key="NSAlign">0</int>
<int key="NSScale">2</int>
<int key="NSStyle">0</int>
<bool key="NSAnimates">NO</bool>
</object>
<bool key="NSEditable">YES</bool>
</object>
</object>
<string key="NSFrameSize">{389, 380}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
</object>
<object class="NSCustomObject" id="635946545">
<string key="NSClassName">AppController</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="1021"/>
<reference key="destination" ref="635946545"/>
</object>
<int key="connectionID">451</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">theWindow</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="972006081"/>
</object>
<int key="connectionID">459</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">ninePartColor</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="100716157"/>
</object>
<int key="connectionID">480</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">threePartColor</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="688674788"/>
</object>
<int key="connectionID">481</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">patternColor</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="605260233"/>
</object>
<int key="connectionID">482</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">simpleColor</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="1066696903"/>
</object>
<int key="connectionID">483</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">imageView</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="276994718"/>
</object>
<int key="connectionID">490</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<object class="NSArray" key="object" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="children" ref="1048"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="1021"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="1014"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="1050"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">371</int>
<reference key="object" ref="972006081"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="439893737"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">372</int>
<reference key="object" ref="439893737"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="385245898"/>
<reference ref="1066696903"/>
<reference ref="605260233"/>
<reference ref="179895693"/>
<reference ref="688674788"/>
<reference ref="63869060"/>
<reference ref="100716157"/>
<reference ref="488609560"/>
<reference ref="696346150"/>
<reference ref="276994718"/>
</object>
<reference key="parent" ref="972006081"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">450</int>
<reference key="object" ref="635946545"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">468</int>
<reference key="object" ref="1066696903"/>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">469</int>
<reference key="object" ref="385245898"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="12386750"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">470</int>
<reference key="object" ref="12386750"/>
<reference key="parent" ref="385245898"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">471</int>
<reference key="object" ref="605260233"/>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">472</int>
<reference key="object" ref="179895693"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="222300836"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">473</int>
<reference key="object" ref="222300836"/>
<reference key="parent" ref="179895693"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">474</int>
<reference key="object" ref="688674788"/>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">475</int>
<reference key="object" ref="63869060"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="828490958"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">476</int>
<reference key="object" ref="828490958"/>
<reference key="parent" ref="63869060"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">477</int>
<reference key="object" ref="100716157"/>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">478</int>
<reference key="object" ref="488609560"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="548167261"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">479</int>
<reference key="object" ref="548167261"/>
<reference key="parent" ref="488609560"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">485</int>
<reference key="object" ref="696346150"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="30856995"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">486</int>
<reference key="object" ref="30856995"/>
<reference key="parent" ref="696346150"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">487</int>
<reference key="object" ref="276994718"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="334634827"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">488</int>
<reference key="object" ref="334634827"/>
<reference key="parent" ref="276994718"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-3.IBPluginDependency</string>
<string>371.IBEditorWindowLastContentRect</string>
<string>371.IBPluginDependency</string>
<string>371.IBViewEditorWindowController.showingBoundsRectangles</string>
<string>371.IBViewEditorWindowController.showingLayoutRectangles</string>
<string>371.IBWindowTemplateEditedContentRect</string>
<string>371.NSWindowTemplate.visibleAtLaunch</string>
<string>371.editorWindowContentRectSynchronizationRect</string>
<string>372.IBPluginDependency</string>
<string>468.IBPluginDependency</string>
<string>468.IBViewBoundsToFrameTransform</string>
<string>469.IBPluginDependency</string>
<string>469.IBViewBoundsToFrameTransform</string>
<string>470.IBPluginDependency</string>
<string>471.IBPluginDependency</string>
<string>471.IBViewBoundsToFrameTransform</string>
<string>472.IBPluginDependency</string>
<string>472.IBViewBoundsToFrameTransform</string>
<string>473.IBPluginDependency</string>
<string>474.IBPluginDependency</string>
<string>474.IBViewBoundsToFrameTransform</string>
<string>475.IBPluginDependency</string>
<string>475.IBViewBoundsToFrameTransform</string>
<string>476.IBPluginDependency</string>
<string>477.IBPluginDependency</string>
<string>477.IBViewBoundsToFrameTransform</string>
<string>478.IBPluginDependency</string>
<string>478.IBViewBoundsToFrameTransform</string>
<string>479.IBPluginDependency</string>
<string>485.IBPluginDependency</string>
<string>485.IBViewBoundsToFrameTransform</string>
<string>486.IBPluginDependency</string>
<string>487.IBPluginDependency</string>
<string>488.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{432, 718}, {389, 380}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<boolean value="YES"/>
<string>{{432, 718}, {389, 380}}</string>
<integer value="1"/>
<string>{{33, 99}, {480, 360}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">AUMXAABDm4AAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCPAAAw6gAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">AUMXAABDgIAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCPAAAw40AAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">AUMXAABDSAAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCPAAAw2EAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">AUMXAABDAgAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCPAAAwxsAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABCUAAAwxYAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">490</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">AppController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">theWindow</string>
<string key="NS.object.0">NSWindow</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">theWindow</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">theWindow</string>
<string key="candidateClassName">NSWindow</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/AppController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">AppController</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>imageView</string>
<string>ninePartColor</string>
<string>patternColor</string>
<string>simpleColor</string>
<string>threePartColor</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>imageView</string>
<string>ninePartColor</string>
<string>patternColor</string>
<string>simpleColor</string>
<string>threePartColor</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">imageView</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">ninePartColor</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">patternColor</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">simpleColor</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">threePartColor</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1050" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<nil key="IBDocument.LastKnownRelativeProjectPath"/>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
</data>
</archive>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,103 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index-debug.html
test
Created by aparajita on May 19, 2011.
Copyright 2011, Victory-Heart Productions All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="Resources/icon.png" />
<link rel="apple-touch-startup-image" href="Resources/default.png" />
<title>CPColor-CPImage-description</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
</script>
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
<script type="text/javascript">
objj_msgSend_reset();
// DEBUG OPTIONS:
// Uncomment to enable printing of backtraces on exceptions:
//objj_msgSend_decorate(objj_backtrace_decorator);
// Uncomment to supress exceptions that take place inside a message
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
// Uncomment to enable runtime type checking:
//objj_msgSend_decorate(objj_typecheck_decorator);
// Uncomment (along with both above) to print backtraces on type check errors:
//objj_typecheck_prints_backtrace = true;
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
//CPLogUnregister(CPLogDefault);
// Uncomment to enable a specific logger:
//CPLogRegister(CPLogConsole);
//CPLogRegister(CPLogPopup);
</script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading test...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More