Revision: 3454
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3454&view=rev
Author:   hofman
Date:     2008-02-26 15:50:43 -0800 (Tue, 26 Feb 2008)

Log Message:
-----------
Select note when moving up/down using Command-arrow in note table. Invert check 
for changing note table selection for changing active note.

Modified Paths:
--------------
    trunk/SKMainWindowController.m
    trunk/SKNoteOutlineView.h
    trunk/SKNoteOutlineView.m

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2008-02-26 23:20:12 UTC (rev 3453)
+++ trunk/SKMainWindowController.m      2008-02-26 23:50:43 UTC (rev 3454)
@@ -3346,7 +3346,7 @@
         [self updateLineInspector];
     }
     if ([annotation isNoteAnnotation]) {
-        if ([[self selectedNotes] containsObject:annotation]) {
+        if ([[self selectedNotes] containsObject:annotation] == NO) {
             [noteOutlineView selectRowIndexes:[NSIndexSet 
indexSetWithIndex:[noteOutlineView rowForItem:annotation]] 
byExtendingSelection:NO];
         }
     } else {
@@ -4061,6 +4061,12 @@
     return menu;
 }
 
+- (void)outlineViewCommandKeyPressedDuringNavigation:(NSOutlineView *)ov {
+    PDFAnnotation *annotation = [[self selectedNotes] lastObject];
+    if (annotation)
+        [pdfView setActiveAnnotation:annotation];
+}
+
 #pragma mark NSTableView delegate protocol
 
 - (void)tableViewSelectionDidChange:(NSNotification *)aNotification {

Modified: trunk/SKNoteOutlineView.h
===================================================================
--- trunk/SKNoteOutlineView.h   2008-02-26 23:20:12 UTC (rev 3453)
+++ trunk/SKNoteOutlineView.h   2008-02-26 23:50:43 UTC (rev 3454)
@@ -61,6 +61,7 @@
 - (BOOL)outlineView:(NSOutlineView *)anOutlineView canResizeRowByItem:(id)item;
 - (void)outlineView:(NSOutlineView *)anOutlineView 
setHeightOfRow:(int)newHeight byItem:(id)item;
 - (void)outlineViewNoteTypesDidChange:(NSOutlineView *)anOutlineView;
+- (void)outlineViewCommandKeyPressedDuringNavigation:(NSOutlineView 
*)anOutlineView;
 @end
 
 

Modified: trunk/SKNoteOutlineView.m
===================================================================
--- trunk/SKNoteOutlineView.m   2008-02-26 23:20:12 UTC (rev 3453)
+++ trunk/SKNoteOutlineView.m   2008-02-26 23:50:43 UTC (rev 3454)
@@ -110,6 +110,18 @@
     [super mouseDown:theEvent];
 }
 
+- (void)keyDown:(NSEvent *)theEvent {
+    NSString *characters = [theEvent charactersIgnoringModifiers];
+    unichar eventChar = [characters length] > 0 ? [characters 
characterAtIndex:0] : 0;
+       unsigned int modifiers = [theEvent modifierFlags] & (NSCommandKeyMask | 
NSAlternateKeyMask | NSShiftKeyMask | NSControlKeyMask);
+    
+    [super keyDown:theEvent];
+    if ((eventChar == NSDownArrowFunctionKey || eventChar == 
NSUpArrowFunctionKey) && modifiers == NSCommandKeyMask &&
+        [[self delegate] 
respondsToSelector:@selector(outlineViewCommandKeyPressedDuringNavigation:)]) {
+        [[self delegate] outlineViewCommandKeyPressedDuringNavigation:self];
+    }
+}
+
 - (void)drawRect:(NSRect)aRect {
     [super drawRect:aRect];
     if ([[self delegate] 
respondsToSelector:@selector(outlineView:canResizeRowByItem:)]) {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to