mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 19:23:59 +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];
|
[self editLyrics];
|
||||||
break;
|
break;
|
||||||
case kRegionMeasure:
|
case kRegionMeasure:
|
||||||
[self editSelection];
|
[self editSelection:([event modifierFlags] & NSShiftKeyMask) != 0];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -5,14 +5,14 @@
|
||||||
//
|
//
|
||||||
// (MN) Matthias Neeracher
|
// (MN) Matthias Neeracher
|
||||||
//
|
//
|
||||||
// Copyright © 2006-2007 Matthias Neeracher
|
// Copyright © 2006-2011 Matthias Neeracher
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "VLMIDIWriter.h"
|
#import "VLMIDIWriter.h"
|
||||||
|
|
||||||
@interface VLSheetView (Selection)
|
@interface VLSheetView (Selection)
|
||||||
|
|
||||||
- (void)editSelection;
|
- (void)editSelection:(BOOL)extend;
|
||||||
- (void)adjustSelection:(NSEvent *)event;
|
- (void)adjustSelection:(NSEvent *)event;
|
||||||
- (NSRange)sectionsInSelection;
|
- (NSRange)sectionsInSelection;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
//
|
//
|
||||||
// (MN) Matthias Neeracher
|
// (MN) Matthias Neeracher
|
||||||
//
|
//
|
||||||
// Copyright © 2006-2007 Matthias Neeracher
|
// Copyright © 2006-2011 Matthias Neeracher
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "VLSheetView.h"
|
#import "VLSheetView.h"
|
||||||
|
@ -109,9 +109,16 @@ VLSequenceCallback(
|
||||||
|
|
||||||
@implementation VLSheetView (Selection)
|
@implementation VLSheetView (Selection)
|
||||||
|
|
||||||
- (void)editSelection
|
- (void)editSelection:(BOOL)extend
|
||||||
{
|
{
|
||||||
fSelStart = fSelEnd = fSelAnchor = fCursorMeasure;
|
if (extend && fSelStart > -1) {
|
||||||
|
if (fCursorMeasure > fSelEnd)
|
||||||
|
fSelEnd = fCursorMeasure;
|
||||||
|
else if (fCursorMeasure < fSelStart)
|
||||||
|
fSelStart = fCursorMeasure;
|
||||||
|
} else {
|
||||||
|
fSelStart = fSelEnd = fSelAnchor = fCursorMeasure;
|
||||||
|
}
|
||||||
[self updateMenus];
|
[self updateMenus];
|
||||||
[self setNeedsDisplay:YES];
|
[self setNeedsDisplay:YES];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user