mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-05 14:21:38 +02:00
Grids:
- propagate CellHint to Application.Hint, so it can be used in Application.OnHint - fix displaying CellHint if this has a "long hint". Fixes issue #0026957. git-svn-id: trunk@46760 -
This commit is contained in:
parent
b82866c190
commit
92df6c333e
@ -3632,7 +3632,7 @@ end;
|
|||||||
procedure TCustomGrid.ShowCellHintWindow(APoint: TPoint);
|
procedure TCustomGrid.ShowCellHintWindow(APoint: TPoint);
|
||||||
var
|
var
|
||||||
cell: TPoint;
|
cell: TPoint;
|
||||||
txt1, txt2, txt: String;
|
txt1, txt2, txt, AppHint: String;
|
||||||
w: Integer;
|
w: Integer;
|
||||||
gds: TGridDrawState;
|
gds: TGridDrawState;
|
||||||
begin
|
begin
|
||||||
@ -3641,7 +3641,10 @@ begin
|
|||||||
|
|
||||||
cell := MouseToCell(APoint);
|
cell := MouseToCell(APoint);
|
||||||
if (cell.x = -1) or (cell.y = -1) then
|
if (cell.x = -1) or (cell.y = -1) then
|
||||||
|
begin
|
||||||
|
Application.Hint := '';
|
||||||
exit;
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
txt := '';
|
txt := '';
|
||||||
txt1 := '';
|
txt1 := '';
|
||||||
@ -3667,6 +3670,7 @@ begin
|
|||||||
txt := txt2
|
txt := txt2
|
||||||
else
|
else
|
||||||
txt := txt1;
|
txt := txt1;
|
||||||
|
AppHint := txt;
|
||||||
end else begin
|
end else begin
|
||||||
if (txt1 <> '') and (txt2 <> '') then
|
if (txt1 <> '') and (txt2 <> '') then
|
||||||
txt := txt1 + #13 + txt2
|
txt := txt1 + #13 + txt2
|
||||||
@ -3674,14 +3678,19 @@ begin
|
|||||||
txt := txt1
|
txt := txt1
|
||||||
else if txt2 <> '' then
|
else if txt2 <> '' then
|
||||||
txt := txt2;
|
txt := txt2;
|
||||||
|
AppHint := txt;
|
||||||
if (FCellHintPriority = chpAll) and (txt <> '') then
|
if (FCellHintPriority = chpAll) and (txt <> '') then
|
||||||
txt := FSavedHint + #13 + txt;
|
txt := GetShortHint(FSavedHint) + #13 + txt;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
if (txt = '') and (FSavedHint <> '') then
|
if (txt = '') and (FSavedHint <> '') then
|
||||||
txt := FSavedHint;
|
txt := FSavedHint;
|
||||||
|
if (AppHint = '') then AppHint := FSavedhint;
|
||||||
if (txt <> '') and not EditorMode and not (csDesigning in ComponentState) then begin
|
if (txt <> '') and not EditorMode and not (csDesigning in ComponentState) then begin
|
||||||
Hint := txt;
|
Hint := txt;
|
||||||
|
//set Application.Hint as well (issue #0026957)
|
||||||
|
Application.Hint := AppHint;
|
||||||
Application.ActivateHint(APoint, true);
|
Application.ActivateHint(APoint, true);
|
||||||
end else
|
end else
|
||||||
HideCellHintWindow;
|
HideCellHintWindow;
|
||||||
@ -6172,6 +6181,8 @@ begin
|
|||||||
finally
|
finally
|
||||||
AllowOutboundEvents := obe;
|
AllowOutboundEvents := obe;
|
||||||
end;
|
end;
|
||||||
|
//if we are not over a cell, and we use cellhint, we need to empty Application.Hint
|
||||||
|
if (p.X < 0) and ([goCellHints, goTruncCellHints]*Options <> []) then Application.Hint := '';
|
||||||
with FGCache do
|
with FGCache do
|
||||||
if (MouseCell.X <> p.X) or (MouseCell.Y <> p.Y) then begin
|
if (MouseCell.X <> p.X) or (MouseCell.Y <> p.Y) then begin
|
||||||
Application.CancelHint;
|
Application.CancelHint;
|
||||||
|
Loading…
Reference in New Issue
Block a user