diff --git a/Cog.xcodeproj/project.pbxproj b/Cog.xcodeproj/project.pbxproj index f6b3b22bc..1871aff80 100644 --- a/Cog.xcodeproj/project.pbxproj +++ b/Cog.xcodeproj/project.pbxproj @@ -11,6 +11,8 @@ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; + 8E4C7F080A0509FC003BE25F /* DragScrollView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8E4C7F060A0509FC003BE25F /* DragScrollView.h */; }; + 8E4C7F090A0509FC003BE25F /* DragScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E4C7F070A0509FC003BE25F /* DragScrollView.m */; }; 8E75756909F31D5A0080F1EE /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E75751909F31D5A0080F1EE /* AppController.m */; }; 8E75756A09F31D5A0080F1EE /* ClickField.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E75751C09F31D5A0080F1EE /* ClickField.m */; }; 8E75756B09F31D5A0080F1EE /* InfoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E75751E09F31D5A0080F1EE /* InfoView.m */; }; @@ -139,6 +141,7 @@ 8E757B5709F326710080F1EE /* OggFLAC.framework in CopyFiles */, 8E757B5809F326710080F1EE /* FAAD2.framework in CopyFiles */, 8E757B5909F326710080F1EE /* DecMPA.framework in CopyFiles */, + 8E4C7F080A0509FC003BE25F /* DragScrollView.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -155,6 +158,8 @@ 32CA4F630368D1EE00C91783 /* Cog_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cog_Prefix.pch; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 8D1107320486CEB800E47090 /* Cog.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Cog.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 8E4C7F060A0509FC003BE25F /* DragScrollView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DragScrollView.h; sourceTree = ""; }; + 8E4C7F070A0509FC003BE25F /* DragScrollView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = DragScrollView.m; sourceTree = ""; }; 8E75751309F31D130080F1EE /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/MainMenu.nib; sourceTree = ""; }; 8E75751809F31D5A0080F1EE /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; 8E75751909F31D5A0080F1EE /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = AppController.m; sourceTree = ""; }; @@ -408,6 +413,8 @@ 8E75752009F31D5A0080F1EE /* TrackingCell.m */, 8E75752109F31D5A0080F1EE /* TrackingSlider.h */, 8E75752209F31D5A0080F1EE /* TrackingSlider.m */, + 8E4C7F060A0509FC003BE25F /* DragScrollView.h */, + 8E4C7F070A0509FC003BE25F /* DragScrollView.m */, ); path = Custom; sourceTree = ""; @@ -691,6 +698,7 @@ 8E75758B09F31D5A0080F1EE /* DBLog.m in Sources */, 8E75758C09F31D5A0080F1EE /* Semaphore.m in Sources */, 8E75758D09F31D5A0080F1EE /* VirtualRingBuffer.m in Sources */, + 8E4C7F090A0509FC003BE25F /* DragScrollView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Custom/DragScrollView.h b/Custom/DragScrollView.h new file mode 100644 index 000000000..bade03cff --- /dev/null +++ b/Custom/DragScrollView.h @@ -0,0 +1,16 @@ +// +// ScrollableTextField.h +// Cog +// +// Created by Zaphod Beeblebrox on 4/30/06. +// Copyright 2006 __MyCompanyName__. All rights reserved. +// + +#import + + +@interface DragScrollView : NSScrollView { + NSPoint downPoint; +} + +@end diff --git a/Custom/DragScrollView.m b/Custom/DragScrollView.m new file mode 100644 index 000000000..f623f1713 --- /dev/null +++ b/Custom/DragScrollView.m @@ -0,0 +1,46 @@ +// +// ScrollableTextField.m +// Cog +// +// Created by Zaphod Beeblebrox on 4/30/06. +// Copyright 2006 __MyCompanyName__. All rights reserved. +// + +#import "DragScrollView.h" + + +@implementation DragScrollView + +- (BOOL)acceptsFirstMouse:(NSEvent *)event { + return YES; +} + +- (void)mouseDown:(NSEvent *)event +{ + if([event type] == NSLeftMouseDown) + { + if ([event clickCount] == 2) + { + [[self contentView] scrollToPoint:NSMakePoint(0,0)]; + } + + downPoint = [event locationInWindow]; + downPoint = [[self contentView] convertPoint:downPoint fromView:nil]; + } + +} + +- (void)mouseDragged:(NSEvent *)event +{ + NSPoint p = [event locationInWindow]; + + p = [self convertPoint:p fromView:nil]; + + p.y = 0; + p.x = -p.x + downPoint.x; + [[self contentView] scrollToPoint:p]; + [self setNeedsDisplay:YES]; +} + + +@end diff --git a/English.lproj/MainMenu.nib/classes.nib b/English.lproj/MainMenu.nib/classes.nib index 357aab90c..5e47b0c04 100644 --- a/English.lproj/MainMenu.nib/classes.nib +++ b/English.lproj/MainMenu.nib/classes.nib @@ -37,6 +37,7 @@ OUTLETS = {tableView = NSTableView; }; SUPERCLASS = NSArrayController; }, + {CLASS = DragScrollView; LANGUAGE = ObjC; SUPERCLASS = NSScrollView; }, { ACTIONS = {cancel = id; openFeedbackWindow = id; sendFeedback = id; }; CLASS = FeedbackController; @@ -98,7 +99,6 @@ }; SUPERCLASS = NSTableView; }, - {CLASS = RoundBackgroundField; LANGUAGE = ObjC; SUPERCLASS = NSTextField; }, { ACTIONS = { changeVolume = id; diff --git a/English.lproj/MainMenu.nib/info.nib b/English.lproj/MainMenu.nib/info.nib index e998d12fe..d0f70062a 100644 --- a/English.lproj/MainMenu.nib/info.nib +++ b/English.lproj/MainMenu.nib/info.nib @@ -3,7 +3,7 @@ IBDocumentLocation - 141 329 617 240 0 0 1024 746 + 32 330 617 240 0 0 1024 746 IBEditorPositions 29 @@ -28,11 +28,11 @@ 3 IBOpenObjects + 513 463 - 823 29 21 - 513 + 823 IBSystem Version 8I127 diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib index 1ee53540a..3bc5dac71 100644 Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and b/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index 160df2c8f..74ba816d7 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -591,6 +591,13 @@ return repeat; } +- (void)setFilterPredicate:(NSPredicate *)filterPredicate +{ + [self updateIndexesFromRow:0]; + + [super setFilterPredicate:filterPredicate]; +} + - (void)savePlaylist:(NSString *)filename { // DBLog(@"SAVING PLAYLIST: %@", filename);