Revision: 3743
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3743&view=rev
Author:   hofman
Date:     2008-04-17 06:21:47 -0700 (Thu, 17 Apr 2008)

Log Message:
-----------
Hit enter to show first selected note from note table.

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2008-04-17 13:09:36 UTC (rev 3742)
+++ trunk/SKMainWindowController.m      2008-04-17 13:21:47 UTC (rev 3743)
@@ -4101,6 +4101,15 @@
     return NO;
 }
 
+- (void)outlineViewInsertNewline:(NSOutlineView *)ov {
+    if ([ov isEqual:noteOutlineView]) {
+        NSArray *selectedNotes = [self selectedNotes];
+        if ([selectedNotes count])
+            [pdfView scrollAnnotationToVisible:[selectedNotes 
objectAtIndex:0]];
+        else NSBeep();
+    }
+}
+
 - (NSArray *)outlineViewHighlightedRows:(NSOutlineView *)ov {
     if ([ov isEqual:outlineView]) {
         NSMutableArray *array = [NSMutableArray array];

Modified: trunk/SKNoteOutlineView.h
===================================================================
--- trunk/SKNoteOutlineView.h   2008-04-17 13:09:36 UTC (rev 3742)
+++ trunk/SKNoteOutlineView.h   2008-04-17 13:21:47 UTC (rev 3743)
@@ -62,4 +62,5 @@
 - (void)outlineView:(NSOutlineView *)anOutlineView 
setHeightOfRow:(float)newHeight byItem:(id)item;
 - (void)outlineViewNoteTypesDidChange:(NSOutlineView *)anOutlineView;
 - (void)outlineViewCommandKeyPressedDuringNavigation:(NSOutlineView 
*)anOutlineView;
+- (void)outlineViewInsertNewline:(NSOutlineView *)anOutlineView;
 @end

Modified: trunk/SKNoteOutlineView.m
===================================================================
--- trunk/SKNoteOutlineView.m   2008-04-17 13:09:36 UTC (rev 3742)
+++ trunk/SKNoteOutlineView.m   2008-04-17 13:21:47 UTC (rev 3743)
@@ -114,10 +114,16 @@
     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];
+    if ((eventChar == NSNewlineCharacter || eventChar == NSEnterCharacter || 
eventChar == NSCarriageReturnCharacter) && modifiers == 0) {
+        if ([[self delegate] 
respondsToSelector:@selector(outlineViewInsertNewline:)])
+            [[self delegate] outlineViewInsertNewline:self];
+        else NSBeep();
+    } else {
+        [super keyDown:theEvent];
+        if ((eventChar == NSDownArrowFunctionKey || eventChar == 
NSUpArrowFunctionKey) && modifiers == NSCommandKeyMask &&
+            [[self delegate] 
respondsToSelector:@selector(outlineViewCommandKeyPressedDuringNavigation:)]) {
+            [[self delegate] 
outlineViewCommandKeyPressedDuringNavigation:self];
+        }
     }
 }
 


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 the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to