cocoa: cleanup and reformat some code

git-svn-id: trunk@34422 -
This commit is contained in:
paul 2011-12-26 11:28:08 +00:00
parent e0bf8626c8
commit 8b26db6fb9

View File

@ -1099,49 +1099,46 @@ type
function TCocoaWidgetSet.LineTo(DC: HDC; X, Y: Integer): Boolean; function TCocoaWidgetSet.LineTo(DC: HDC; X, Y: Integer): Boolean;
var var
ctx : TCocoaContext; ctx: TCocoaContext;
begin begin
ctx:=CheckDC(DC); ctx := CheckDC(DC);
Result:=Assigned(ctx); Result := Assigned(ctx);
if not Result then Exit; if Result then
ctx.LineTo(X, Y);
ctx.LineTo(x,y);
end; end;
function TCocoaWidgetSet.MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolean; function TCocoaWidgetSet.MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolean;
var var
ctx : TCocoaContext; ctx: TCocoaContext;
begin begin
ctx:=CheckDC(DC); ctx := CheckDC(DC);
Result:=Assigned(ctx); Result := Assigned(ctx);
if not Result then Exit; if Result then
begin
if Assigned(OldPoint) then OldPoint^:=ctx.PenPos; if Assigned(OldPoint) then
ctx.MoveTo(x,y); OldPoint^ := ctx.PenPos;
ctx.MoveTo(X, Y);
end;
end; end;
function TCocoaWidgetSet.Polygon(DC: HDC; Points: PPoint; NumPts: Integer; Winding: boolean): boolean; function TCocoaWidgetSet.Polygon(DC: HDC; Points: PPoint; NumPts: Integer; Winding: boolean): boolean;
var var
ctx : TCocoaContext; ctx: TCocoaContext;
begin begin
ctx:=CheckDC(DC); ctx := CheckDC(DC);
Result:=Assigned(ctx) and Assigned(Points) and (NumPts>=2); Result := Assigned(ctx) and Assigned(Points) and (NumPts >= 2);
if not Result then Exit; if Result then
ctx.Polygon(PPointArray(Points)^, NumPts, Winding);
ctx.Polygon(PPointArray(Points)^, NumPts, Winding);
Result:=True;
end; end;
function TCocoaWidgetSet.Polyline(DC: HDC; Points: PPoint; NumPts: Integer): boolean; function TCocoaWidgetSet.Polyline(DC: HDC; Points: PPoint; NumPts: Integer): boolean;
var var
ctx : TCocoaContext; ctx: TCocoaContext;
begin begin
ctx:=CheckDC(DC); ctx := CheckDC(DC);
Result:=Assigned(ctx) and Assigned(Points) and (NumPts>0); Result := Assigned(ctx) and Assigned(Points) and (NumPts > 0);
if not Result then Exit; if Result then
ctx.Polyline(PPointArray(Points)^, NumPts);
ctx.Polyline(PPointArray(Points)^, NumPts);
Result:=True;
end; end;
function TCocoaWidgetSet.PostMessage(Handle: HWND; Msg: Cardinal; function TCocoaWidgetSet.PostMessage(Handle: HWND; Msg: Cardinal;