unit Cursors;
interface

	const
		crCrossPlus		    = 1;
		crCrossMinus	    = 2;
		crHand				    = 3;
		crFigureCopy	    = 4;
		crArrowFrame	    = 5;
		crArrowFramePlus	= 6;
		crFigureSelect		= 7;
		crArrowVertex	    = 8;
		crFigureMove	    = 9;
		crVertex			    = 10;
		crVertexMove	    = 11;
    crArrowConnectionPoint = 12;
    crCrossArc        = 13;
    crCrossCurve      = 14;
    crCrossEllipse    = 15;
    crCrossLine       = 16;
    crCrossRect       = 17;
    crCrossStamp      = 18;
    crCrossText       = 19;
    crOrtoRotate      = 20;
    crRotateEx        = 21;
		crRotateCenter    = 22;
		crFindObject			= 23;

	function RegisterCursors(aCount: Integer): Integer;
	function RegisterResCursors(const aNames: array of PChar): Integer;

implementation

uses
	Forms, Controls, WinTypes, WinProcs;

{$R cursors.res}

var
	CursorsBase: Integer = 1;

function RegisterCursors(aCount: Integer): Integer;
begin
	Result := CursorsBase;
	Inc(CursorsBase, aCount);
end;

function RegisterResCursors(const aNames: array of PChar): Integer;
var
	i: Integer;
begin
	Result := CursorsBase;
	for i := Low(aNames) to High(aNames) do
		Screen.Cursors[CursorsBase + i] := LoadCursor(HInstance, aNames[i]);
	Inc(CursorsBase, High(aNames) - Low(aNames) + 1);
end;

initialization
	Screen.Cursors[crCross] := LoadCursor(HInstance, 'CR_CROSS');
	RegisterResCursors([
		'CR_CROSS_PLUS',
		'CR_CROSS_MINUS',
		'CR_HAND',
		'CR_FIGURE_COPY',
		'CR_ARROW_FRAME',
		'CR_ARROW_FRAME_PLUS',
		'CR_FIGURE_SELECT',
		'CR_ARROW_VERTEX',
		'CR_FIGURE_MOVE',
		'CR_VERTEX',
		'CR_VERTEX_MOVE',
		'CR_ARROW_CONNECTIONPOINT',
		'CR_CROSS_ARC',
		'CR_CROSS_CURVE',
		'CR_CROSS_ELLIPSE',
		'CR_CROSS_LINE',
		'CR_CROSS_RECT',
		'CR_CROSS_STAMP',
		'CR_CROSS_TEXT',
		'CR_ORTO_ROTATE',
		'CR_ROTATE_EX',
		'CR_ROTATE_CENTER',
		'FIND_OBJECT']);
end.
