Implement selectAll

This commit is contained in:
Matthias Neeracher 2011-09-24 21:11:46 +02:00
parent e44dd7d554
commit 013bc0fb8c

View File

@ -29,6 +29,7 @@
} }
- (VLMeasureEditable *)initWithView:(VLSheetView *)view anchor:(uint32_t)anchor; - (VLMeasureEditable *)initWithView:(VLSheetView *)view anchor:(uint32_t)anchor;
- (VLMeasureEditable *)initWithView:(VLSheetView *)view anchor:(uint32_t)anchor to:(uint32_t)end;
- (BOOL)canExtendSelection:(VLRegion)region; - (BOOL)canExtendSelection:(VLRegion)region;
- (void)extendSelection:(VLLocation)at; - (void)extendSelection:(VLLocation)at;
- (BOOL)hidden; - (BOOL)hidden;
@ -37,17 +38,22 @@
@implementation VLMeasureEditable @implementation VLMeasureEditable
- (VLMeasureEditable *)initWithView:(VLSheetView *)view anchor:(uint32_t)anchor - (VLMeasureEditable *)initWithView:(VLSheetView *)view anchor:(uint32_t)anchor to:(uint32_t)end
{ {
fView = view; fView = view;
fAnchor = anchor; fAnchor = anchor;
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[fView selectMeasure:fAnchor to:fAnchor]; [fView selectMeasure:fAnchor to:end];
}); });
return self; return self;
} }
- (VLMeasureEditable *)initWithView:(VLSheetView *)view anchor:(uint32_t)anchor
{
return [self initWithView:view anchor:anchor to:anchor];
}
- (void)dealloc - (void)dealloc
{ {
[fView selectMeasure:0 to:kNoMeasure]; [fView selectMeasure:0 to:kNoMeasure];
@ -334,6 +340,12 @@ VLSequenceCallback(
} }
} }
- (IBAction)selectAll:(id)sender
{
[self setEditTarget:[[VLMeasureEditable alloc]
initWithView:self anchor:0 to:[self song]->fMeasures.size()]];
}
- (IBAction)delete:(id)sender - (IBAction)delete:(id)sender
{ {
[[self document] willChangeSong]; [[self document] willChangeSong];