source: trunk/Cocoa/Pester/Source/NSCharacterSet-NJRExtensions.m@ 324

Last change on this file since 324 was 51, checked in by Nicholas Riley, 22 years ago

Alarms.nib: Removed horizontal scroll bar. Turned on grid. Set delegate to NJRTableDelegate instead of PSAlarmSetController.

NJRTableDelegate: In general, made functional (was previously unused). Fixed MyCompanyName. Changed ORDER_BY_CONTEXT to use key-value coding instead of assuming data consists of a dictionary of dictionaries. Added sorting support (reorderedData, replaces oData) with autosave support for sort context. Added _positionTypeSelectDisplay, which adjusts position and justification of type select display control based on the current sort column. Added support for reverse sorting in type select string. Use table data source instead of sorted data so text matches as displayed (this will break with non-text cells...).

NJRTableView: Adapted from iTableView (Jaguar table alternate table background color), TableTester (most everything else) and NJROutlineView (keyDown, moveToBeginning/EndOfDocument). Support for type selection, delete shortcut for row deletion, and iTunes-alike background colors and frame.

NSCharacterSet-NJRExtensions: Moved _typeSelectSet from NJROutlineView as it's now shared with NJRTableView. Still need to factor NJROutlineView as embedded in HostLauncher some day.

PSAlarm: Reorganized, renamed and categorized methods. Added time accessor for the benefit of sorting. Renamed compare: to compareDate: for clarity. Added compareMessage:, though it's currently unused. Renamed cancel to cancelTimer for clarity.

PSAlarmSetController: More fun with initial first responder on window show/hide; still need to work around bug properly (subclass NSComboBox?) and fix it for real. As is, works for OS X 10.1.

PSAlarms: Added alarms accessor, returning alarm array. Fixed memory leak on successful alarm removal (oops). Added removeAlarms:, needed with sorted alarm list.

PSAlarmsController: Set window resize increment. Changes to table delegate methods to use reordered alarm list. Register for NSTableViewSelectionDidChangeNotification now we're no longer the table view delegate. Fixed autoselection in alarmsChanged by using data reordering support in NJRTableView. Implement NJRTableViewDataSource to permit deletion from table view.

Pester.pbproj: Added new files.

Read Me.rtfd: Added TableTester/iTableView acknowledgements. Updated release notes.

File size: 789 bytes
Line 
1//
2// NSCharacterSet-NJRExtensions.m
3// Pester
4//
5// Created by Nicholas Riley on Sun Nov 17 2002.
6// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
7//
8
9#import "NSCharacterSet-NJRExtensions.h"
10
11
12@implementation NSCharacterSet (NJRExtensions)
13
14static NSCharacterSet *_typeSelectSet = nil;
15
16+ (NSCharacterSet *)typeSelectSet {
17 if (_typeSelectSet == nil) {
18 NSMutableCharacterSet *set;
19 set = [[NSCharacterSet alphanumericCharacterSet] mutableCopy];
20 [set formUnionWithCharacterSet: [NSCharacterSet punctuationCharacterSet]];
21 [set formUnionWithCharacterSet: [NSCharacterSet whitespaceCharacterSet]];
22 _typeSelectSet = [set copy]; // make immutable again - for efficiency
23 [set release];
24 }
25 return _typeSelectSet;
26}
27
28@end
Note: See TracBrowser for help on using the repository browser.