-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial commit of Phil Dow's (unchanged) Sprouted Interface framework
- Loading branch information
0 parents
commit d2224fa
Showing
298 changed files
with
28,510 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.DS_Store | ||
*.pbxuser | ||
*.mode1v3 | ||
SproutedInterface.framework | ||
SproutedUtilities.framework | ||
build |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// AppleScriptAlert.h | ||
// SproutedInterface | ||
// | ||
// Created by Philip Dow on xx. | ||
// Copyright Sprouted. All rights reserved. | ||
// Inquiries should be directed to [email protected] | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
@interface AppleScriptAlert : NSWindowController | ||
{ | ||
IBOutlet NSTextView *errorView; | ||
IBOutlet NSTextView *sourceView; | ||
|
||
id source; | ||
id error; | ||
} | ||
|
||
- (id) initWithSource:(id)source error:(id)error; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// | ||
// AppleScriptAlert.m | ||
// SproutedInterface | ||
// | ||
// Created by Philip Dow on xx. | ||
// Copyright Sprouted. All rights reserved. | ||
// Inquiries should be directed to [email protected] | ||
// | ||
|
||
#import <SproutedInterface/AppleScriptAlert.h> | ||
|
||
@implementation AppleScriptAlert | ||
|
||
- (id) initWithSource:(id)theSource error:(id)theError | ||
{ | ||
if ( self = [super initWithWindowNibName:@"AppleScriptAlert"] ) | ||
{ | ||
source = [theSource retain]; | ||
error = [theError retain]; | ||
|
||
[self retain]; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (void) windowDidLoad | ||
{ | ||
if ( [source isKindOfClass:[NSString class]] ) | ||
[sourceView setString:source]; | ||
|
||
else if ( [source isKindOfClass:[NSAttributedString class]] ) | ||
{ | ||
[[sourceView textStorage] beginEditing]; | ||
[[sourceView textStorage] setAttributedString:source]; | ||
[[sourceView textStorage] endEditing]; | ||
} | ||
|
||
if ( error == nil ) | ||
[errorView setString:[NSString string]]; | ||
else | ||
[errorView setString:[error description]]; | ||
} | ||
|
||
- (void) dealloc | ||
{ | ||
[source release]; | ||
[error release]; | ||
|
||
[super dealloc]; | ||
} | ||
|
||
- (void) windowWillClose:(NSNotification*)aNotification | ||
{ | ||
[self autorelease]; | ||
} | ||
|
||
#pragma mark - | ||
|
||
- (IBAction) showWindow:(id)sender | ||
{ | ||
[[self window] center]; | ||
[super showWindow:sender]; | ||
} | ||
|
||
@end |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
// | ||
// CollectionManagerView.h | ||
// SproutedInterface | ||
// | ||
// Created by Philip Dow on xx. | ||
// Copyright Sprouted. All rights reserved. | ||
// Inquiries should be directed to [email protected] | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
@interface CollectionManagerView : NSView | ||
{ | ||
BOOL bordered; | ||
int numConditions; | ||
} | ||
|
||
- (int) numConditions; | ||
- (void) setNumConditions:(int)num; | ||
|
||
- (BOOL) bordered; | ||
- (void) setBordered:(BOOL)drawsBorder; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
|
||
// | ||
// CollectionManagerView.m | ||
// SproutedInterface | ||
// | ||
// Created by Philip Dow on xx. | ||
// Copyright Sprouted. All rights reserved. | ||
// Inquiries should be directed to [email protected] | ||
// | ||
|
||
#import <SproutedInterface/CollectionManagerView.h> | ||
#import <SproutedInterface/ConditionController.h> | ||
|
||
@implementation CollectionManagerView | ||
|
||
- (id)initWithFrame:(NSRect)frameRect | ||
{ | ||
if ((self = [super initWithFrame:frameRect]) != nil) { | ||
// Add initialization code here | ||
bordered = YES; | ||
} | ||
return self; | ||
} | ||
|
||
#pragma mark - | ||
|
||
- (int) numConditions | ||
{ | ||
return numConditions; | ||
} | ||
|
||
- (void) setNumConditions:(int)num | ||
{ | ||
numConditions = num; | ||
} | ||
|
||
- (BOOL) bordered | ||
{ | ||
return bordered; | ||
} | ||
|
||
- (void) setBordered:(BOOL)drawsBorder | ||
{ | ||
bordered = drawsBorder; | ||
} | ||
|
||
#pragma mark - | ||
|
||
- (BOOL) isFlipped | ||
{ | ||
return YES; | ||
} | ||
|
||
- (void)drawRect:(NSRect)rect | ||
{ | ||
int i; | ||
NSRect bds = [self bounds]; | ||
|
||
for ( i = 0; i < [self numConditions]; i++ ) | ||
{ | ||
if ( i % 2 == 0 ) | ||
{ | ||
[[NSColor whiteColor] set]; | ||
NSRectFillUsingOperation(NSMakeRect( 0, (kConditionViewHeight*i), bds.size.width, kConditionViewHeight), NSCompositeSourceOver); | ||
} | ||
else | ||
{ | ||
[[[NSColor controlAlternatingRowBackgroundColors] objectAtIndex:1] set]; | ||
NSRectFillUsingOperation(NSMakeRect( 0, (kConditionViewHeight*i), bds.size.width, kConditionViewHeight), NSCompositeSourceOver); | ||
} | ||
} | ||
|
||
if ( [self bordered] ) | ||
{ | ||
[[NSColor lightGrayColor] set]; | ||
NSFrameRect(bds); | ||
} | ||
} | ||
|
||
@end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
// | ||
// ConditionController.h | ||
// SproutedInterface | ||
// | ||
// Created by Philip Dow on xx. | ||
// Copyright Sprouted. All rights reserved. | ||
// Inquiries should be directed to [email protected] | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
#define kConditionViewHeight 26 | ||
|
||
#define PDConditionContains 0 | ||
#define PDConditionNotContains 1 | ||
#define PDConditionBeginsWith 2 | ||
#define PDConditionEndsWith 3 | ||
#define PDConditionIs 4 | ||
|
||
#define PDConditionBefore 0 | ||
#define PDConditionAfter 1 | ||
#define PDConditionBetween 2 | ||
#define PDConditionInTheLast 3 | ||
#define PDConditionInTheNext 4 | ||
|
||
#define PDConditionDay 0 | ||
#define PDConditionWeek 1 | ||
#define PDConditionMonth 2 | ||
|
||
@interface ConditionController : NSObject | ||
{ | ||
IBOutlet NSView *conditionView; | ||
IBOutlet NSView *specifiedConditionView; | ||
IBOutlet NSPopUpButton *keyPop; | ||
|
||
IBOutlet NSButton *removeButton; | ||
|
||
int tag; | ||
id target; | ||
|
||
BOOL _allowsEmptyCondition; | ||
BOOL _autogeneratesDynamicDates; | ||
BOOL _sendsLiveUpdate; | ||
|
||
} | ||
|
||
- (id) initWithTarget:(id)anObject; | ||
- (void) setInitialPredicate:(NSPredicate*)aPredicate; | ||
- (void) setInitialCondition:(NSString*)condition; | ||
|
||
- (NSView*) conditionView; | ||
- (NSPredicate*) predicate; | ||
- (NSString*) predicateString; | ||
|
||
- (int) tag; | ||
- (void) setTag:(int)newTag; | ||
|
||
- (id) target; | ||
- (void) setTarget:(id)anObject; | ||
|
||
- (BOOL) sendsLiveUpdate; | ||
- (void) setSendsLiveUpdate:(BOOL)updates; | ||
|
||
- (BOOL) autogeneratesDynamicDates; | ||
- (void) setAutogeneratesDynamicDates:(BOOL)autogenerate; | ||
|
||
- (BOOL) allowsEmptyCondition; | ||
- (void) setAllowsEmptyCondition:(BOOL)allowsEmpty; | ||
|
||
- (BOOL) removeButtonEnabled; | ||
- (void) setRemoveButtonEnabled:(BOOL)enabled; | ||
|
||
- (IBAction) addCondition:(id)sender; | ||
- (IBAction) removeCondition:(id)sender; | ||
- (IBAction) changeCondition:(id)sender; | ||
- (IBAction) changeConditionKey:(id)sender; | ||
|
||
- (id) selectableView; | ||
- (void) appropriateFirstResponder:(NSWindow*)aWindow; | ||
- (void) removeFromSuper; | ||
|
||
- (void) _sendUpdateIfRequested; | ||
|
||
// utility for creating spotlight based conditions - subclasses feel free to use | ||
- (NSString*) _spotlightConditionStringWithAttribute:(NSString*)anAttribute condition:(NSString*)aCondition operation:(int)anOperation; | ||
- (NSString*) _spotlightConditionStringWithAttributes:(NSArray*)theAttributes condition:(NSString*)aCondition operation:(int)anOperation; | ||
|
||
- (BOOL) validatePredicate; | ||
@end | ||
|
||
|
||
#pragma mark - | ||
|
||
@interface NSObject (ConditionControllerDelegate) | ||
|
||
- (void) conditionDidChange:(id)condition; | ||
|
||
@end |
Oops, something went wrong.