* Basic support for native hints

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@966 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blikblum
2009-09-27 15:17:11 +00:00
parent 0993f43699
commit fd94d08b05
2 changed files with 17 additions and 17 deletions

View File

@ -16157,8 +16157,6 @@ begin
begin begin
Result := 0; Result := 0;
ShowOwnHint := False; ShowOwnHint := False;
// Assign a dummy string otherwise the VCL will not show the hint window.
HintStr := ' ';
// First check whether there is a header hint to show. // First check whether there is a header hint to show.
if FHeader.UseColumns and (hoShowHint in FHeader.FOptions) and FHeader.InHeader(CursorPos) then if FHeader.UseColumns and (hoShowHint in FHeader.FOptions) and FHeader.InHeader(CursorPos) then
@ -16290,29 +16288,29 @@ begin
begin begin
// No node so fall back to control's hint (if indicated) or show nothing. // No node so fall back to control's hint (if indicated) or show nothing.
if FHintMode = hmHintAndDefault then if FHintMode = hmHintAndDefault then
begin HintStr := GetShortHint(Hint)
FHintData.DefaultHint := GetShortHint(Hint);
if Length(FHintData.DefaultHint) = 0 then
Result := 1
else
ShowOwnHint := True;
end
else else
Result := 1; Result := 1;
end; end;
end; end;
end; end;
// Set our own hint window class and prepare structure to be passed to the hint window. Logger.Send([lcHint], 'ShowOwnHint: %s Result: %d', [BoolToStr(ShowOwnHint, True), Result]);
Logger.Send([lcHint], 'CursorRect', CursorRect);
Logger.Send([lcHint], 'CursorPos', CursorPos);
Logger.Send([lcHint], 'HintMaxWidth', HintMaxWidth);
// If hint must be show and is not the control's hint then get the hint
// from the node or from the DefaultHint
if ShowOwnHint and (Result = 0) then if ShowOwnHint and (Result = 0) then
begin begin
HintWindowClass := GetHintWindowClass;
FHintData.Tree := Self;
FHintData.Column := HitInfo.HitColumn;
FHintData.Node := HitInfo.HitNode;
FLastHintRect := CursorRect; FLastHintRect := CursorRect;
HintData := @FHintData; if Length(FHintData.DefaultHint) > 0 then
HintStr := FHintData.DefaultHint
else
if FHintMode = hmToolTip then
HintStr := DoGetNodeToolTip(HitInfo.HitNode, HitInfo.HitColumn, FHintData.LineBreakStyle)
else
HintStr := DoGetNodeHint(HitInfo.HitNode, HitInfo.HitColumn, FHintData.LineBreakStyle);
end end
else else
FLastHintRect := Rect(0, 0, 0, 0); FLastHintRect := Rect(0, 0, 0, 0);
@ -17616,7 +17614,7 @@ begin
// get information about the hit // get information about the hit
GetHitTestInfoAt(Message.XPos, Message.YPos, True, HitInfo); GetHitTestInfoAt(Message.XPos, Message.YPos, True, HitInfo);
if HitInfo.HitNode <> nil then if HitInfo.HitNode <> nil then
Logger.Send([lcPaintHeader],'HitNode',HitInfo.HitNode^.Index); Logger.Send([lcPaintHeader, lcMouseEvent],'WMLButtonDown - HitNode.Index', HitInfo.HitNode^.Index);
HandleMouseDown(Message, HitInfo); HandleMouseDown(Message, HitInfo);
Logger.ExitMethod([lcMessages],'WMLButtonDown'); Logger.ExitMethod([lcMessages],'WMLButtonDown');
end; end;

View File

@ -37,6 +37,8 @@ const
lcHeaderOffset = 22; lcHeaderOffset = 22;
lcSelection = 23; lcSelection = 23;
lcAlphaBlend = 24; lcAlphaBlend = 24;
lcHint = 25;
lcMouseEvent = 26;
var var
Logger: TLCLLogger; Logger: TLCLLogger;