Commit 9c63d70

Nick committed on
More WIP shortcuts/nice features
commit 9c63d70b6d08e76073ee52793b71d0a4601f7e8c parent 470c62f
4 changed files +59−7
Modifiedrendertowave.lfm +2−2
@@ -1,7 +1,7 @@
1 object frmRenderToWave: TfrmRenderToWave 1 object frmRenderToWave: TfrmRenderToWave
2 Left = 1085 2 Left = 1086
3 Height = 313 3 Height = 313
4 Top = 103 4 Top = 105
5 Width = 451 5 Width = 451
6 BorderStyle = bsSingle 6 BorderStyle = bsSingle
7 Caption = 'Render song' 7 Caption = 'Render song'
Modifiedtracker.lfm +20−3
@@ -1,7 +1,7 @@
1 object frmTracker: TfrmTracker 1 object frmTracker: TfrmTracker
2 Left = 1459 2 Left = 1336
3 Height = 687 3 Height = 687
4 Top = 339 4 Top = 320
5 Width = 1145 5 Width = 1145
6 AllowDropFiles = True 6 AllowDropFiles = True
7 Caption = 'hUGETracker' 7 Caption = 'hUGETracker'
@@ -5235,7 +5235,7 @@ object frmTracker: TfrmTracker
5235 object ShortcutsActionList: TActionList 5235 object ShortcutsActionList: TActionList
5236 Images = ImageList1 5236 Images = ImageList1
5237 left = 208 5237 left = 208
5238 top = 36 5238 top = 32
5239 object PlayStartAction: TAction 5239 object PlayStartAction: TAction
5240 Caption = '▶️ Start' 5240 Caption = '▶️ Start'
5241 DisableIfNoHandler = False 5241 DisableIfNoHandler = False
@@ -5274,12 +5274,14 @@ object frmTracker: TfrmTracker
5274 ShortCut = 27 5274 ShortCut = 27
5275 end 5275 end
5276 object InsertRowAction: TAction 5276 object InsertRowAction: TAction
5277 Category = 'TrackerGrid'
5277 Caption = 'Insert Row' 5278 Caption = 'Insert Row'
5278 OnExecute = InsertRowActionExecute 5279 OnExecute = InsertRowActionExecute
5279 OnUpdate = InsertRowActionUpdate 5280 OnUpdate = InsertRowActionUpdate
5280 ShortCut = 45 5281 ShortCut = 45
5281 end 5282 end
5282 object InsertRowForAllAction: TAction 5283 object InsertRowForAllAction: TAction
5284 Category = 'TrackerGrid'
5283 Caption = 'InsertRowForAllAction' 5285 Caption = 'InsertRowForAllAction'
5284 OnExecute = InsertRowForAllActionExecute 5286 OnExecute = InsertRowForAllActionExecute
5285 OnUpdate = InsertRowForAllActionUpdate 5287 OnUpdate = InsertRowForAllActionUpdate
@@ -5289,12 +5291,14 @@ object frmTracker: TfrmTracker
5289 ShortCut = 16429 5291 ShortCut = 16429
5290 end 5292 end
5291 object DeleteRowAction: TAction 5293 object DeleteRowAction: TAction
5294 Category = 'TrackerGrid'
5292 Caption = 'DeleteRowAction' 5295 Caption = 'DeleteRowAction'
5293 OnExecute = DeleteRowActionExecute 5296 OnExecute = DeleteRowActionExecute
5294 OnUpdate = DeleteRowActionUpdate 5297 OnUpdate = DeleteRowActionUpdate
5295 ShortCut = 8 5298 ShortCut = 8
5296 end 5299 end
5297 object DeleteRowForAllAction: TAction 5300 object DeleteRowForAllAction: TAction
5301 Category = 'TrackerGrid'
5298 Caption = 'DeleteRowForAllAction' 5302 Caption = 'DeleteRowForAllAction'
5299 OnExecute = DeleteRowForAllActionExecute 5303 OnExecute = DeleteRowForAllActionExecute
5300 OnUpdate = DeleteRowForAllActionUpdate 5304 OnUpdate = DeleteRowForAllActionUpdate
@@ -5330,5 +5334,18 @@ object frmTracker: TfrmTracker
5330 OnExecute = GotoRoutinesActionExecute 5334 OnExecute = GotoRoutinesActionExecute
5331 ShortCut = 32850 5335 ShortCut = 32850
5332 end 5336 end
5337 object IncrementCurrentInstrumentAction: TAction
5338 Caption = 'IncrementCurrentInstrumentAction'
5339 OnExecute = IncrementCurrentInstrumentActionExecute
5340 SecondaryShortCuts.Strings = (
5341 'Shift+='
5342 )
5343 ShortCut = 8379
5344 end
5345 object DecrementCurrentInstrumentAction: TAction
5346 Caption = 'DecrementCurrentInstrumentAction'
5347 OnExecute = DecrementCurrentInstrumentActionExecute
5348 ShortCut = 8381
5349 end
5333 end 5350 end
5334 end 5351 end
Modifiedtracker.pas +31−1
@@ -16,6 +16,8 @@ type
16 { TfrmTracker } 16 { TfrmTracker }
17 17
18 TfrmTracker = class(TForm) 18 TfrmTracker = class(TForm)
19 IncrementCurrentInstrumentAction: TAction;
20 DecrementCurrentInstrumentAction: TAction;
19 GotoGeneralAction: TAction; 21 GotoGeneralAction: TAction;
20 GotoPatternsAction: TAction; 22 GotoPatternsAction: TAction;
21 GotoInstrumentsAction: TAction; 23 GotoInstrumentsAction: TAction;
@@ -240,6 +242,7 @@ type
240 TreeView1: TTreeView; 242 TreeView1: TTreeView;
241 TrackerGrid: TTrackerGrid; 243 TrackerGrid: TTrackerGrid;
242 procedure Button1Click(Sender: TObject); 244 procedure Button1Click(Sender: TObject);
245 procedure DecrementCurrentInstrumentActionExecute(Sender: TObject);
243 procedure DeleteRowActionExecute(Sender: TObject); 246 procedure DeleteRowActionExecute(Sender: TObject);
244 procedure DeleteRowActionUpdate(Sender: TObject); 247 procedure DeleteRowActionUpdate(Sender: TObject);
245 procedure DeleteRowForAllActionExecute(Sender: TObject); 248 procedure DeleteRowForAllActionExecute(Sender: TObject);
@@ -255,6 +258,7 @@ type
255 procedure GotoRoutinesActionExecute(Sender: TObject); 258 procedure GotoRoutinesActionExecute(Sender: TObject);
256 procedure GotoWavesActionExecute(Sender: TObject); 259 procedure GotoWavesActionExecute(Sender: TObject);
257 procedure HexWaveEditEditingDone(Sender: TObject); 260 procedure HexWaveEditEditingDone(Sender: TObject);
261 procedure IncrementCurrentInstrumentActionExecute(Sender: TObject);
258 procedure InsertRowActionExecute(Sender: TObject); 262 procedure InsertRowActionExecute(Sender: TObject);
259 procedure InsertRowActionUpdate(Sender: TObject); 263 procedure InsertRowActionUpdate(Sender: TObject);
260 procedure InsertRowForAllActionExecute(Sender: TObject); 264 procedure InsertRowForAllActionExecute(Sender: TObject);
@@ -453,7 +457,7 @@ type
453 procedure Panic; 457 procedure Panic;
454 public 458 public
455 procedure OnTrackerGridResize(Sender: TObject); 459 procedure OnTrackerGridResize(Sender: TObject);
456 460 procedure OnTrackerGridCursorOutOfBounds;
457 end; 461 end;
458 462
459 var 463 var
@@ -777,6 +781,21 @@ begin
777 (Section as THeaderSection).Width := TrackerGrid.ColumnWidth; 781 (Section as THeaderSection).Width := TrackerGrid.ColumnWidth;
778 end; 782 end;
779 783
784 procedure TfrmTracker.OnTrackerGridCursorOutOfBounds;
785 begin
786 if (TrackerGrid.Cursor.Y > High(TPattern))
787 and (OrderEditStringGrid.Row < OrderEditStringGrid.RowCount-1) then begin
788 OrderEditStringGrid.Row := OrderEditStringGrid.Row+1;
789 TrackerGrid.Cursor.Y := Low(TPattern);
790 end;
791
792 if (TrackerGrid.Cursor.Y < Low(TPattern))
793 and (OrderEditStringGrid.Row > 1) then begin
794 OrderEditStringGrid.Row := OrderEditStringGrid.Row-1;
795 TrackerGrid.Cursor.Y := High(TPattern);
796 end;
797 end;
798
780 procedure TfrmTracker.LoadWave(Wave: Integer); 799 procedure TfrmTracker.LoadWave(Wave: Integer);
781 begin 800 begin
782 CurrentWave := @Song.Waves[Wave]; 801 CurrentWave := @Song.Waves[Wave];
@@ -974,6 +993,7 @@ begin
974 if Assigned(TrackerGrid) then TrackerGrid.Free; 993 if Assigned(TrackerGrid) then TrackerGrid.Free;
975 TrackerGrid := TTrackerGrid.Create(Self, ScrollBox1, Song.Patterns); 994 TrackerGrid := TTrackerGrid.Create(Self, ScrollBox1, Song.Patterns);
976 TrackerGrid.OnResize:=@OnTrackerGridResize; 995 TrackerGrid.OnResize:=@OnTrackerGridResize;
996 TrackerGrid.OnCursorOutOfBounds:=@OnTrackerGridCursorOutOfBounds;
977 997
978 TrackerGrid.FontSize := OptionsFile.ReadInteger('hUGETracker', 'fontsize', 12); 998 TrackerGrid.FontSize := OptionsFile.ReadInteger('hUGETracker', 'fontsize', 12);
979 ScopesOn := OptionsFile.ReadBool('hUGETracker', 'ScopesOn', True); 999 ScopesOn := OptionsFile.ReadBool('hUGETracker', 'ScopesOn', True);
@@ -1574,6 +1594,11 @@ begin
1574 end; 1594 end;
1575 end; 1595 end;
1576 1596
1597 procedure TfrmTracker.IncrementCurrentInstrumentActionExecute(Sender: TObject);
1598 begin
1599 InstrumentComboBox.ItemIndex := EnsureRange(InstrumentComboBox.ItemIndex+1, 0, InstrumentComboBox.Items.Count-1);
1600 end;
1601
1577 procedure TfrmTracker.InsertRowActionExecute(Sender: TObject); 1602 procedure TfrmTracker.InsertRowActionExecute(Sender: TObject);
1578 begin 1603 begin
1579 TrackerGrid.InsertRowInPatternAtCursor(TrackerGrid.Cursor.X); 1604 TrackerGrid.InsertRowInPatternAtCursor(TrackerGrid.Cursor.X);
@@ -1669,6 +1694,11 @@ begin
1669 PreviewC5; 1694 PreviewC5;
1670 end; 1695 end;
1671 1696
1697 procedure TfrmTracker.DecrementCurrentInstrumentActionExecute(Sender: TObject);
1698 begin
1699 InstrumentComboBox.ItemIndex := EnsureRange(InstrumentComboBox.ItemIndex-1, 0, InstrumentComboBox.Items.Count-1);
1700 end;
1701
1672 procedure TfrmTracker.DeleteRowActionExecute(Sender: TObject); 1702 procedure TfrmTracker.DeleteRowActionExecute(Sender: TObject);
1673 begin 1703 begin
1674 TrackerGrid.DeleteRowInPatternAtCursor(TrackerGrid.Cursor.X); 1704 TrackerGrid.DeleteRowInPatternAtCursor(TrackerGrid.Cursor.X);
Modifiedtrackergrid.pas +6−1
@@ -121,6 +121,8 @@ type
121 121
122 SelectedInstrument, SelectedOctave, Step: Integer; 122 SelectedInstrument, SelectedOctave, Step: Integer;
123 123
124 OnCursorOutOfBounds: procedure of object;
125
124 property HighlightedRow: Integer read FHighlightedRow write SetHighlightedRow; 126 property HighlightedRow: Integer read FHighlightedRow write SetHighlightedRow;
125 property SelectionGridRect: TRect read GetSelectionGridRect write SetSelectionGridRect; 127 property SelectionGridRect: TRect read GetSelectionGridRect write SetSelectionGridRect;
126 property FontSize: Integer read FFontSize write SetFontSize; 128 property FontSize: Integer read FFontSize write SetFontSize;
@@ -374,7 +376,10 @@ begin
374 end; 376 end;
375 end; 377 end;
376 378
377 if (not (ssCtrl in Shift)) and (not (ssShift in Shift)) then 379 if (Cursor.Y > High(TPattern)) or (Cursor.Y < Low(TPattern)) then
380 if Assigned(OnCursorOutOfBounds) then OnCursorOutOfBounds;
381
382 if not (ssShift in Shift) then
378 Other := Cursor; 383 Other := Cursor;
379 Selecting := ssShift in Shift; 384 Selecting := ssShift in Shift;
380 385