diff --git a/lcl/comctrls.pp b/lcl/comctrls.pp index db5a938baa..0760e7eddd 100644 --- a/lcl/comctrls.pp +++ b/lcl/comctrls.pp @@ -3661,6 +3661,7 @@ type FEndDragSectionIndex: longint; FSelectedSection: longint; FMouseInControl: Boolean; + FSavedCursor: TCursor; FOnSectionClick: TCustomSectionNotifyEvent; FOnSectionResize: TCustomSectionNotifyEvent; @@ -3677,6 +3678,7 @@ type protected function CreateSection: THeaderSection; virtual; function CreateSections: THeaderSections; virtual; + procedure Loaded; override; procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure SectionClick(Section: THeaderSection); virtual; procedure SectionResize(Section: THeaderSection); virtual; diff --git a/lcl/include/headercontrol.inc b/lcl/include/headercontrol.inc index 3b4b155db4..4bd45e9274 100644 --- a/lcl/include/headercontrol.inc +++ b/lcl/include/headercontrol.inc @@ -74,6 +74,15 @@ begin Result := THeaderSections.Create(Self); end; + + +procedure TCustomHeaderControl.Loaded; +begin + inherited Loaded; + FSavedCursor := Cursor; + //debugln('TCustomHeaderControl.Loaded: Setting FSavedCursor to ',DbgS(FSavedCursor)); +end; + constructor TCustomHeaderControl.Create(AOwner: TComponent); begin inherited Create(AOwner); @@ -177,6 +186,8 @@ begin inherited MouseEnter; if not (csDesigning in ComponentState) then begin + FSavedCursor := Cursor; + //debugln('TCustomHeaderControl.MouseEnter: setting FSavedCursor to ',dbgS(FSavedCursor)); FMouseInControl := True; UpdateState; end; @@ -267,7 +278,7 @@ begin (GetSectionAt(Point(X - HeaderBorderSize, Y))<>GetSectionAt(Point(X + HeaderBorderSize, Y))) then Cursor:=crSizeE else - Cursor:=crDefault; + Cursor:=FSavedCursor; UpdateState; end; end;