Issue #1482: fix next + previous tab actions

This commit is contained in:
Ansgar Becker
2025-03-20 20:25:45 +01:00
parent 3de5774f91
commit d4bc6feec8
2 changed files with 23 additions and 5 deletions

View File

@ -4340,6 +4340,7 @@ object MainForm: TMainForm
Caption = '&Previous tab' Caption = '&Previous tab'
Hint = 'Previous tab|Go back to the previous tab' Hint = 'Previous tab|Go back to the previous tab'
ImageIndex = 117 ImageIndex = 117
OnExecute = actPreviousTabExecute
ShortCut = 24585 ShortCut = 24585
end end
object actNextTab: TAction object actNextTab: TAction
@ -4347,6 +4348,7 @@ object MainForm: TMainForm
Caption = '&Next tab' Caption = '&Next tab'
Hint = 'Next tab|Go to the next tab' Hint = 'Next tab|Go to the next tab'
ImageIndex = 116 ImageIndex = 116
OnExecute = actNextTabExecute
ShortCut = 16393 ShortCut = 16393
end end
object actSelectAll: TAction object actSelectAll: TAction
@ -20038,7 +20040,7 @@ object MainForm: TMainForm
end end
object SynCompletionProposal: TSynCompletion object SynCompletionProposal: TSynCompletion
OnExecute = SynCompletionProposalExecute OnExecute = SynCompletionProposalExecute
Position = 0 Position = -1
LinesInWindow = 6 LinesInWindow = 6
OnPositionChanged = SynCompletionProposalChange OnPositionChanged = SynCompletionProposalChange
SelectedColor = clHighlight SelectedColor = clHighlight

View File

@ -786,6 +786,8 @@ type
actCopyGridNodes: TAction; actCopyGridNodes: TAction;
actCopyGridNodes1: TMenuItem; actCopyGridNodes1: TMenuItem;
procedure actCreateDBObjectExecute(Sender: TObject); procedure actCreateDBObjectExecute(Sender: TObject);
procedure actNextTabExecute(Sender: TObject);
procedure actPreviousTabExecute(Sender: TObject);
procedure menuConnectionsPopup(Sender: TObject); procedure menuConnectionsPopup(Sender: TObject);
procedure actExitApplicationExecute(Sender: TObject); procedure actExitApplicationExecute(Sender: TObject);
//procedure WMCopyData(var Msg: TWMCopyData); message WM_COPYDATA; //procedure WMCopyData(var Msg: TWMCopyData); message WM_COPYDATA;
@ -4516,6 +4518,16 @@ begin
PlaceObjectEditor(Obj); PlaceObjectEditor(Obj);
end; end;
procedure TMainForm.actNextTabExecute(Sender: TObject);
begin
PageControlMain.SelectNextPage(True);
end;
procedure TMainForm.actPreviousTabExecute(Sender: TObject);
begin
PageControlMain.SelectNextPage(False);
end;
procedure TMainForm.actEmptyTablesExecute(Sender: TObject); procedure TMainForm.actEmptyTablesExecute(Sender: TObject);
var var
@ -14891,8 +14903,10 @@ begin
// Go back to the result tab left to the active one // Go back to the result tab left to the active one
Tab := QueryTabs.ActiveTab; Tab := QueryTabs.ActiveTab;
if Tab <> nil then begin if Tab <> nil then begin
if Tab.tabsetQuery.TabIndex > 0 then if Tab.tabsetQuery.TabIndex > 0 then begin
//Tab.tabsetQuery.SelectNext(False) Tab.tabsetQuery.TabIndex := Tab.tabsetQuery.TabIndex -1;
Tab.tabsetQuery.OnChange(Tab.tabsetQuery);
end
else else
Beep; Beep;
end; end;
@ -14906,8 +14920,10 @@ begin
// Advance to the next result tab // Advance to the next result tab
Tab := QueryTabs.ActiveTab; Tab := QueryTabs.ActiveTab;
if Tab <> nil then begin if Tab <> nil then begin
if Tab.tabsetQuery.TabIndex < Tab.tabsetQuery.Tabs.Count-1 then if Tab.tabsetQuery.TabIndex < Tab.tabsetQuery.Tabs.Count-1 then begin
//Tab.tabsetQuery.SelectNext(True) Tab.tabsetQuery.TabIndex := Tab.tabsetQuery.TabIndex +1;
Tab.tabsetQuery.OnChange(Tab.tabsetQuery);
end
else else
Beep; Beep;
end; end;