lcl: simplified Mouse.GetCursorPos + formatting

git-svn-id: trunk@22034 -
This commit is contained in:
paul 2009-10-05 03:17:37 +00:00
parent 3b842095b1
commit a3d64e981d
2 changed files with 10 additions and 12 deletions

View File

@ -2220,7 +2220,7 @@ type
function GetCapture: HWND;
function GetCursorPos: TPoint;
function GetIsDragging: Boolean;
procedure SetCursorPos(AValue : TPoint);
procedure SetCursorPos(AValue: TPoint);
function GetWheelScrollLines: Integer;
function GetDragImmediate: Boolean;
procedure SetDragImmediate(const AValue: Boolean);

View File

@ -34,28 +34,26 @@ begin
Result := FCapture;
end;
procedure TMouse.SetCapture(const Value : HWND);
procedure TMouse.SetCapture(const Value: HWND);
begin
{$IFDEF VerboseMouseCapture}
DebugLn('TMouse.SetCapture ');
{$ENDIF}
FCapture := Value;
if Value = 0 then ReleaseCapture else LCLIntf.SetCapture(Value);
if Value = 0 then
ReleaseCapture
else
LCLIntf.SetCapture(Value);
FCapture := GetCapture;
end;
function TMouse.GetCursorPos : TPoint;
var
p : TPoint;
function TMouse.GetCursorPos: TPoint;
begin
if WidgetSet.GetCursorPos(p) then
Result := P
else
Result:=Point(0,0);
if not WidgetSet.GetCursorPos(Result) then
Result := Point(0,0);
end;
procedure TMouse.SetCursorPos(AValue : TPoint);
procedure TMouse.SetCursorPos(AValue: TPoint);
begin
WidgetSet.SetCursorPos(AValue.X, AValue.Y);
end;