fpspreadsheet: TsWorksheetGrid - Fix text-overflown cells being erased when mouse leaves them.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3634 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2014-10-06 13:37:24 +00:00
parent 4dfa60673d
commit 2be57b3dd5

View File

@ -146,6 +146,7 @@ type
procedure KeyDown(var Key : Word; Shift : TShiftState); override;
procedure Loaded; override;
procedure LoadFromWorksheet(AWorksheet: TsWorksheet);
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
procedure MoveSelection; override;
procedure SelectEditor; override;
procedure SetEditText(ACol, ARow: Longint; const AValue: string); override;
@ -3006,6 +3007,25 @@ begin
);
end;
{@@ ----------------------------------------------------------------------------
Standard mouse move handler. Is overridden because, if TextOverflow is active,
overflown cell may be erased when the mouse leaves them; repaints entire
grid instead.
-------------------------------------------------------------------------------}
procedure TsCustomWorksheetGrid.MouseMove(Shift: TShiftState; X, Y: Integer);
var
R: TRect;
tmp: Integer;
prevMouseCell: TPoint;
begin
prevMouseCell := GCache.MouseCell;
inherited;
if FTextOverflow and
((prevMouseCell.X <> GCache.MouseCell.X) or (prevMouseCell.Y <> GCache.MouseCell.Y))
then
InvalidateGrid;
end;
{@@ ----------------------------------------------------------------------------
Standard method inherited from TCustomGrid.
Repaints the grid after moving selection to avoid spurious rests of the