SRL Archive - Suggestions

getMousePos()


Nava2

2010-03-16 17:21:25

Small thing, but perhaps we could set it up to:

function getMousePos(out x, y: Integer): TPoint
OR
function getMousePos(): TPoint;
procedure getMousePos(out x, y: Integer);

Or someway to return it as a TPoint easily? I've found many times while using TPointArrays when I wanted a TPoint, but had to write it out otherwise, making it slightly tedious.

I'd do this myself, but I don't fully follow the IOManager code.

Wizzup?

2010-03-16 17:24:35

And thus break any existing Linux compatibility?

Nava2

2010-03-16 17:29:01

Why does it break Linux compatibility?

I would hope that TPoints are supported on Linux.. or is it the overloading?

mixster

2010-03-16 18:47:09

GetMousePt (Point) as a second/wrapper function?

Nava2

2010-03-16 19:10:52

Sure, that would work too. Or Ex?

Wanted

2010-03-16 19:19:35

What's wrong with

GetMousPos(P.X, P.Y); ????

Gu3st...

2010-03-17 07:40:49

From: IceFire908
What's wrong with

GetMousPos(P.X, P.Y); ????
Lol I though exactly the same :p

Nava2

2010-03-17 07:59:45

Silly, and annoying.

Wizzup?

2010-03-17 08:08:18

From: IceFire908
What's wrong with

GetMousPos(P.X, P.Y); ????


Nothing, IMO.

Wanted

2010-03-17 13:50:23

From: Nava2
Silly, and annoying.


waahhhh

Ok let's think about this for a minute.

It's more scalable to have it set the variable for each.. that way you don't have to go and have extra variables etc… if you're not using a TPoint or only need one of them.

ffs… just make your own code wrapper?

function GetMousePoint: TPoint;
begin
GetMousePos(Result.X, Result.Y);
end;