Hi,
A fun Saturday morning puzzle so I did some googling and came up with the following.
In the examples folder that is installed with Lazarus you have: ...examples\cursors
See button 5 of this example. This button uses a custom cursor.
If you want to do that with your own cursor, you must first create a res file. You can find out how that works at:
https://wiki.freepascal.org/lazres
I looked for an cur file on my PC and then created a new res file with lazres by putting in a command window (I am a Windows user):
lazres person_l.res "D:\Development\Pascal\34\Forum\test_mouse_cursor \person_l.cur"
If you need a large cursor you search for a file. There are a lot of free cur files. (Or you can probably create one with a editor).
Place the created person_l.res file in your project folder.
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls;
// Add this ^^^^^^^^^^
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{$R person_l.res} // <<--------Add this
{ TForm1 }
procedure TForm1.Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
Cur: TCursorImage;
begin
Cur := TCursorImage.Create;
Cur.LoadFromResourceName(HInstance, 'person_l');
Screen.Cursors[1] := Cur.ReleaseHandle;
Cur.Free;
Button1.Cursor := 1;
end;
end.
So if you add a larger cursor as a resource, you can include it in your program.