Commit ecff631

Nick Faro committed on
Increment from blank in tablegrid
commit ecff63161b23220eb2426e63d945ddf5be88555f parent 6f4d3ba
1 changed files +11−1
Modifiedsrc/trackergrid.pas +11−1
@@ -132,7 +132,7 @@ type
132 132
133 function GetAt(SelectionPos: TSelectionPos): Integer; 133 function GetAt(SelectionPos: TSelectionPos): Integer;
134 procedure SetAt(SelectionPos: TSelectionPos; Value: Integer); 134 procedure SetAt(SelectionPos: TSelectionPos; Value: Integer);
135 procedure IncrementAt(SelectionPos: TSelectionPos; Value: Integer); 135 procedure IncrementAt(SelectionPos: TSelectionPos; Value: Integer); virtual;
136 procedure ClearAt(SelectionPos: TSelectionPos); 136 procedure ClearAt(SelectionPos: TSelectionPos);
137 137
138 procedure InsertRowInPatternAtCursor(Pattern: Integer); 138 procedure InsertRowInPatternAtCursor(Pattern: Integer);
@@ -169,6 +169,7 @@ type
169 TTableGrid = class(TTrackerGrid) 169 TTableGrid = class(TTrackerGrid)
170 procedure RenderCell(const Cell: TCell); override; 170 procedure RenderCell(const Cell: TCell); override;
171 procedure InputVolume(Key: Word); override; 171 procedure InputVolume(Key: Word); override;
172 procedure IncrementAt(SelectionPos: TSelectionPos; Value: Integer); override;
172 end; 173 end;
173 174
174 var 175 var
@@ -271,6 +272,15 @@ begin
271 EndUndoAction; 272 EndUndoAction;
272 end; 273 end;
273 274
275 procedure TTableGrid.IncrementAt(SelectionPos: TSelectionPos; Value: Integer);
276 begin
277 with Patterns[SelectionPos.X]^[SelectionPos.Y] do
278 if (Note = NO_NOTE) and (SelectionPos.SelectedPart = cpNote) then
279 Note := MIDDLE_NOTE;
280
281 inherited;
282 end;
283
274 { TSelectionEnumerator } 284 { TSelectionEnumerator }
275 285
276 constructor TSelectionEnumerator.Create(Grid: TPatternGrid; Cursor, 286 constructor TSelectionEnumerator.Create(Grid: TPatternGrid; Cursor,