Skip to content
Permalink
Browse files

Display help text for SQL function as tooltip hint in query helpers t…

…ree.
  • Loading branch information...
ansgarbecker committed Nov 4, 2019
1 parent 2b3b11c commit ffebc6d52bd2be95ca8c7109b794b16478a5349c
Showing with 26 additions and 7 deletions.
  1. +26 −7 source/main.pas
@@ -7785,18 +7785,37 @@ procedure TMainForm.AnyGridGetHint(Sender: TBaseVirtualTree; Node:
TVTTooltipLineBreakStyle; var HintText: String);
var
Tree: TVirtualStringTree;
NewHint: String;
begin
// Disable tooltips on Wine, as they prevent users from clicking + editing clipped cells
if not FIsWine then begin
Tree := TVirtualStringTree(Sender);
if FIsWine then
Exit;

Tree := TVirtualStringTree(Sender);

if Tree = ActiveQueryHelpers then begin
case Sender.GetNodeLevel(Node) of
1: case Node.Parent.Index of
HELPERNODE_FUNCTIONS: begin
NewHint := MySQLFunctions[Node.Index].Name + MySQLFunctions[Node.Index].Declaration +
':' + sLineBreak + MySQLFunctions[Node.Index].Description;
if not NewHint.IsEmpty then begin
HintText := NewHint;
end;
end;
end;
end;
end;

if HintText.IsEmpty then begin
HintText := Tree.Text[Node, Column];
HintText := sstr(HintText, SIZE_KB);
// See http://www.heidisql.com/forum.php?t=20458#p20548
if Sender = DBtree then
LineBreakStyle := hlbForceSingleLine
else
LineBreakStyle := hlbForceMultiLine;
end;
// See http://www.heidisql.com/forum.php?t=20458#p20548
if Sender = DBtree then
LineBreakStyle := hlbForceSingleLine
else
LineBreakStyle := hlbForceMultiLine;
end;


0 comments on commit ffebc6d

Please sign in to comment.
You can’t perform that action at this time.