Ignore:
Timestamp:
11/28/07 01:29:26 (15 years ago)
Author:
Nicholas Riley
Message:

English.lproj/Alarms.nib: Specify alternating row coloring in the nib,
now we're 10.4+.

English.lproj/InfoPlist.strings: Updated for 1.1b6.

English.lproj/Localizable.strings: Quote alarm message in pretty
description (used in tooltip). Change voice error now it no longer
incorporates OSStatus.

English.lproj/MainMenu.nib: Add speech prefs again; turn repetitions
field into a NJRValidatingField and hook up its delegate.

Info-Pester.plist: Updated for 1.1b6.

NJRHotKey.m: Switch to new Objective-C exception style.

NJRIntervalField.[hm]: Now a subclass of NJRValidatingField.

NJRTableDelegate.m: Get rid of our own tooltip support as NSTableView
now supports them (though with a minor visual glitch on the first
tooltip).

NJRTableView.[hm]: Remove tooltip support. Remove alternating row
coloring support.

NJRValidatingField.[hm]: Contains validation sheet stuff from
NJRIntervalField.

NJRVoicePopUpButton.[hm]: Switch to NSSpeechSynthesizer.

PSAlarm.m: Quote alarm message in pretty description (used in
tooltip). Fix repeating alarms not restoring as repeating if they
didn't expire while Pester was not running. No longer set timer on
Pester 1.0 alarm import, to help make importing atomic.

PSAlarmSetController.[hm]: Use NJRValidatingField for repetitions
field. Switch to new Objective-C exception style. Fix validation
issues on in/at changing. Temporary changes to restore speech support
and allow the sound popup to be removed entirely from the nib (rather
than being dragged out of the visible area, as it was in 1.1b5).
Changes for NSSpeechSynthesizer, which uses different voice names.

PSAlarms.m: Switch to new Objective-C exception style. Fix
duplication and error handling in Pester 1.0 alarm import, making
atomic.

PSAlarmsController.m: Use new tooltip support (since it's implemented
in the delegate rather than the data source, we have to proxy it).

PSAlerts.m: Wrap initialization in exception block so we don't leak.

PSApplication.m: Switch to new Objective-C exception style.

PSMediaAlert.m: Clamp repetitions at 1..99 so the user can't type an
invalid value, then quit and have it saved.

PSSpeechAlert.[hm]: Switch to NSSpeechSynthesizer. Throw an
intelligible exception if the voice is unavailable.

PSTimer.m: Switch to new Objective-C exception style.

Pester.xcodeproj: Remove VERSION generation; rename targets to be more
understandable.

Read Me.rtfd: Updated for 1.1b6.

SUSpeaker.[hm]: Gone in switch to NSSpeechSynthesizer.

VERSION: Gone - we use agvtool for everything now.

Updates/release-notes.html: Updated for 1.1b6.

Updates/updates.xml: Updated for 1.1b6.

package-Pester.sh: Use agvtool to get version. Atomically update
file on Web server to avoid partial downloads.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cocoa/Pester/Source/NJRTableView.m

    r102 r364  
    1717
    1818@implementation NJRTableView
    19 
    20 - (id)initWithCoder:(NSCoder *)aDecoder;
    21 {
    22     if ( (self = [super initWithCoder: aDecoder]) != nil) {
    23         toolTipRegionList = [[NSMutableDictionary alloc] initWithCapacity: 20];
    24     }
    25     return self;
    26 }
    27 
    28 - (void)dealloc;
    29 {
    30     [toolTipRegionList release];
    31     [super dealloc];
    32 }
    33 
    34 #pragma mark tool tips
    35 
    36 - (void)reloadData;
    37 {
    38     [toolTipRegionList removeAllObjects];
    39     [self removeAllToolTips];
    40     [super reloadData];
    41 }
    42 
    43 - (void)noteNumberOfRowsChanged;
    44 {
    45     [toolTipRegionList removeAllObjects];
    46     [self removeAllToolTips];
    47     [super noteNumberOfRowsChanged];
    48 }
    49 
    50 - (NSString *)_keyForColumn:(int)columnIndex row:(int)rowIndex;
    51 {
    52     return [NSString stringWithFormat:@"%d,%d", rowIndex, columnIndex];
    53 }
    54 
    55 - (NSString *)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag point:(NSPoint)point userData:(void *)data;
    56 {
    57     // ask our data source for the tool tip
    58     if ([[self dataSource] respondsToSelector: @selector(tableView:toolTipForTableColumn:row:)]) {
    59         if ([self rowAtPoint: point] >= 0) return [[self dataSource] tableView: self toolTipForTableColumn: [[self tableColumns] objectAtIndex: [self columnAtPoint: point]] row: [self rowAtPoint: point]];
    60     }
    61     return nil;
    62 }
    63 
    64 - (NSRect)frameOfCellAtColumn:(int)columnIndex row:(int)rowIndex;
    65 {
    66     // this cell is apparently displayed, so we need to add a region for it
    67     NSNumber *toolTipTag;
    68     NSRect result = [super frameOfCellAtColumn: columnIndex row: rowIndex];
    69     // check if cell is already in the list
    70     NSString *cellKey = [self _keyForColumn: columnIndex row: rowIndex];
    71     // remove old region
    72     if (toolTipTag = [toolTipRegionList objectForKey: cellKey])
    73         [self removeToolTip: [toolTipTag intValue]];
    74     // add new region
    75     [toolTipRegionList setObject: [NSNumber numberWithInt: [self addToolTipRect: result owner: self userData: cellKey]] forKey: cellKey];
    76     return [super frameOfCellAtColumn: columnIndex row: rowIndex];
    77 }
    7819
    7920#pragma mark type selection
     
    162103}
    163104
    164 #pragma mark row coloring
    165 
    166 - (void)drawGridInClipRect:(NSRect)rect;
    167 {
    168     NSRange columnRange = [self columnsInRect: rect];
    169     int i;
    170     // match iTunesÕ grid color
    171     [[[NSColor gridColor] blendedColorWithFraction: 0.70 ofColor: [NSColor whiteColor]] set];
    172     for (i = columnRange.location ; i < NSMaxRange(columnRange) ; i++) {
    173         NSRect colRect = [self rectOfColumn: i];
    174         int rightEdge = (int) 0.5 + colRect.origin.x + colRect.size.width;
    175         [NSBezierPath strokeLineFromPoint: NSMakePoint(-0.5 + rightEdge, -0.5 + rect.origin.y)
    176                                   toPoint: NSMakePoint(-0.5 + rightEdge, -0.5 + rect.origin.y + rect.size.height)];
    177     }
    178 }
    179 
    180 - (void)highlightSelectionInClipRect:(NSRect)clipRect;
    181 {
    182     NSColor *evenColor, *oddColor = [self backgroundColor];
    183     float cellHeight = [self cellHeight];
    184     NSRect visibleRect = [self visibleRect];
    185     NSRect highlightRect;
    186    
    187     if ([NSColor respondsToSelector: @selector(alternateSelectedControlColor)])
    188         evenColor = [[NSColor alternateSelectedControlColor] highlightWithLevel:0.90];
    189     else // match iTunesÕ row background color
    190         evenColor = [NSColor colorWithCalibratedRed: 0.929 green: 0.953 blue: 0.996 alpha:1.0];
    191 
    192     highlightRect.origin = NSMakePoint(NSMinX(visibleRect), (int)(NSMinY(clipRect) / cellHeight) * cellHeight);
    193     highlightRect.size = NSMakeSize(NSWidth(visibleRect), cellHeight);
    194 
    195     while (NSMinY(highlightRect) < NSMaxY(clipRect)) {
    196         NSRect clippedHighlightRect = NSIntersectionRect(highlightRect, clipRect);
    197         int row = (int)((NSMinY(highlightRect) + cellHeight / 2.0) / cellHeight);
    198         NSColor *rowColor = (row % 2 == 0) ? evenColor : oddColor;
    199         [rowColor set];
    200         NSRectFill(clippedHighlightRect);
    201         highlightRect.origin.y += cellHeight;
    202     }
    203 
    204     [super highlightSelectionInClipRect: clipRect];
    205 }
    206 
    207105@end
Note: See TracChangeset for help on using the changeset viewer.