Fix issue #1013: Refreshing Process-List switches tab instead

This commit is contained in:
Ansgar Becker
2009-03-03 23:09:58 +00:00
parent 0bb025c250
commit a71210689e
2 changed files with 20 additions and 2 deletions

View File

@@ -498,7 +498,7 @@ object MainForm: TMainForm
Align = alClient
HotTrack = True
TabOrder = 0
OnChange = editFilterVTChange
OnChange = PageControlHostChange
object tabVariables: TTabSheet
Caption = 'Variables'
object ListVariables: TVirtualStringTree

View File

@@ -571,6 +571,7 @@ type
Sender: TObject; var CurrentInput: WideString; var x, y: Integer;
var CanExecute: Boolean);
procedure PageControlMainChange(Sender: TObject);
procedure PageControlHostChange(Sender: TObject);
procedure ValidateControls(FrmIsFocussed: Boolean = true);
procedure ValidateQueryControls(FrmIsFocussed: Boolean = true);
function FieldContent(ds: TDataSet; ColName: WideString): WideString;
@@ -3884,7 +3885,8 @@ begin
// Move focus to relevant controls in order for them to receive keyboard events.
// Do this only if the user clicked the new tab. Not on automatic tab changes.
if Sender = PageControlMain then begin
if tab = tabDatabase then ListTables.SetFocus
if tab = tabHost then PageControlHostChange(Sender)
else if tab = tabDatabase then ListTables.SetFocus
else if (tab = tabTable) and (ListColumns.Visible) then ListColumns.SetFocus
else if tab = tabData then begin
viewdata(Sender);
@@ -3898,6 +3900,22 @@ begin
end;
procedure TMainForm.PageControlHostChange(Sender: TObject);
var
tab: TTabSheet;
list: TBaseVirtualTree;
begin
tab := PageControlHost.ActivePage;
if tab = tabVariables then list := ListVariables
else if tab = tabStatus then list := ListStatus
else if tab = tabProcesslist then list := ListProcesses
else if tab = tabCommandStats then list := ListCommandStats
else Exit; // Silence compiler warning
list.SetFocus;
editFilterVTChange(Sender);
end;
{***
Ensures that we're connected to the currently selected database.
}