Revision: 3090
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3090&view=rev
Author:   hofman
Date:     2007-10-29 03:54:29 -0700 (Mon, 29 Oct 2007)

Log Message:
-----------
Improve editing of text notes.

Modified Paths:
--------------
    trunk/SKPDFView.m

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2007-10-29 10:14:10 UTC (rev 3089)
+++ trunk/SKPDFView.m   2007-10-29 10:54:29 UTC (rev 3090)
@@ -1938,22 +1938,23 @@
     if (editField) {
         if ([[self window] firstResponder] == [editField currentEditor] && 
[[self window] makeFirstResponder:self] == NO)
             [[self window] endEditingFor:nil];
-        if ([[editField stringValue] isEqualToString:[activeAnnotation 
contents]] == NO) {
+        if ([[editField stringValue] isEqualToString:[activeAnnotation 
contents]] == NO)
             [activeAnnotation setContents:[editField stringValue]];
-        }
         [editField removeFromSuperview];
         [editField release];
         editField = nil;
     }
 }
 
-// we're the delegate of the textfield used to edit text widgets
 - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView 
doCommandBySelector:(SEL)command {
     BOOL rv = NO;
-    if ([self isEditing] && (command == @selector(insertNewline:) || command 
== @selector(insertTab:) || command == @selector(insertBacktab:))) {
-        [self endAnnotationEdit:self];
-        [[self window] makeFirstResponder:self];
-    } else if ([PDFView instancesRespondToSelector:_cmd]) {
+    if ([control isEqual:editField]) {
+        if (command == @selector(insertNewline:) || command == 
@selector(insertTab:) || command == @selector(insertBacktab:)) {
+            [self endAnnotationEdit:self];
+            [[self window] makeFirstResponder:self];
+            rv = YES;
+        }
+    } else if ([[SKPDFView superclass] instancesRespondToSelector:_cmd]) {
        rv = [super control:control textView:textView 
doCommandBySelector:command];
     }
     return rv;
@@ -2133,13 +2134,14 @@
 }
 
 - (void)handlePageChangedNotification:(NSNotification *)notification {
-    [self relayoutEditField];
+    if ([self isEditing] && [self displayMode] != 
kPDFDisplaySinglePageContinuous && [self displayMode] != 
kPDFDisplayTwoUpContinuous)
+        [self relayoutEditField];
     if ([self toolMode] == SKSelectToolMode && NSIsEmptyRect(selectionRect) == 
NO)
         [self setNeedsDisplay:YES];
 }
 
 - (void)handleScaleChangedNotification:(NSNotification *)notification {
-    if (editField) {
+    if ([self isEditing]) {
         NSRect editBounds = [self convertRect:[self 
convertRect:[activeAnnotation bounds] fromPage:[activeAnnotation page]] 
toView:[self documentView]];
         [editField setFrame:editBounds];
         if ([activeAnnotation respondsToSelector:@selector(font)]) {


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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to