mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-01 02:50:48 +02:00
LCL: move crScreenCursor to a private const of TScreen so that it isn't used elsewhere
This commit is contained in:
parent
d13c67e680
commit
89162e9c1c
@ -235,7 +235,6 @@ const
|
||||
crSizeAll = TCursor(-22);
|
||||
|
||||
crLow = TCursor(-30);
|
||||
crScreenCursor= Low(TCursor); // use only with Screen.BeginTempCursor/EndTempCursor to force Screen.Cursor
|
||||
|
||||
type
|
||||
TCaptureMouseButtons = set of TMouseButton;
|
||||
|
@ -1055,6 +1055,8 @@ type
|
||||
{ TScreen }
|
||||
|
||||
TScreen = class(TLCLComponent)
|
||||
private const
|
||||
crScreen = Low(TCursor); // use with Screen.BeginTempCursor/EndTempCursor to add Screen.Cursor into the temp list
|
||||
private
|
||||
FActiveControl: TWinControl;
|
||||
FActiveCustomForm: TCustomForm;
|
||||
@ -1186,6 +1188,8 @@ type
|
||||
procedure EndTempCursor(const aCursor: TCursor);
|
||||
procedure BeginWaitCursor;
|
||||
procedure EndWaitCursor;
|
||||
procedure BeginScreenCursor;
|
||||
procedure EndScreenCursor;
|
||||
public
|
||||
property ActiveControl: TWinControl read FActiveControl;
|
||||
property ActiveCustomForm: TCustomForm read FActiveCustomForm;
|
||||
|
@ -2948,7 +2948,7 @@ begin
|
||||
Screen.FSaveFocusedList.Insert(0, Screen.FFocusedForm);
|
||||
Screen.FFocusedForm := Self;
|
||||
Screen.MoveFormToFocusFront(Self);
|
||||
Screen.BeginTempCursor(crScreenCursor);
|
||||
Screen.BeginScreenCursor;
|
||||
ModalResult := 0;
|
||||
|
||||
try
|
||||
@ -3006,7 +3006,7 @@ begin
|
||||
end;
|
||||
finally
|
||||
RestoreFocusState(SavedFocusState);
|
||||
Screen.EndTempCursor(crScreenCursor);
|
||||
Screen.EndScreenCursor;
|
||||
if LCLIntf.IsWindow(ActiveWindow) then
|
||||
SetActiveWindow(ActiveWindow);
|
||||
Exclude(FFormState, fsModal);
|
||||
|
@ -295,6 +295,11 @@ begin
|
||||
AddHandler(snRemoveForm,TMethod(OnRemoveForm),AsFirst);
|
||||
end;
|
||||
|
||||
procedure TScreen.BeginScreenCursor;
|
||||
begin
|
||||
BeginTempCursor(crScreen);
|
||||
end;
|
||||
|
||||
procedure TScreen.BeginTempCursor(const aCursor: TCursor);
|
||||
var
|
||||
OldCursor: TCursor;
|
||||
@ -425,6 +430,11 @@ begin
|
||||
FreeAndNil(AFormList);
|
||||
end;
|
||||
|
||||
procedure TScreen.EndScreenCursor;
|
||||
begin
|
||||
EndTempCursor(crScreen);
|
||||
end;
|
||||
|
||||
procedure TScreen.EndTempCursor(const aCursor: TCursor);
|
||||
procedure _Delete(const _Index: Integer); // FPC 3.0.x doesn't support Delete() for arrays #36728
|
||||
var
|
||||
@ -857,12 +867,12 @@ end;
|
||||
|
||||
function TScreen.GetRealCursor: TCursor;
|
||||
begin
|
||||
if (Length(FTempCursors)>0) and (FTempCursors[High(FTempCursors)]<>crScreenCursor) then
|
||||
if (Length(FTempCursors)>0) and (FTempCursors[High(FTempCursors)]<>crScreen) then
|
||||
Result := FTempCursors[High(FTempCursors)]
|
||||
else
|
||||
if Cursor<>crScreenCursor then
|
||||
if Cursor<>crScreen then
|
||||
Result := Cursor
|
||||
else // Screen.Cursor=crScreenCursor - we have to use crDefault because crScreenCursor is otherwise invalid
|
||||
else // Screen.Cursor=crScreen - we have to use crDefault because crScreen is otherwise invalid
|
||||
Result := crDefault;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user