THeaderControl: properly restore Cursor after we internally changed it. Issue #0026968.

git-svn-id: trunk@46748 -
This commit is contained in:
bart 2014-11-04 15:48:22 +00:00
parent a42df364db
commit dcb5b021b5
2 changed files with 14 additions and 1 deletions

View File

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

View File

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