diff --git a/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas b/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas index a78e11755..2f2a22ca7 100644 --- a/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas +++ b/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas @@ -293,6 +293,7 @@ type procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; function MouseOnCellBorder(const APoint: TPoint; const ACellRect: TGridRect): Boolean; + function MouseOnHeader(X, Y: Integer): Boolean; procedure MouseUp(Button: TMouseButton; Shift:TShiftState; X,Y:Integer); override; procedure MoveSelection; override; procedure Notification(AComponent: TComponent; Operation: TOperation); override; @@ -5031,6 +5032,9 @@ begin inherited; + if MouseOnHeader(X,Y) then + exit; + if FTextOverflow and ((prevMouseCell.X <> GCache.MouseCell.X) or (prevMouseCell.Y <> GCache.MouseCell.Y)) then @@ -5067,6 +5071,17 @@ begin Result := PtInRect(R1, APoint) and not PtInRect(R2, APoint); end; +function TsCustomWorksheetGrid.MouseOnHeader(X, Y: Integer): Boolean; +var + R: TRect; +begin + if FHeaderCount = 0 then + exit(false); + + R := CellRect(0, 0); + Result := (Y < R.Bottom) or (X < R.Right); +end; + procedure TsCustomWorksheetGrid.MouseUp(Button: TMouseButton; Shift:TShiftState; X,Y:Integer); begin