Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://dev.sabi.net/svn/dev/trunk/Cocoa/Pester@26 24bc951d-4bb6-0310-a7b7-f2527510289e
- Loading branch information
Showing
30 changed files
with
5,412 additions
and
334 deletions.
There are no files selected for viewing
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
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 @@ | ||
<font face="Lucida Grande" size="-1"><b>Icon by</b> <a href="mailto:excellence@global.co.za">Diederik Vemer</a></font>. |
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
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,19 @@ | ||
// | ||
// NJRHistoryTrackingComboBox.h | ||
// DockCam | ||
// | ||
// Created by Nicholas Riley on Fri Jun 28 2002. | ||
// Copyright (c) 2002 Nicholas Riley. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
|
||
@interface NJRHistoryTrackingComboBox : NSComboBox { | ||
|
||
} | ||
|
||
- (IBAction)removeEntry:(id)sender; | ||
- (IBAction)clearAllEntries:(id)sender; | ||
|
||
@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,75 @@ | ||
// | ||
// NJRHistoryTrackingComboBox.m | ||
// DockCam | ||
// | ||
// Created by Nicholas Riley on Fri Jun 28 2002. | ||
// Copyright (c) 2002 Nicholas Riley. All rights reserved. | ||
// | ||
|
||
#import "NJRHistoryTrackingComboBox.h" | ||
|
||
#define NJRHistoryTrackingComboBoxMaxItems 10 | ||
|
||
@implementation NJRHistoryTrackingComboBox | ||
|
||
- (NSString *)_defaultKey; | ||
{ | ||
NSAssert([self tag] != 0, @"CanÕt track history for combo box with tag 0: please set a tag"); | ||
return [NSString stringWithFormat: @"NJRHistoryTrackingComboBox tag %d", [self tag]]; | ||
} | ||
|
||
- (void)awakeFromNib; | ||
{ | ||
NSAssert([self tag] != 0, @"CanÕt track history for combo box with tag 0: please set a tag"); | ||
[[NSNotificationCenter defaultCenter] addObserver: self | ||
selector: @selector(textDidEndEditing:) | ||
name: NSTextDidEndEditingNotification | ||
object: self]; | ||
[self removeAllItems]; | ||
[self addItemsWithObjectValues: [[NSUserDefaults standardUserDefaults] stringArrayForKey: [self _defaultKey]]]; | ||
[self setItemHeight: [self itemHeight] + 2]; | ||
} | ||
|
||
- (void)_writeHistory; | ||
{ | ||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; | ||
[defaults setObject: [self objectValues] forKey: [self _defaultKey]]; | ||
[defaults synchronize]; | ||
} | ||
|
||
- (IBAction)removeEntry:(id)sender; | ||
{ | ||
int idx = [self indexOfSelectedItem]; | ||
if (idx == -1) { | ||
[self selectItemWithObjectValue: [self stringValue]]; | ||
idx = [self indexOfSelectedItem]; | ||
} | ||
if (idx != -1) [self removeItemAtIndex: idx]; | ||
[self setStringValue: @""]; | ||
[self _writeHistory]; | ||
} | ||
|
||
- (IBAction)clearAllEntries:(id)sender; | ||
{ | ||
[self removeAllItems]; | ||
[self setStringValue: @""]; | ||
[self _writeHistory]; | ||
} | ||
|
||
- (BOOL)textShouldEndEditing:(NSText *)textObject; | ||
{ | ||
NSString *newValue = [self stringValue]; | ||
int oldIndex = [self indexOfItemWithObjectValue: newValue]; | ||
[self removeItemWithObjectValue: newValue]; | ||
[self insertItemWithObjectValue: newValue atIndex: 0]; | ||
if (oldIndex == NSNotFound) { | ||
int numItems = [self numberOfItems]; | ||
while (numItems-- > NJRHistoryTrackingComboBoxMaxItems) { | ||
[self removeItemAtIndex: numItems - 1]; | ||
} | ||
} | ||
[self _writeHistory]; | ||
return YES; | ||
} | ||
|
||
@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,16 @@ | ||
// | ||
// NSTableView-NJRExtensions.h | ||
// HostLauncher | ||
// | ||
// Created by Nicholas Riley on Mon Apr 22 2002. | ||
// Copyright (c) 2002 Nicholas Riley. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
|
||
@interface NSTableView (NJRExtensions) | ||
|
||
- (float)cellHeight; | ||
|
||
@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,25 @@ | ||
// | ||
// NSTableView-NJRExtensions.m | ||
// HostLauncher | ||
// | ||
// Created by Nicholas Riley on Mon Apr 22 2002. | ||
// Copyright (c) 2002 Nicholas Riley. All rights reserved. | ||
// | ||
|
||
#import "NSTableView-NJRExtensions.h" | ||
|
||
|
||
@implementation NSTableView (NJRExtensions) | ||
|
||
- (float)cellHeight; | ||
{ | ||
return [self rowHeight] + [self intercellSpacing].height; | ||
} | ||
|
||
// causes NSTableView to get keyboard focus (with thanks to Pierre-Olivier Latour) | ||
- (BOOL)needsPanelToBecomeKey | ||
{ | ||
return YES; | ||
} | ||
|
||
@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
Oops, something went wrong.