mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Display number of indexes and foreign keys in caption of their tabs within the table editor. Helpful for knowing the number without having to activate their tab.
This commit is contained in:
@ -171,6 +171,8 @@ type
|
||||
procedure menuCopyColumnsClick(Sender: TObject);
|
||||
procedure menuPasteColumnsClick(Sender: TObject);
|
||||
procedure listColumnsChange(Sender: TBaseVirtualTree; Node: PVirtualNode);
|
||||
procedure AnyTreeStructureChange(Sender: TBaseVirtualTree;
|
||||
Node: PVirtualNode; Reason: TChangeReason);
|
||||
private
|
||||
{ Private declarations }
|
||||
FLoaded: Boolean;
|
||||
@ -188,6 +190,7 @@ type
|
||||
procedure UpdateSQLcode;
|
||||
function CellEditingAllowed(Node: PVirtualNode; Column: TColumnIndex): Boolean;
|
||||
procedure CalcMinColWidth;
|
||||
procedure UpdateTabCaptions;
|
||||
public
|
||||
{ Public declarations }
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
@ -362,6 +365,7 @@ begin
|
||||
btnHelp.Top := btnSave.Top;
|
||||
btnDiscard.Top := btnSave.Top;
|
||||
UpdateSQLCode;
|
||||
UpdateTabCaptions;
|
||||
CalcMinColWidth;
|
||||
// Indicate change mechanisms can call their events now. See Modification().
|
||||
FLoaded := True;
|
||||
@ -2553,4 +2557,19 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmTableEditor.AnyTreeStructureChange(Sender: TBaseVirtualTree;
|
||||
Node: PVirtualNode; Reason: TChangeReason);
|
||||
begin
|
||||
UpdateTabCaptions;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmTableEditor.UpdateTabCaptions;
|
||||
begin
|
||||
// Append number of listed keys (or whatever) to the tab caption
|
||||
tabIndexes.Caption := _('Indexes') + ' (' + FKeys.Count.ToString + ')';
|
||||
tabForeignKeys.Caption := _('Foreign keys') + ' (' + FForeignKeys.Count.ToString + ')';
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
Reference in New Issue
Block a user