Skip to content

Commit

Permalink
Increment from blank in tablegrid
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperDisk committed Dec 31, 2024
1 parent bf5baca commit c37d933
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/trackergrid.pas
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ TTrackerGrid = class(TCustomControl)

function GetAt(SelectionPos: TSelectionPos): Integer;
procedure SetAt(SelectionPos: TSelectionPos; Value: Integer);
procedure IncrementAt(SelectionPos: TSelectionPos; Value: Integer);
procedure IncrementAt(SelectionPos: TSelectionPos; Value: Integer); virtual;
procedure ClearAt(SelectionPos: TSelectionPos);

procedure InsertRowInPatternAtCursor(Pattern: Integer);
Expand Down Expand Up @@ -166,6 +166,7 @@ TTrackerGrid = class(TCustomControl)
TTableGrid = class(TTrackerGrid)
procedure RenderCell(const Cell: TCell); override;
procedure InputVolume(Key: Word); override;
procedure IncrementAt(SelectionPos: TSelectionPos; Value: Integer); override;
end;

var
Expand Down Expand Up @@ -259,6 +260,15 @@ procedure TTableGrid.InputVolume(Key: Word);
EndUndoAction;
end;

procedure TTableGrid.IncrementAt(SelectionPos: TSelectionPos; Value: Integer);
begin
with Patterns[SelectionPos.X]^[SelectionPos.Y] do
if (Note = NO_NOTE) and (SelectionPos.SelectedPart = cpNote) then
Note := MIDDLE_NOTE;

inherited;
end;

{ TSelectionEnumerator }

constructor TSelectionEnumerator.Create(Grid: TPatternGrid; Cursor,
Expand Down

0 comments on commit c37d933

Please sign in to comment.