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:
@ -274,6 +274,7 @@ object frmTableEditor: TfrmTableEditor
|
|||||||
OnInitChildren = treeIndexesInitChildren
|
OnInitChildren = treeIndexesInitChildren
|
||||||
OnInitNode = treeIndexesInitNode
|
OnInitNode = treeIndexesInitNode
|
||||||
OnNewText = treeIndexesNewText
|
OnNewText = treeIndexesNewText
|
||||||
|
OnStructureChange = AnyTreeStructureChange
|
||||||
Columns = <
|
Columns = <
|
||||||
item
|
item
|
||||||
Options = [coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus]
|
Options = [coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus]
|
||||||
@ -428,6 +429,7 @@ object frmTableEditor: TfrmTableEditor
|
|||||||
OnGetText = listForeignKeysGetText
|
OnGetText = listForeignKeysGetText
|
||||||
OnGetImageIndex = listForeignKeysGetImageIndex
|
OnGetImageIndex = listForeignKeysGetImageIndex
|
||||||
OnNewText = listForeignKeysNewText
|
OnNewText = listForeignKeysNewText
|
||||||
|
OnStructureChange = AnyTreeStructureChange
|
||||||
Columns = <
|
Columns = <
|
||||||
item
|
item
|
||||||
Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus]
|
Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus]
|
||||||
|
@ -171,6 +171,8 @@ type
|
|||||||
procedure menuCopyColumnsClick(Sender: TObject);
|
procedure menuCopyColumnsClick(Sender: TObject);
|
||||||
procedure menuPasteColumnsClick(Sender: TObject);
|
procedure menuPasteColumnsClick(Sender: TObject);
|
||||||
procedure listColumnsChange(Sender: TBaseVirtualTree; Node: PVirtualNode);
|
procedure listColumnsChange(Sender: TBaseVirtualTree; Node: PVirtualNode);
|
||||||
|
procedure AnyTreeStructureChange(Sender: TBaseVirtualTree;
|
||||||
|
Node: PVirtualNode; Reason: TChangeReason);
|
||||||
private
|
private
|
||||||
{ Private declarations }
|
{ Private declarations }
|
||||||
FLoaded: Boolean;
|
FLoaded: Boolean;
|
||||||
@ -188,6 +190,7 @@ type
|
|||||||
procedure UpdateSQLcode;
|
procedure UpdateSQLcode;
|
||||||
function CellEditingAllowed(Node: PVirtualNode; Column: TColumnIndex): Boolean;
|
function CellEditingAllowed(Node: PVirtualNode; Column: TColumnIndex): Boolean;
|
||||||
procedure CalcMinColWidth;
|
procedure CalcMinColWidth;
|
||||||
|
procedure UpdateTabCaptions;
|
||||||
public
|
public
|
||||||
{ Public declarations }
|
{ Public declarations }
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
@ -362,6 +365,7 @@ begin
|
|||||||
btnHelp.Top := btnSave.Top;
|
btnHelp.Top := btnSave.Top;
|
||||||
btnDiscard.Top := btnSave.Top;
|
btnDiscard.Top := btnSave.Top;
|
||||||
UpdateSQLCode;
|
UpdateSQLCode;
|
||||||
|
UpdateTabCaptions;
|
||||||
CalcMinColWidth;
|
CalcMinColWidth;
|
||||||
// Indicate change mechanisms can call their events now. See Modification().
|
// Indicate change mechanisms can call their events now. See Modification().
|
||||||
FLoaded := True;
|
FLoaded := True;
|
||||||
@ -2553,4 +2557,19 @@ begin
|
|||||||
end;
|
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.
|
end.
|
||||||
|
Reference in New Issue
Block a user