mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-16 20:11:48 +08:00
Display focused row and column number of active grid in status bar
This commit is contained in:
@ -1248,6 +1248,7 @@ object MainForm: TMainForm
|
|||||||
OnEditing = DataGridEditing
|
OnEditing = DataGridEditing
|
||||||
OnEnter = ValidateControls
|
OnEnter = ValidateControls
|
||||||
OnExit = ValidateControls
|
OnExit = ValidateControls
|
||||||
|
OnFocusChanged = DataGridFocusChanged
|
||||||
OnFocusChanging = DataGridFocusChanging
|
OnFocusChanging = DataGridFocusChanging
|
||||||
OnGetText = AnyGridGetText
|
OnGetText = AnyGridGetText
|
||||||
OnPaintText = AnyGridPaintText
|
OnPaintText = AnyGridPaintText
|
||||||
|
@ -780,6 +780,7 @@ type
|
|||||||
procedure DatabaseChanged(Database: String);
|
procedure DatabaseChanged(Database: String);
|
||||||
function GetBlobContent(Results: TMySQLQuery; Column: Integer): String;
|
function GetBlobContent(Results: TMySQLQuery; Column: Integer): String;
|
||||||
procedure DoSearchReplace;
|
procedure DoSearchReplace;
|
||||||
|
procedure UpdateLineCharPanel;
|
||||||
public
|
public
|
||||||
Connection: TMySQLConnection;
|
Connection: TMySQLConnection;
|
||||||
SessionName: String;
|
SessionName: String;
|
||||||
@ -3873,9 +3874,7 @@ begin
|
|||||||
if QueryTabActive then RefreshQueryHelpers;
|
if QueryTabActive then RefreshQueryHelpers;
|
||||||
|
|
||||||
ValidateQueryControls(Sender);
|
ValidateQueryControls(Sender);
|
||||||
|
UpdateLineCharPanel;
|
||||||
if not QueryTabActive then // Empty panel with "Line:Char"
|
|
||||||
showstatus('', 1);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.RefreshQueryHelpers;
|
procedure TMainForm.RefreshQueryHelpers;
|
||||||
@ -4335,12 +4334,9 @@ end;
|
|||||||
|
|
||||||
procedure TMainForm.SynMemoQueryStatusChange(Sender: TObject; Changes:
|
procedure TMainForm.SynMemoQueryStatusChange(Sender: TObject; Changes:
|
||||||
TSynStatusChanges);
|
TSynStatusChanges);
|
||||||
var
|
|
||||||
sm: TSynMemo;
|
|
||||||
begin
|
begin
|
||||||
sm := Sender as TSynMemo;
|
|
||||||
ValidateQueryControls(Sender);
|
ValidateQueryControls(Sender);
|
||||||
showstatus(FormatNumber(sm.CaretY)+' : '+FormatNumber(sm.CaretX), 1);
|
UpdateLineCharPanel;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -6924,6 +6920,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.DataGridFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode;
|
||||||
|
Column: TColumnIndex);
|
||||||
|
begin
|
||||||
|
UpdateLineCharPanel;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{**
|
{**
|
||||||
DataGrid: invoke update or insert routine
|
DataGrid: invoke update or insert routine
|
||||||
}
|
}
|
||||||
@ -9187,5 +9190,28 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.UpdateLineCharPanel;
|
||||||
|
var
|
||||||
|
x, y: Int64;
|
||||||
|
Grid: TVirtualStringTree;
|
||||||
|
begin
|
||||||
|
// Fill panel with "Line:Char"
|
||||||
|
x := -1;
|
||||||
|
y := -1;
|
||||||
|
Grid := ActiveGrid;
|
||||||
|
if Assigned(Grid) and Grid.Focused then begin
|
||||||
|
if Assigned(Grid.FocusedNode) then
|
||||||
|
y := Grid.FocusedNode.Index+1;
|
||||||
|
x := Grid.FocusedColumn+1;
|
||||||
|
end else if QueryTabActive and ActiveQueryMemo.Focused then begin
|
||||||
|
x := ActiveQueryMemo.CaretX;
|
||||||
|
y := ActiveQueryMemo.CaretY;
|
||||||
|
end;
|
||||||
|
if (x > -1) and (y > -1) then
|
||||||
|
ShowStatus(FormatNumber(y)+' : '+FormatNumber(x), 1)
|
||||||
|
else
|
||||||
|
ShowStatus('', 1);
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user