Skip to content

Commit c37d933

Browse files
committed
Increment from blank in tablegrid
1 parent bf5baca commit c37d933

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/trackergrid.pas

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ TTrackerGrid = class(TCustomControl)
131131

132132
function GetAt(SelectionPos: TSelectionPos): Integer;
133133
procedure SetAt(SelectionPos: TSelectionPos; Value: Integer);
134-
procedure IncrementAt(SelectionPos: TSelectionPos; Value: Integer);
134+
procedure IncrementAt(SelectionPos: TSelectionPos; Value: Integer); virtual;
135135
procedure ClearAt(SelectionPos: TSelectionPos);
136136

137137
procedure InsertRowInPatternAtCursor(Pattern: Integer);
@@ -166,6 +166,7 @@ TTrackerGrid = class(TCustomControl)
166166
TTableGrid = class(TTrackerGrid)
167167
procedure RenderCell(const Cell: TCell); override;
168168
procedure InputVolume(Key: Word); override;
169+
procedure IncrementAt(SelectionPos: TSelectionPos; Value: Integer); override;
169170
end;
170171

171172
var
@@ -259,6 +260,15 @@ procedure TTableGrid.InputVolume(Key: Word);
259260
EndUndoAction;
260261
end;
261262

263+
procedure TTableGrid.IncrementAt(SelectionPos: TSelectionPos; Value: Integer);
264+
begin
265+
with Patterns[SelectionPos.X]^[SelectionPos.Y] do
266+
if (Note = NO_NOTE) and (SelectionPos.SelectedPart = cpNote) then
267+
Note := MIDDLE_NOTE;
268+
269+
inherited;
270+
end;
271+
262272
{ TSelectionEnumerator }
263273

264274
constructor TSelectionEnumerator.Create(Grid: TPatternGrid; Cursor,

0 commit comments

Comments
 (0)