Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit uCursor;
- interface
- uses Controls, Forms;
- type
- TTmpCursor = class(TInterfacedObject, IInterface)
- private
- FCursor: TCursor;
- public
- constructor Create(const ACursor: TCursor);
- destructor Destroy; override;
- class function SetCursor(const ACursor: TCursor = crHourGlass): IInterface;
- end;
- implementation
- { TTmpCursor }
- constructor TTmpCursor.Create(const ACursor: TCursor);
- begin
- inherited Create();
- FCursor := Screen.Cursor;
- Screen.Cursor := ACursor;
- end;
- destructor TTmpCursor.Destroy;
- begin
- if Assigned(Screen) then
- Screen.Cursor := FCursor;
- inherited Destroy();
- end;
- class function TTmpCursor.SetCursor(const ACursor: TCursor): IInterface;
- begin
- Result := TTmpCursor.Create(ACursor);
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement