Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit.

  • Loading branch information...
commit 118980a370a132e474533cfb234f5c1cedbdc446 0 parents
@joshaber authored
28 Demo-Info.plist
@@ -0,0 +1,28 @@
+<?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>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>${MACOSX_DEPLOYMENT_TARGET}</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
21 DemoSectionView.h
@@ -0,0 +1,21 @@
+//
+// DemoSectionView.h
+// JAListView
+//
+// Created by Josh Abernathy on 11/26/10.
+// Copyright 2010 Maybe Apps. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+#import "JAListViewItem.h"
+
+
+@interface DemoSectionView : JAListViewItem {}
+
++ (DemoSectionView *)demoSectionView;
+
+@property (assign) IBOutlet NSTextField *textField;
+@property (assign) IBOutlet NSTextField *shadowTextField;
+@property (nonatomic, copy) NSString *text;
+
+@end
57 DemoSectionView.m
@@ -0,0 +1,57 @@
+//
+// DemoSectionView.m
+// JAListView
+//
+// Created by Josh Abernathy on 11/26/10.
+// Copyright 2010 Maybe Apps. All rights reserved.
+//
+
+#import "DemoSectionView.h"
+
+
+@implementation DemoSectionView
+
++ (DemoSectionView *)demoSectionView {
+ static NSNib *nib = nil;
+ if(nib == nil) {
+ nib = [[NSNib alloc] initWithNibNamed:NSStringFromClass(self) bundle:nil];
+ }
+
+ NSArray *objects = nil;
+ [nib instantiateNibWithOwner:nil topLevelObjects:&objects];
+ for(id object in objects) {
+ if([object isKindOfClass:self]) {
+ return object;
+ }
+ }
+
+ NSAssert1(NO, @"No view of class %@ found.", NSStringFromClass(self));
+ return nil;
+}
+
+
+#pragma mark NSView
+
+- (void)drawRect:(NSRect)dirtyRect {
+ [super drawRect:dirtyRect];
+
+ [[NSColor lightGrayColor] set];
+ NSRectFill(dirtyRect);
+}
+
+
+#pragma mark API
+
+@synthesize textField;
+@synthesize shadowTextField;
+
+- (void)setText:(NSString *)text {
+ [self.textField setStringValue:[[text copy] autorelease]];
+ [self.shadowTextField setStringValue:[[text copy] autorelease]];
+}
+
+- (NSString *)text {
+ return [self.textField stringValue];
+}
+
+@end
699 DemoSectionView.xib
@@ -0,0 +1,699 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1060</int>
+ <string key="IBDocument.SystemVersion">10H574</string>
+ <string key="IBDocument.InterfaceBuilderVersion">823</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">823</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="1"/>
+ </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">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomObject" id="1001">
+ <string key="NSClassName">NSObject</string>
+ </object>
+ <object class="NSCustomObject" id="1003">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSCustomObject" id="1004">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ <object class="NSCustomView" id="1005">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">268</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTextField" id="284902833">
+ <reference key="NSNextResponder" ref="1005"/>
+ <int key="NSvFlags">298</int>
+ <string key="NSFrame">{{-3, 16}, {486, 17}}</string>
+ <reference key="NSSuperview" ref="1005"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="11719384">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">138413056</int>
+ <string key="NSContents">Section!</string>
+ <object class="NSFont" key="NSSupport" id="193088098">
+ <string key="NSName">Helvetica-Bold</string>
+ <double key="NSSize">13</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <reference key="NSControlView" ref="284902833"/>
+ <object class="NSColor" key="NSBackgroundColor" id="992659223">
+ <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">
+ <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="NSTextField" id="276464756">
+ <reference key="NSNextResponder" ref="1005"/>
+ <int key="NSvFlags">298</int>
+ <string key="NSFrame">{{-3, 15}, {486, 17}}</string>
+ <reference key="NSSuperview" ref="1005"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="544158687">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">138413056</int>
+ <string key="NSContents">Section!</string>
+ <reference key="NSSupport" ref="193088098"/>
+ <reference key="NSControlView" ref="276464756"/>
+ <reference key="NSBackgroundColor" ref="992659223"/>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">4</int>
+ <bytes key="NSWhite">MSAwLjcAA</bytes>
+ </object>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{480, 50}</string>
+ <reference key="NSSuperview"/>
+ <string key="NSClassName">DemoSectionView</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">textField</string>
+ <reference key="source" ref="1005"/>
+ <reference key="destination" ref="284902833"/>
+ </object>
+ <int key="connectionID">6</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">shadowTextField</string>
+ <reference key="source" ref="1005"/>
+ <reference key="destination" ref="276464756"/>
+ </object>
+ <int key="connectionID">7</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>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="1001"/>
+ <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="1003"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="1004"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="1005"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="284902833"/>
+ <reference ref="276464756"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">2</int>
+ <reference key="object" ref="284902833"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="11719384"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">3</int>
+ <reference key="object" ref="11719384"/>
+ <reference key="parent" ref="284902833"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="276464756"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="544158687"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="544158687"/>
+ <reference key="parent" ref="276464756"/>
+ </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>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>1.WindowOrigin</string>
+ <string>1.editorWindowContentRectSynchronizationRect</string>
+ <string>2.IBPluginDependency</string>
+ <string>2.IBViewBoundsToFrameTransform</string>
+ <string>3.IBPluginDependency</string>
+ <string>4.IBPluginDependency</string>
+ <string>4.IBViewBoundsToFrameTransform</string>
+ <string>5.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>{{322, 806}, {480, 50}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{628, 654}</string>
+ <string>{{217, 442}, {480, 272}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAADAQAAAwfgAAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABDJAAAwVAAAA</bytes>
+ </object>
+ <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">7</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">DemoSectionView</string>
+ <string key="superclassName">JAListViewItemView</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>shadowTextField</string>
+ <string>textField</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSTextField</string>
+ <string>NSTextField</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>shadowTextField</string>
+ <string>textField</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">shadowTextField</string>
+ <string key="candidateClassName">NSTextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">textField</string>
+ <string key="candidateClassName">NSTextField</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">DemoSectionView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">JAListViewItemView</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">JAListViewItemView.h</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSActionCell</string>
+ <string key="superclassName">NSCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <string key="superclassName">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="155253526">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="576454771">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="114833010">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSCell</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSControl</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="749115126">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSFormatter</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSMenu</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="44373090">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="155253526"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="576454771"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="114833010"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="749115126"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDragging.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="44373090"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTableView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="208069961">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSResponder</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSTextField</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTextField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSTextFieldCell</string>
+ <string key="superclassName">NSActionCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSClipView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <string key="superclassName">NSResponder</string>
+ <reference key="sourceIdentifier" ref="208069961"/>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+ <integer value="1060" 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>
+ <string key="IBDocument.LastKnownRelativeProjectPath">JAListView.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>
26 DemoView.h
@@ -0,0 +1,26 @@
+//
+// DemoView.h
+// JAListView
+//
+// Created by Josh Abernathy on 9/29/10.
+// Copyright 2010 Maybe Apps. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+#import "JAListViewItem.h"
+
+
+@interface DemoView : JAListViewItem {
+ NSGradient *gradient;
+ BOOL selected;
+ NSTextField *textField;
+ NSTextField *shadowTextField;
+}
+
++ (DemoView *)demoView;
+
+@property (nonatomic, copy) NSString *text;
+@property (retain) IBOutlet NSTextField *textField;
+@property (retain) IBOutlet NSTextField *shadowTextField;
+
+@end
87 DemoView.m
@@ -0,0 +1,87 @@
+//
+// DemoView.m
+// JAListView
+//
+// Created by Josh Abernathy on 9/29/10.
+// Copyright 2010 Maybe Apps. All rights reserved.
+//
+
+#import "DemoView.h"
+
+@interface DemoView ()
+- (void)drawBackground;
+
+@property (nonatomic, readonly) NSGradient *gradient;
+@end
+
+
+@implementation DemoView
+
++ (DemoView *)demoView {
+ static NSNib *nib = nil;
+ if(nib == nil) {
+ nib = [[NSNib alloc] initWithNibNamed:NSStringFromClass(self) bundle:nil];
+ }
+
+ NSArray *objects = nil;
+ [nib instantiateNibWithOwner:nil topLevelObjects:&objects];
+ for(id object in objects) {
+ if([object isKindOfClass:self]) {
+ return object;
+ }
+ }
+
+ NSAssert1(NO, @"No view of class %@ found.", NSStringFromClass(self));
+ return nil;
+}
+
+
+#pragma mark NSView
+
+- (void)drawRect:(NSRect)rect {
+ [super drawRect:rect];
+ [self drawBackground];
+}
+
+
+#pragma mark API
+
+- (void)drawBackground {
+ [self.gradient drawInRect:self.bounds angle:self.selected ? 270.0f : 90.0f];
+
+ [[NSColor colorWithDeviceWhite:0.5f alpha:1.0f] set];
+ NSRectFill(NSMakeRect(0.0f, 0.0f, self.bounds.size.width, 1.0f));
+
+ [[NSColor colorWithDeviceWhite:0.93f alpha:1.0f] set];
+ NSRectFill(NSMakeRect(0.0f, self.bounds.size.height - 1.0f, self.bounds.size.width, 1.0f));
+}
+
+- (NSGradient *)gradient {
+ if(gradient == nil) {
+ gradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithDeviceWhite:0.8f alpha:1.0f] endingColor:[NSColor colorWithDeviceWhite:0.85f alpha:1.0f]];
+ }
+
+ return gradient;
+}
+
+- (void)setText:(NSString *)newText {
+ NSString *newValue = [[newText copy] autorelease];
+ [self.textField setStringValue:newValue];
+ [self.shadowTextField setStringValue:newValue];
+}
+
+- (NSString *)text {
+ return [self.textField stringValue];
+}
+
+- (void)setSelected:(BOOL)isSelected {
+ selected = isSelected;
+
+ [self setNeedsDisplay:YES];
+}
+
+@synthesize selected;
+@synthesize textField;
+@synthesize shadowTextField;
+
+@end
698 DemoView.xib
@@ -0,0 +1,698 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1060</int>
+ <string key="IBDocument.SystemVersion">10H574</string>
+ <string key="IBDocument.InterfaceBuilderVersion">823</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">823</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="1"/>
+ </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">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomObject" id="1001">
+ <string key="NSClassName">NSObject</string>
+ </object>
+ <object class="NSCustomObject" id="1003">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSCustomObject" id="1004">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ <object class="NSCustomView" id="1005">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">266</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTextField" id="761520997">
+ <reference key="NSNextResponder" ref="1005"/>
+ <int key="NSvFlags">298</int>
+ <string key="NSFrame">{{17, 18}, {353, 17}}</string>
+ <reference key="NSSuperview" ref="1005"/>
+ <int key="NSViewLayerContentsRedrawPolicy">2</int>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="330931401">
+ <int key="NSCellFlags">67239488</int>
+ <int key="NSCellFlags2">272631808</int>
+ <string key="NSContents">Label</string>
+ <object class="NSFont" key="NSSupport" id="777143121">
+ <string key="NSName">HelveticaNeue-Bold</string>
+ <double key="NSSize">14</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <reference key="NSControlView" ref="761520997"/>
+ <object class="NSColor" key="NSBackgroundColor" id="809985342">
+ <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">
+ <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="NSTextField" id="351060068">
+ <reference key="NSNextResponder" ref="1005"/>
+ <int key="NSvFlags">298</int>
+ <string key="NSFrame">{{17, 13}, {353, 21}}</string>
+ <reference key="NSSuperview" ref="1005"/>
+ <int key="NSViewLayerContentsRedrawPolicy">2</int>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="147322242">
+ <int key="NSCellFlags">67239488</int>
+ <int key="NSCellFlags2">272631808</int>
+ <string key="NSContents">Label</string>
+ <reference key="NSSupport" ref="777143121"/>
+ <reference key="NSControlView" ref="351060068"/>
+ <reference key="NSBackgroundColor" ref="809985342"/>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MSAxIDEgMC43AA</bytes>
+ </object>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{387, 50}</string>
+ <reference key="NSSuperview"/>
+ <int key="NSViewLayerContentsRedrawPolicy">2</int>
+ <string key="NSClassName">DemoView</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">textField</string>
+ <reference key="source" ref="1005"/>
+ <reference key="destination" ref="761520997"/>
+ </object>
+ <int key="connectionID">7</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">shadowTextField</string>
+ <reference key="source" ref="1005"/>
+ <reference key="destination" ref="351060068"/>
+ </object>
+ <int key="connectionID">10</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>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="1001"/>
+ <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="1003"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="1004"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="1005"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="761520997"/>
+ <reference ref="351060068"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">2</int>
+ <reference key="object" ref="761520997"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="330931401"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">3</int>
+ <reference key="object" ref="330931401"/>
+ <reference key="parent" ref="761520997"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="351060068"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="147322242"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="147322242"/>
+ <reference key="parent" ref="351060068"/>
+ </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>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>1.WindowOrigin</string>
+ <string>1.editorWindowContentRectSynchronizationRect</string>
+ <string>2.IBPluginDependency</string>
+ <string>2.IBViewBoundsToFrameTransform</string>
+ <string>3.IBPluginDependency</string>
+ <string>5.IBPluginDependency</string>
+ <string>6.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>{{322, 706}, {387, 50}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{628, 654}</string>
+ <string>{{217, 442}, {480, 272}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABCFAAAwoYAAA</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">10</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">DemoView</string>
+ <string key="superclassName">JAListViewItemView</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>shadowTextField</string>
+ <string>textField</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSTextField</string>
+ <string>NSTextField</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>shadowTextField</string>
+ <string>textField</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">shadowTextField</string>
+ <string key="candidateClassName">NSTextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">textField</string>
+ <string key="candidateClassName">NSTextField</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">DemoView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">JAListViewItemView</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">JAListViewItemView.h</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSActionCell</string>
+ <string key="superclassName">NSCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <string key="superclassName">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="457898340">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="694168530">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="341771374">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSCell</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSControl</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="313633832">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSFormatter</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSMenu</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="282250278">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="457898340"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="694168530"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="341771374"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="313633832"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDragging.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="282250278"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTableView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="177778860">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSResponder</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSTextField</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTextField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSTextFieldCell</string>
+ <string key="superclassName">NSActionCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSClipView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <string key="superclassName">NSResponder</string>
+ <reference key="sourceIdentifier" ref="177778860"/>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+ <integer value="1060" 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>
+ <string key="IBDocument.LastKnownRelativeProjectPath">JAListView.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>
2  English.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
4,611 English.lproj/MainMenu.xib
4,611 additions, 0 deletions not shown
32 JAListView-Info.plist
@@ -0,0 +1,32 @@
+<?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>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>${MACOSX_DEPLOYMENT_TARGET}</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
136 JAListView.h
@@ -0,0 +1,136 @@
+//
+// JAListView.h
+// JAListView
+//
+// Created by Josh Abernathy on 9/29/10.
+// Copyright 2010 Maybe Apps. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+@class JAListView;
+@class JAListViewItem;
+
+extern NSString * const JAListViewDraggingPasteboardType;
+
+@protocol JAListViewDataSource <NSObject>
+- (NSUInteger)numberOfItemsInListView:(JAListView *)listView;
+- (JAListViewItem *)listView:(JAListView *)listView viewAtIndex:(NSUInteger)index;
+@end
+
+@protocol JAListViewDelegate <NSObject>
+@optional
+/**
+ * Mouse down/up doesn't necessarily mean the view will be selected. These methods will always get called regardless of the return value of -listView:shouldSelectView:.
+ */
+- (void)listView:(JAListView *)listView mouseDownOnView:(JAListViewItem *)view withEvent:(NSEvent *)event;
+- (void)listView:(JAListView *)listView mouseUpOnView:(JAListViewItem *)view withEvent:(NSEvent *)event;
+
+- (void)listView:(JAListView *)listView rightMouseDownOnView:(JAListViewItem *)view withEvent:(NSEvent *)event;
+
+/**
+ * A view being selected doesn't necessarily mean it was selected by a click. For instance, keyboard selection will also trigger these events. If the selection is coming from a click, then -listView:willSelectView: gets called on mouse down and -listView:didSelectView: will get called on mouse up while still inside the view.
+ */
+- (BOOL)listView:(JAListView *)listView shouldSelectView:(JAListViewItem *)view;
+- (void)listView:(JAListView *)listView willSelectView:(JAListViewItem *)view;
+- (void)listView:(JAListView *)listView didSelectView:(JAListViewItem *)view;
+- (void)listView:(JAListView *)listView didDeselectView:(JAListViewItem *)view;
+@end
+
+@protocol JAListViewDraggingSourceDelegate <NSObject>
+- (BOOL)listView:(JAListView *)listView shouldDragView:(JAListViewItem *)view;
+- (void)listView:(JAListView *)listView didStartDraggingView:(JAListViewItem *)view;
+- (void)listView:(JAListView *)listView didEndDraggingView:(JAListViewItem *)view;
+@end
+
+@protocol JAListViewDraggingDestinationDelegate <NSObject>
+- (BOOL)listView:(JAListView *)listView shouldAcceptViews:(NSArray *)draggedViews location:(NSPoint)location;
+- (void)listView:(JAListView *)listView dragEntered:(NSArray *)draggedViews location:(NSPoint)location;
+- (void)listView:(JAListView *)listView dragUpdated:(NSArray *)draggedViews location:(NSPoint)location;
+- (void)listView:(JAListView *)listView dragEnded:(NSArray *)draggedViews location:(NSPoint)location;
+- (void)listView:(JAListView *)listView dragExited:(NSArray *)draggedViews location:(NSPoint)location;
+@end
+
+
+@interface JAListView : NSView {
+ NSMutableArray *cachedViews;
+ NSArray *cachedVisibleViews;
+ CGFloat heightForAllContent;
+ id<JAListViewDataSource> dataSource;
+ id<JAListViewDelegate> delegate;
+ id<JAListViewDraggingSourceDelegate> draggingSourceDelegate;
+ id<JAListViewDraggingDestinationDelegate> draggingDestinationDelegate;
+ BOOL canCallDataSourceInParallel;
+ NSPoint margin;
+ CGFloat *cachedLocations;
+ __weak JAListViewItem *viewBeingSelected;
+ JAListViewItem *viewBeingUsedForInertialScroll;
+ NSColor *backgroundColor;
+ BOOL isResizingManually;
+ BOOL conditionallyUseLayerBacking;
+}
+
+- (void)setup;
+
+- (void)reloadData;
+- (void)reloadDataAnimated:(BOOL)animated;
+- (void)reloadLayout;
+- (void)reloadLayoutAnimated:(BOOL)animated;
+
+- (NSUInteger)numberOfViews;
+- (JAListViewItem *)viewAtIndex:(NSUInteger)index;
+- (NSInteger)indexForView:(JAListViewItem *)view;
+- (BOOL)isViewVisible:(JAListViewItem *)view;
+
+- (JAListViewItem *)viewAtPoint:(NSPoint)point;
+
+/*
+ * Default implementation returns proposedY. Subclasses could implement this to adjust the Y location for the view.
+ */
+- (CGFloat)yForView:(JAListViewItem *)view proposedY:(CGFloat)proposedY;
+
+/**
+ * Default implementation returns proposedHeight. Subclasses could implement this to adjust the height of the view.
+ */
+- (CGFloat)heightForView:(JAListViewItem *)view proposedHeight:(CGFloat)proposedHeight;
+
+- (void)setView:(JAListViewItem *)view forKey:(id)key;
+- (id)viewForKey:(id)key;
+- (void)removeViewForKey:(id)key;
+- (id)keyForView:(JAListViewItem *)view;
+
+- (void)setView:(JAListViewItem *)view forObject:(id)object;
+- (id)viewForObject:(id)object;
+- (void)removeViewForObject:(id)object;
+- (void)removeAllStoredViews;
+
+/**
+ * Will call the delegate's listView:didSelectView: but not listView:shouldSelectView: or listView:willSelectView:.
+ */
+- (void)selectView:(JAListViewItem *)view;
+
+/**
+ * Will call the delegate's listView:didDeselectView:.
+ */
+- (void)deselectView:(JAListViewItem *)view;
+
+/**
+ * Will call the delegate's listView:didDeselectView: for each of the selected views.
+ */
+- (void)deselectAllViews;
+
+@property (nonatomic, readonly) NSScrollView *scrollView;
+@property (nonatomic, assign) IBOutlet id<JAListViewDataSource> dataSource;
+@property (nonatomic, assign) IBOutlet id<JAListViewDelegate> delegate;
+@property (nonatomic, assign) IBOutlet id<JAListViewDraggingSourceDelegate> draggingSourceDelegate;
+@property (nonatomic, assign) IBOutlet id<JAListViewDraggingDestinationDelegate> draggingDestinationDelegate;
+@property (nonatomic, assign) BOOL canCallDataSourceInParallel;
+@property (nonatomic, readonly) NSArray *visibleViews;
+@property (nonatomic, assign) NSPoint margin;
+@property (nonatomic, retain) JAListViewItem *viewBeingUsedForInertialScroll;
+@property (nonatomic, retain) NSColor *backgroundColor;
+@property (nonatomic, readonly) CGFloat heightForAllContent;
+@property (nonatomic, assign) BOOL conditionallyUseLayerBacking;
+@property (nonatomic, readonly) NSArray *selectedViews;
+
+@end
933 JAListView.m
@@ -0,0 +1,933 @@
+//
+// JAListView.m
+// JAListView
+//
+// Created by Josh Abernathy on 9/29/10.
+// Copyright 2010 Maybe Apps. All rights reserved.
+//
+
+#import "JAListView.h"
+#import "JAListViewItem.h"
+#import <QuartzCore/QuartzCore.h>
+
+static NSArray *viewsCurrentlyBeingDraggedGlobal = nil;
+
+NSString * const JAListViewDraggingPasteboardType = @"JAListViewDraggingPasteboardType";
+
+@interface JAListView ()
+- (void)viewBoundsDidChange:(NSNotification *)notification;
+- (void)viewFrameDidChange:(NSNotification *)notification;
+- (void)sizeToFitIfNeeded;
+- (void)reloadAllViews;
+- (void)recacheAllLocations;
+- (void)showVisibleViewsAnimated:(BOOL)animated;
+- (void)updateCachedVisibleViews;
+- (void)clearCachedLocations;
+- (void)seriouslyShowVisibleViewsWithAnimation;
+- (id)keyForObject:(id)object;
+- (void)getSelectionMinimumIndex:(NSUInteger *)minIndex maximumIndex:(NSUInteger *)maxIndex;
+- (JAListViewItem *)nextSelectableView;
+- (JAListViewItem *)previousSelectableView;
+
+@property (readonly) NSMutableArray *cachedViews;
+@property (nonatomic, readonly) CGFloat *cachedLocations;
+@property (nonatomic, retain) NSArray *cachedVisibleViews;
+@property (nonatomic, assign) __weak JAListViewItem *viewBeingSelected;
+@property (nonatomic, retain) NSArray *viewsCurrentlyBeingDragged;
+@property (nonatomic, retain) NSMutableDictionary *viewStorage;
+@property (nonatomic, retain) NSMutableArray *currentlySelectedViews;
+@property (nonatomic, retain) NSTrackingArea *currentTrackingArea;
+@end
+
+
+@implementation JAListView
+
+- (void)finalize {
+ if(cachedLocations != NULL) {
+ free(cachedLocations);
+ cachedLocations = NULL;
+ }
+
+ [super finalize];
+}
+
+- (void)dealloc {
+ if(cachedLocations != NULL) {
+ free(cachedLocations);
+ cachedLocations = NULL;
+ }
+
+ self.viewBeingUsedForInertialScroll = nil;
+ self.backgroundColor = nil;
+ self.cachedVisibleViews = nil;
+ self.viewStorage = nil;
+ self.currentlySelectedViews = nil;
+ self.currentTrackingArea = nil;
+
+ [super dealloc];
+}
+
+
+#pragma mark NSView
+
+- (id)initWithFrame:(NSRect)frameRect {
+ self = [super initWithFrame:frameRect];
+ if(self == nil) return nil;
+
+ [self setup];
+
+ return self;
+}
+
+- (id)initWithCoder:(NSCoder *)decoder {
+ self = [super initWithCoder:decoder];
+ if(self == nil) return nil;
+
+ [self setup];
+
+ return self;
+}
+
+- (void)viewWillMoveToSuperview:(NSView *)newSuperview {
+ if(self.superview != nil) {
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:NSViewBoundsDidChangeNotification object:self.superview];
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:NSViewFrameDidChangeNotification object:self.superview];
+ }
+}
+
+- (void)viewDidMoveToSuperview {
+ if(self.superview == nil) return;
+
+ [self.scrollView.contentView setPostsBoundsChangedNotifications:YES];
+ [self.scrollView.contentView setPostsFrameChangedNotifications:YES];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewBoundsDidChange:) name:NSViewBoundsDidChangeNotification object:self.scrollView.contentView];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewFrameDidChange:) name:NSViewFrameDidChangeNotification object:self.scrollView.contentView];
+
+ [self sizeToFitIfNeeded];
+
+ [self.scrollView setBackgroundColor:self.backgroundColor];
+}
+
+- (BOOL)isFlipped {
+ return YES;
+}
+
+- (void)drawRect:(NSRect)dirtyRect {
+ [super drawRect:dirtyRect];
+
+ [self.backgroundColor set];
+ NSRectFill(dirtyRect);
+}
+
+
+#pragma mark NSResponder
+
+- (void)rightMouseUp:(NSEvent *)event {
+ NSPoint location = [self convertPoint:[event locationInWindow] fromView:nil];
+ JAListViewItem *view = [self viewAtPoint:location];
+
+ if([self.delegate respondsToSelector:@selector(listView:rightMouseDownOnView:withEvent:)]) {
+ [self.delegate listView:self rightMouseDownOnView:view withEvent:event];
+ }
+}
+
+- (void)mouseDown:(NSEvent *)event {
+ if(([event modifierFlags] & NSControlKeyMask) != 0 && [event clickCount] == 1) {
+ [self rightMouseUp:event];
+ return;
+ }
+
+ NSPoint location = [self convertPoint:[event locationInWindow] fromView:nil];
+ JAListViewItem *view = [self viewAtPoint:location];
+ if(view == nil) return;
+
+ if([self.delegate respondsToSelector:@selector(listView:mouseDownOnView:withEvent:)]) {
+ [self.delegate listView:self mouseDownOnView:view withEvent:event];
+ }
+
+ BOOL shouldSelect = YES;
+ if([self.delegate respondsToSelector:@selector(listView:shouldSelectView:)]) {
+ shouldSelect = [self.delegate listView:self shouldSelectView:view];
+ }
+
+ if(!shouldSelect) {
+ return;
+ }
+
+ if(self.currentTrackingArea != nil) {
+ [self removeTrackingArea:self.currentTrackingArea];
+ }
+
+ self.currentTrackingArea = [[[NSTrackingArea alloc] initWithRect:view.frame options:NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways | NSTrackingInVisibleRect | NSTrackingEnabledDuringMouseDrag owner:self userInfo:nil] autorelease];
+ [self addTrackingArea:self.currentTrackingArea];
+
+ self.viewBeingSelected = view;
+ self.viewBeingSelected.highlighted = YES;
+
+ if([self.delegate respondsToSelector:@selector(listView:willSelectView:)]) {
+ [self.delegate listView:self willSelectView:view];
+ }
+}
+
+- (void)mouseUp:(NSEvent *)event {
+ [self removeTrackingArea:self.currentTrackingArea];
+ self.currentTrackingArea = nil;
+
+ NSPoint location = [self convertPoint:[event locationInWindow] fromView:nil];
+ JAListViewItem *view = [self viewAtPoint:location];
+ BOOL respondsToUnSelect = [self.delegate respondsToSelector:@selector(listView:didDeselectView:)];
+ if(view == nil) {
+ if(self.viewBeingSelected != nil) {
+ if(respondsToUnSelect) {
+ [self.delegate listView:self didDeselectView:self.viewBeingSelected];
+ }
+
+ self.viewBeingSelected.highlighted = NO;
+ self.viewBeingSelected = nil;
+ } else {
+ for(JAListViewItem *selectedView in [[self.currentlySelectedViews copy] autorelease]) {
+ [[selectedView retain] autorelease];
+ selectedView.selected = NO;
+ [self.currentlySelectedViews removeObject:selectedView];
+
+ if(respondsToUnSelect) {
+ [self.delegate listView:self didDeselectView:selectedView];
+ }
+ }
+ }
+ } else {
+ if([self.delegate respondsToSelector:@selector(listView:mouseUpOnView:withEvent:)]) {
+ [self.delegate listView:self mouseUpOnView:view withEvent:event];
+ }
+
+ self.viewBeingSelected.highlighted = NO;
+
+ BOOL shouldSelect = YES;
+ if([self.delegate respondsToSelector:@selector(listView:shouldSelectView:)]) {
+ shouldSelect = [self.delegate listView:self shouldSelectView:view];
+ }
+
+ if(!shouldSelect) {
+ return;
+ }
+
+ if([event modifierFlags] & NSCommandKeyMask) {
+ if([self.currentlySelectedViews containsObject:view]) {
+ [[view retain] autorelease];
+ view.selected = NO;
+ [self.currentlySelectedViews removeObject:view];
+
+ if(respondsToUnSelect) {
+ [self.delegate listView:self didDeselectView:view];
+ }
+ } else {
+ view.selected = YES;
+ [self.currentlySelectedViews addObject:view];
+
+ if([self.delegate respondsToSelector:@selector(listView:didSelectView:)]) {
+ [self.delegate listView:self didSelectView:view];
+ }
+ }
+ } else if([event modifierFlags] & NSShiftKeyMask) {
+ NSUInteger currentMin = 0;
+ NSUInteger currentMax = 0;
+ [self getSelectionMinimumIndex:&currentMin maximumIndex:&currentMax];
+
+ NSUInteger indexOfView = [self indexForView:view];
+ if(indexOfView < currentMin) {
+ JAListViewItem *previousView = [self previousSelectableView];
+ NSUInteger currentIndex = [self indexForView:previousView];
+ while(previousView != nil && currentIndex > indexOfView) {
+ previousView.selected = YES;
+ [self.currentlySelectedViews addObject:previousView];
+
+ if([self.delegate respondsToSelector:@selector(listView:didSelectView:)]) {
+ [self.delegate listView:self didSelectView:previousView];
+ }
+
+ previousView = [self previousSelectableView];
+ currentIndex = [self indexForView:previousView];
+ }
+ } else {
+ JAListViewItem *nextView = [self nextSelectableView];
+ NSUInteger currentIndex = [self indexForView:nextView];
+ while(nextView != nil && currentIndex < indexOfView) {
+ nextView.selected = YES;
+ [self.currentlySelectedViews addObject:nextView];
+
+ if([self.delegate respondsToSelector:@selector(listView:didSelectView:)]) {
+ [self.delegate listView:self didSelectView:nextView];
+ }
+
+ nextView = [self nextSelectableView];
+ currentIndex = [self indexForView:nextView];
+ }
+ }
+
+ view.selected = YES;
+ [self.currentlySelectedViews addObject:view];
+
+ if([self.delegate respondsToSelector:@selector(listView:didSelectView:)]) {
+ [self.delegate listView:self didSelectView:view];
+ }
+ } else {
+ for(JAListViewItem *selectedView in [[self.currentlySelectedViews copy] autorelease]) {
+ [[selectedView retain] autorelease];
+ selectedView.selected = NO;
+ [self.currentlySelectedViews removeObject:selectedView];
+
+ if(respondsToUnSelect) {
+ [self.delegate listView:self didDeselectView:selectedView];
+ }
+ }
+
+ view.selected = YES;
+ [self.currentlySelectedViews addObject:view];
+
+ if([self.delegate respondsToSelector:@selector(listView:didSelectView:)]) {
+ [self.delegate listView:self didSelectView:view];
+ }
+ }
+
+ self.viewBeingSelected = nil;
+ }
+}
+
+- (void)mouseExited:(NSEvent *)event {
+ if(self.viewBeingSelected != nil && [self.delegate respondsToSelector:@selector(listView:didDeselectView:)]) {
+ [self.delegate listView:self didDeselectView:self.viewBeingSelected];
+ self.viewBeingSelected = nil;
+
+ [self removeTrackingArea:self.currentTrackingArea];
+ self.currentTrackingArea = nil;
+ }
+}
+
+- (void)mouseDragged:(NSEvent *)event {
+ NSPoint location = [self convertPoint:[event locationInWindow] fromView:nil];
+ NSView *view = [self viewAtPoint:location];
+ if(view == nil || ![view isKindOfClass:[JAListViewItem class]]) {
+ return;
+ }
+
+ JAListViewItem *listItemView = (JAListViewItem *) view;
+ BOOL shouldDrag = YES;
+ if([self.draggingSourceDelegate respondsToSelector:@selector(listView:shouldDragView:)]) {
+ shouldDrag = [self.draggingSourceDelegate listView:self shouldDragView:listItemView];
+ }
+
+ if(!shouldDrag) {
+ return;
+ }
+
+ [[NSPasteboard pasteboardWithName:NSDragPboard] declareTypes:[NSArray arrayWithObject:JAListViewDraggingPasteboardType] owner:self];
+ [[NSPasteboard pasteboardWithName:NSDragPboard] setString:JAListViewDraggingPasteboardType forType:JAListViewDraggingPasteboardType];
+
+ self.viewsCurrentlyBeingDragged = [NSArray arrayWithObject:listItemView];
+
+ NSPoint dragPoint = view.frame.origin;
+ dragPoint.y += view.bounds.size.height;
+ [self dragImage:[listItemView draggingImage] at:dragPoint offset:NSZeroSize event:event pasteboard:[NSPasteboard pasteboardWithName:NSDragPboard] source:self slideBack:YES];
+}
+
+- (void)keyDown:(NSEvent *)event {
+ JAListViewItem *newView = nil;
+ BOOL isShiftDown = ([event modifierFlags] & NSShiftKeyMask) != 0;
+ NSString *characters = [event characters];
+ for(NSUInteger characterIndex = 0; characterIndex < characters.length; characterIndex++) {
+ unichar character = [characters characterAtIndex:characterIndex];
+ if(character == NSUpArrowFunctionKey) {
+ newView = [self previousSelectableView];
+
+ if(!isShiftDown && newView != nil) {
+ for(JAListViewItem *view in [[self.currentlySelectedViews copy] autorelease]) {
+ [[view retain] autorelease];
+ view.selected = NO;
+ [self.currentlySelectedViews removeObject:view];
+
+ if([self.delegate respondsToSelector:@selector(listView:didDeselectView:)]) {
+ [self.delegate listView:self didDeselectView:view];
+ }
+ }
+ }
+ } else if(character == NSDownArrowFunctionKey) {
+ newView = [self nextSelectableView];
+
+ if(!isShiftDown && newView != nil) {
+ for(JAListViewItem *view in [[self.currentlySelectedViews copy] autorelease]) {
+ [[view retain] autorelease];
+ view.selected = NO;