Permalink
Browse files

Fix for ticket #5: Disable PDFView scroll wheel. Did this by overridi…

…ng NSApplication's sendEvent: method and eating all the NSScrollWheel event.

Signed-off-by: Jonathan 'Wolf' Rentzsch <jwr.git@redshed.net>
  • Loading branch information...
1 parent 7ba02d9 commit 2bc84f511646bc6799ac7fc742464b2e45082374 Philippe Casgrain committed with Jul 12, 2009
Showing with 37 additions and 2 deletions.
  1. +6 −0 Blitz.xcodeproj/project.pbxproj
  2. +12 −1 English.lproj/MainMenu.xib
  3. +1 −1 Info.plist
  4. +7 −0 MyApplication.h
  5. +11 −0 MyApplication.m
@@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
1DDD582C0DA1D0D100B32029 /* MyDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58280DA1D0D100B32029 /* MyDocument.xib */; };
1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */; };
+ 376586FD1009A33F00B9BC9B /* MyApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 376586FC1009A33F00B9BC9B /* MyApplication.m */; };
79BB568B0FF7374A00D94BEB /* BlitzPDFView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79BB56890FF7374A00D94BEB /* BlitzPDFView.m */; };
79BB56AC0FF7386500D94BEB /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79BB56AB0FF7386500D94BEB /* Quartz.framework */; };
79BFE53A0FF7E738000668B2 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79BFE5390FF7E738000668B2 /* Sparkle.framework */; };
@@ -48,6 +49,8 @@
2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
32DBCF750370BD2300C91783 /* Blitz_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Blitz_Prefix.pch; sourceTree = "<group>"; };
+ 376586FB1009A33F00B9BC9B /* MyApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyApplication.h; sourceTree = "<group>"; };
+ 376586FC1009A33F00B9BC9B /* MyApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyApplication.m; sourceTree = "<group>"; };
79BB56890FF7374A00D94BEB /* BlitzPDFView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlitzPDFView.m; sourceTree = "<group>"; };
79BB568A0FF7374A00D94BEB /* BlitzPDFView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlitzPDFView.h; sourceTree = "<group>"; };
79BB56AB0FF7386500D94BEB /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = /System/Library/Frameworks/Quartz.framework; sourceTree = "<absolute>"; };
@@ -119,6 +122,8 @@
2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */,
79BB568A0FF7374A00D94BEB /* BlitzPDFView.h */,
79BB56890FF7374A00D94BEB /* BlitzPDFView.m */,
+ 376586FB1009A33F00B9BC9B /* MyApplication.h */,
+ 376586FC1009A33F00B9BC9B /* MyApplication.m */,
);
name = Classes;
sourceTree = "<group>";
@@ -236,6 +241,7 @@
8D15AC310486D014006FF6A4 /* MyDocument.m in Sources */,
8D15AC320486D014006FF6A4 /* main.m in Sources */,
79BB568B0FF7374A00D94BEB /* BlitzPDFView.m in Sources */,
+ 376586FD1009A33F00B9BC9B /* MyApplication.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -33,7 +33,7 @@
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="1050">
- <string key="NSClassName">NSApplication</string>
+ <string key="NSClassName">MyApplication</string>
</object>
<object class="NSMenu" id="649796088">
<string key="NSTitle">AMainMenu</string>
@@ -1799,6 +1799,17 @@
<int key="maxID">451</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">MyApplication</string>
+ <string key="superclassName">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">MyApplication.h</string>
+ </object>
+ </object>
+ </object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
View
@@ -54,7 +54,7 @@
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
- <string>NSApplication</string>
+ <string>MyApplication</string>
<key>SUFeedURL</key>
<string>http://s3.amazonaws.com/rentzsch/blitz-appcast.xml</string>
<key>SUPublicDSAKeyFile</key>
View
@@ -0,0 +1,7 @@
+#import <Foundation/Foundation.h>
+
+@interface MyApplication : NSApplication
+{
+}
+
+@end
View
@@ -0,0 +1,11 @@
+#import "MyApplication.h"
+
+@implementation MyApplication
+
+- (void)sendEvent:(NSEvent*)theEvent {
+ // Eat all the scrollWheel events, we don't want the PDFView to scroll
+ if (theEvent.type != NSScrollWheel)
+ [super sendEvent:theEvent];
+}
+
+@end

0 comments on commit 2bc84f5

Please sign in to comment.