Fix tracking / responder chain issues

This commit is contained in:
Matthias Neeracher 2008-01-29 03:02:25 +00:00
parent 4b3ba05f3a
commit 96587871bb
5 changed files with 1270 additions and 1243 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
//
// (MN) Matthias Neeracher
//
// Copyright © 2005-2007 Matthias Neeracher
// Copyright © 2005-2008 Matthias Neeracher
//
#import <Cocoa/Cocoa.h>

View File

@ -5,7 +5,7 @@
//
// (MN) Matthias Neeracher
//
// Copyright © 2005-2007 Matthias Neeracher
// Copyright © 2005-2008 Matthias Neeracher
//
#import "VLSheetView.h"
@ -217,7 +217,7 @@ VLMusicElement sSemi2Accidental[12][12] = {
- (void) setTrackingRect
{
NSRect r = [self bounds];
NSRect r = [self visibleRect];
NSPoint mouse =
[self convertPoint:[[self window] mouseLocationOutsideOfEventStream]
fromView: nil];
@ -226,8 +226,6 @@ VLMusicElement sSemi2Accidental[12][12] = {
fCursorTracking = [self addTrackingRect:r owner:self
userData:nil assumeInside:within];
[[self window] setAcceptsMouseMovedEvents:within];
if (within && ![self editTarget])
[[self window] makeFirstResponder:self];
}
- (void) clearTrackingRect
@ -244,7 +242,8 @@ VLMusicElement sSemi2Accidental[12][12] = {
-(void)viewWillMoveToWindow:(NSWindow *)win
{
if (!win && [self window]) [self clearTrackingRect];
if (!win && [self window])
[self clearTrackingRect];
}
-(void)viewDidMoveToWindow
@ -872,8 +871,8 @@ static int8_t sSharpAcc[] = {
- (void) mouseExited:(NSEvent *)event
{
[[self window] setAcceptsMouseMovedEvents:NO];
[self mouseMoved:event];
[[self window] setAcceptsMouseMovedEvents:NO];
}
- (void) mouseDown:(NSEvent *)event

View File

@ -35,6 +35,8 @@
IBOutlet id progressToolItem;
IBOutlet id displayToolItem;
IBOutlet id sheetView;
int editNumTopLedgers;
int editNumBotLedgers;
int editNumStanzas;

View File

@ -5,7 +5,7 @@
//
// (MN) Matthias Neeracher
//
// Copyright © 2005-2007 Matthias Neeracher
// Copyright © 2005-2008 Matthias Neeracher
//
#import "VLSheetWindow.h"
@ -164,4 +164,19 @@ static NSString* sDisplayToolbarItemIdentifier = @"Display Toolbar Item Identifi
[progressToolItem stopAnimation:self];
}
- (IBAction) zoomIn: (id) sender
{
[sheetView zoomIn:sender];
}
- (IBAction) zoomOut: (id) sender
{
[sheetView zoomOut:sender];
}
- (void) mouseMoved:(NSEvent *)event
{
[sheetView mouseMoved:event];
}
@end