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 to:(uint32_t)end;
- (BOOL)canExtendSelection:(VLRegion)region;
- (void)extendSelection:(VLLocation)at;
- (BOOL)hidden;
@ -37,17 +38,22 @@
@implementation VLMeasureEditable
- (VLMeasureEditable *)initWithView:(VLSheetView *)view anchor:(uint32_t)anchor
- (VLMeasureEditable *)initWithView:(VLSheetView *)view anchor:(uint32_t)anchor to:(uint32_t)end
{
fView = view;
fAnchor = anchor;
dispatch_async(dispatch_get_main_queue(), ^{
[fView selectMeasure:fAnchor to:fAnchor];
[fView selectMeasure:fAnchor to:end];
});
return self;
}
- (VLMeasureEditable *)initWithView:(VLSheetView *)view anchor:(uint32_t)anchor
{
return [self initWithView:view anchor:anchor to:anchor];
}
- (void)dealloc
{
[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
{
[[self document] willChangeSong];