End editing with home brown editors when the underlying tree scrolls, to avoid a misplaced cell editor. Fixes issue #1670.

This commit is contained in:
Ansgar Becker
2010-02-07 11:59:36 +00:00
parent 3195b25e8f
commit 788cbf565f
2 changed files with 13 additions and 0 deletions

View File

@ -2532,6 +2532,7 @@ begin
else
VT.TreeOptions.PaintOptions := VT.TreeOptions.PaintOptions - [toHotTrack];
VT.OnGetHint := MainForm.vstGetHint;
VT.OnScroll := MainForm.vstScroll;
VT.ShowHint := True;
VT.HintMode := hmToolTip;
// Apply case insensitive incremental search event

View File

@ -727,6 +727,7 @@ type
procedure SynMemoQueryPaintTransient(Sender: TObject; Canvas: TCanvas;
TransientType: TTransientType);
procedure actQueryFindAgainExecute(Sender: TObject);
procedure vstScroll(Sender: TBaseVirtualTree; DeltaX, DeltaY: Integer);
private
ReachedEOT: Boolean;
FDelimiter: String;
@ -9284,5 +9285,16 @@ begin
Result := '0x' + Results.BinColAsHex(Column);
end;
procedure TMainForm.vstScroll(Sender: TBaseVirtualTree; DeltaX, DeltaY: Integer);
begin
// A tree gets scrolled only when the mouse is over it - see FormMouseWheel
// Our home brewn cell editors do not reposition when the underlying tree scrolls.
// To avoid confusion, terminate editors then.
if Sender.IsEditing then
Sender.EndEditNode;
end;
end.