Revision: 3340
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3340&view=rev
Author:   hofman
Date:     2007-12-28 10:34:58 -0800 (Fri, 28 Dec 2007)

Log Message:
-----------
Override printDocument in all PDFViews.

Modified Paths:
--------------
    trunk/BDSKZoomablePDFView.m
    trunk/SKSecondaryPDFView.m

Modified: trunk/BDSKZoomablePDFView.m
===================================================================
--- trunk/BDSKZoomablePDFView.m 2007-12-26 13:21:42 UTC (rev 3339)
+++ trunk/BDSKZoomablePDFView.m 2007-12-28 18:34:58 UTC (rev 3340)
@@ -306,6 +306,14 @@
     [self setAutoFits:YES];
 }
 
+- (void)printDocument:(id)sender{
+    id document = [[[self window] windowController] document];
+    if ([document respondsToSelector:_cmd])
+        [document printDocument:sender];
+    else if ([[BDSKZoomablePDFView superclass] 
instancesRespondToSelector:_cmd])
+        [(id)super printDocument:sender];
+}
+
 - (NSMenu *)menuForEvent:(NSEvent *)theEvent {
     NSMenu *menu = [super menuForEvent:theEvent];
     int i, count = [menu numberOfItems];
@@ -327,6 +335,8 @@
         return YES;
     } else if ([[BDSKZoomablePDFView superclass] 
instancesRespondToSelector:_cmd]) {
         return [super validateMenuItem:menuItem];
+    } else if ([menuItem action] == @selector(printDocument:)) {
+        return [[self document] allowsPrinting];
     }
     return YES;
 }

Modified: trunk/SKSecondaryPDFView.m
===================================================================
--- trunk/SKSecondaryPDFView.m  2007-12-26 13:21:42 UTC (rev 3339)
+++ trunk/SKSecondaryPDFView.m  2007-12-28 18:34:58 UTC (rev 3340)
@@ -330,6 +330,14 @@
     [self setDisplaysPageBreaks:[self displaysPageBreaks] == NO];
 }
 
+- (void)printDocument:(id)sender{
+    id document = [[[self window] windowController] document];
+    if ([document respondsToSelector:_cmd])
+        [document printDocument:sender];
+    else if ([[SKSecondaryPDFView superclass] instancesRespondToSelector:_cmd])
+        [(id)super printDocument:sender];
+}
+
 - (NSMenu *)menuForEvent:(NSEvent *)theEvent {
     NSMenu *menu = [super menuForEvent:theEvent];
     int i = [menu indexOfItemWithTarget:self 
andAction:NSSelectorFromString(@"_toggleContinuous:")];
@@ -355,6 +363,8 @@
     } else if ([menuItem action] == 
@selector(toggleDisplayPageBreaksFromMenu:)) {
         [menuItem setState:[self displaysPageBreaks] ? NSOnState : NSOffState];
         return YES;
+    } else if ([menuItem action] == @selector(printDocument:)) {
+        return [[self document] allowsPrinting];
     } else if ([[SKSecondaryPDFView superclass] 
instancesRespondToSelector:_cmd]) {
         return [super validateMenuItem:menuItem];
     }


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 2005.
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