mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 11:14:00 +00:00
Extend selection with shift-click
This commit is contained in:
parent
0ddfe26ffb
commit
b8e4c614f3
|
@ -850,7 +850,7 @@ const float kSemiFloor = -1.0f*kLineH;
|
|||
[self editLyrics];
|
||||
break;
|
||||
case kRegionMeasure:
|
||||
[self editSelection];
|
||||
[self editSelection:([event modifierFlags] & NSShiftKeyMask) != 0];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
//
|
||||
// (MN) Matthias Neeracher
|
||||
//
|
||||
// Copyright © 2006-2007 Matthias Neeracher
|
||||
// Copyright © 2006-2011 Matthias Neeracher
|
||||
//
|
||||
|
||||
#import "VLMIDIWriter.h"
|
||||
|
||||
@interface VLSheetView (Selection)
|
||||
|
||||
- (void)editSelection;
|
||||
- (void)editSelection:(BOOL)extend;
|
||||
- (void)adjustSelection:(NSEvent *)event;
|
||||
- (NSRange)sectionsInSelection;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
//
|
||||
// (MN) Matthias Neeracher
|
||||
//
|
||||
// Copyright © 2006-2007 Matthias Neeracher
|
||||
// Copyright © 2006-2011 Matthias Neeracher
|
||||
//
|
||||
|
||||
#import "VLSheetView.h"
|
||||
|
@ -109,9 +109,16 @@ VLSequenceCallback(
|
|||
|
||||
@implementation VLSheetView (Selection)
|
||||
|
||||
- (void)editSelection
|
||||
- (void)editSelection:(BOOL)extend
|
||||
{
|
||||
if (extend && fSelStart > -1) {
|
||||
if (fCursorMeasure > fSelEnd)
|
||||
fSelEnd = fCursorMeasure;
|
||||
else if (fCursorMeasure < fSelStart)
|
||||
fSelStart = fCursorMeasure;
|
||||
} else {
|
||||
fSelStart = fSelEnd = fSelAnchor = fCursorMeasure;
|
||||
}
|
||||
[self updateMenus];
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user