mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-25 16:29:10 +02:00
lcl: splitter: use default cursor if splitter isn't enabled
git-svn-id: trunk@51119 -
This commit is contained in:
parent
5022355897
commit
69da281d6c
@ -347,6 +347,8 @@ type
|
||||
procedure SetBeveled(const AValue: boolean);
|
||||
procedure SetMinSize(const AValue: integer);
|
||||
protected
|
||||
procedure CMEnabledChanged(var Message: TLMEssage); message CM_ENABLEDCHANGED;
|
||||
|
||||
class procedure WSRegisterClass; override;
|
||||
function AdaptAnchors(const a: TAnchors): TAnchors;
|
||||
function CheckNewSize(var NewSize: Integer): Boolean; virtual;
|
||||
@ -368,6 +370,7 @@ type
|
||||
procedure SetResizeControl(const AValue: TControl); virtual;
|
||||
procedure StartSplitterMove(const MouseXY: TPoint);
|
||||
procedure StopSplitterMove(const MouseXY: TPoint);
|
||||
procedure UpdateCursor; virtual;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
procedure AnchorSplitter(Kind: TAnchorKind; AControl: TControl);
|
||||
|
@ -516,10 +516,7 @@ procedure TCustomSplitter.SetResizeAnchor(const AValue: TAnchorKind);
|
||||
begin
|
||||
if FResizeAnchor = AValue then Exit;
|
||||
FResizeAnchor := AValue;
|
||||
if ResizeAnchor in [akLeft, akRight] then
|
||||
Cursor := crHSplit
|
||||
else
|
||||
Cursor := crVSplit;
|
||||
UpdateCursor;
|
||||
if not (csLoading in ComponentState) then
|
||||
begin
|
||||
Align := alNone;
|
||||
@ -597,6 +594,18 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomSplitter.UpdateCursor;
|
||||
begin
|
||||
if Enabled then
|
||||
begin
|
||||
if ResizeAnchor in [akLeft,akRight] then
|
||||
Cursor := crHSplit
|
||||
else
|
||||
Cursor := crVSplit;
|
||||
end else
|
||||
Cursor := crDefault;
|
||||
end;
|
||||
|
||||
procedure TCustomSplitter.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
|
||||
Y: Integer);
|
||||
var
|
||||
@ -773,10 +782,7 @@ begin
|
||||
try
|
||||
inherited SetAlign(Value);
|
||||
|
||||
if ResizeAnchor in [akLeft,akRight] then
|
||||
Cursor := crHSplit
|
||||
else
|
||||
Cursor := crVSplit;
|
||||
UpdateCursor;
|
||||
|
||||
Anchors:=AdaptAnchors(Anchors);
|
||||
|
||||
@ -836,6 +842,13 @@ begin
|
||||
OnCanOffset(Self, NewOffset, Result);
|
||||
end;
|
||||
|
||||
procedure TCustomSplitter.CMEnabledChanged(var Message: TLMEssage);
|
||||
begin
|
||||
inherited CMEnabledChanged(Message);
|
||||
|
||||
UpdateCursor;
|
||||
end;
|
||||
|
||||
procedure TCustomSplitter.Paint;
|
||||
procedure DrawThemedPattern(ARect: TRect);
|
||||
const
|
||||
@ -969,10 +982,7 @@ begin
|
||||
Align := alNone;
|
||||
FResizeAnchor := Kind;
|
||||
|
||||
if ResizeAnchor in [akLeft,akRight] then
|
||||
Cursor := crHSplit
|
||||
else
|
||||
Cursor := crVSplit;
|
||||
UpdateCursor;
|
||||
|
||||
case FResizeAnchor of
|
||||
akLeft: AnchorSplitterSides(akLeft, akRight, akTop, akBottom);
|
||||
|
Loading…
Reference in New Issue
Block a user