fpspreadsheet: Fix changing of WorksheetGrid column width/row height by dragging with the mouse.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5950 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2017-06-21 08:29:25 +00:00
parent 552f841d18
commit fbb376d778

View File

@ -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