mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 11:19:26 +02:00
fixed Arc and changed x,y to Left,Top to make meaning more clear
git-svn-id: trunk@6889 -
This commit is contained in:
parent
db7d0e2fc6
commit
daf76f7dbc
@ -1013,8 +1013,8 @@ type
|
||||
procedure Changed; virtual;
|
||||
|
||||
// extra drawing methods (there are more in the ancestor TFPCustomCanvas)
|
||||
procedure Arc(x, y, AWidth, AHeight, angle1, angle2: Integer); virtual;
|
||||
procedure Arc(x, y, AWidth, AHeight, SX, SY, EX, EY: Integer); virtual;
|
||||
procedure Arc(Left, Top, AWidth, AHeight, angle1, angle2: Integer); virtual;
|
||||
procedure Arc(Left, Top, AWidth, AHeight, SX, SY, EX, EY: Integer); virtual;
|
||||
Procedure BrushCopy(Dest: TRect; InternalImages: TBitmap; Src: TRect;
|
||||
TransparentColor: TColor); virtual;
|
||||
procedure Chord(x, y, AWidth, AHeight,
|
||||
@ -1951,6 +1951,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.174 2005/03/04 13:50:08 mattias
|
||||
fixed Arc and changed x,y to Left,Top to make meaning more clear
|
||||
|
||||
Revision 1.173 2005/02/25 20:29:55 mattias
|
||||
FPCanvas is now used as default
|
||||
|
||||
|
@ -382,10 +382,10 @@ var
|
||||
w: Integer;
|
||||
h: Integer;
|
||||
begin
|
||||
x:=(Bounds.Left+Bounds.Right) div 2;
|
||||
y:=(Bounds.Top+Bounds.Bottom) div 2;
|
||||
w:=Abs(Bounds.Right-Bounds.Left) div 2;
|
||||
h:=Abs(Bounds.Bottom-Bounds.Top) div 2;
|
||||
if Bounds.Left<Bounds.Right then x:=Bounds.Left else x:=Bounds.Right;
|
||||
if Bounds.Top<Bounds.Bottom then y:=Bounds.Top else y:=Bounds.Bottom;
|
||||
w:=Abs(Bounds.Right-Bounds.Left);
|
||||
h:=Abs(Bounds.Bottom-Bounds.Top);
|
||||
Arc(x,y,w,h,0,360*16);
|
||||
end;
|
||||
|
||||
@ -501,7 +501,7 @@ end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCanvas.Arc
|
||||
Params: x,y,AWidth,AHeight,angle1,angle2
|
||||
Params: Left,Top,AWidth,AHeight,angle1,angle2
|
||||
Returns: Nothing
|
||||
|
||||
Use Arc to draw an elliptically curved line with the current Pen.
|
||||
@ -511,17 +511,17 @@ end;
|
||||
Zero degrees is at the 3'o clock position.
|
||||
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCanvas.Arc(x,y,AWidth,AHeight,angle1,angle2 : Integer);
|
||||
procedure TCanvas.Arc(Left,Top,AWidth,AHeight,angle1,angle2 : Integer);
|
||||
begin
|
||||
Changing;
|
||||
RequiredState([csHandleValid, csPenValid]);
|
||||
LCLIntf.Arc(FHandle,x,y,AWidth,AHeight,angle1,angle2);
|
||||
LCLIntf.Arc(FHandle,Left,Top,AWidth,AHeight,angle1,angle2);
|
||||
Changed;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCanvas.Arc
|
||||
Params: DC,x,y,AWidth,AHeight,sx,sy,ex,ey
|
||||
Params: DC,Left,Top,AWidth,AHeight,sx,sy,ex,ey
|
||||
Returns: Nothing
|
||||
|
||||
Use Arc to draw an elliptically curved line with the current Pen. The
|
||||
@ -529,11 +529,11 @@ end;
|
||||
between which the Arc is drawn.
|
||||
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCanvas.Arc(x,y,AWidth,AHeight,sx,sy,ex,ey : Integer);
|
||||
procedure TCanvas.Arc(Left,Top,AWidth,AHeight,sx,sy,ex,ey : Integer);
|
||||
begin
|
||||
Changing;
|
||||
RequiredState([csHandleValid, csBrushValid, csPenValid]);
|
||||
LCLIntf.RadialArc(FHandle,x,y,AWidth,AHeight,sx,sy,ex,ey);
|
||||
LCLIntf.RadialArc(FHandle,Left,Top,AWidth,AHeight,sx,sy,ex,ey);
|
||||
Changed;
|
||||
end;
|
||||
|
||||
@ -1535,6 +1535,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.91 2005/03/04 13:50:08 mattias
|
||||
fixed Arc and changed x,y to Left,Top to make meaning more clear
|
||||
|
||||
Revision 1.90 2005/02/04 01:04:40 mattias
|
||||
fixed gtk intf Arc
|
||||
|
||||
|
@ -1158,14 +1158,19 @@ end;
|
||||
TCustomForm SetFormStyle
|
||||
------------------------------------------------------------------------------}
|
||||
Procedure TCustomForm.SetFormStyle(Value : TFormStyle);
|
||||
var
|
||||
OldFormStyle: TFormStyle;
|
||||
Begin
|
||||
if FFormStyle = Value then exit;
|
||||
if (Value in [fsMDIChild, fsMDIForm]) then
|
||||
raise Exception.Create('TCustomForm.SetFormStyle MDI forms are not implemented yet');
|
||||
OldFormStyle:=FFormStyle;
|
||||
FFormStyle := Value;
|
||||
Include(FFormState,fsFormStyleChanged);
|
||||
if FFormStyle=fsSplash then begin
|
||||
BorderStyle:=bsNone;
|
||||
end else if OldFormStyle=fsSplash then begin
|
||||
BorderStyle:=bsSizeable;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1892,6 +1897,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.178 2005/03/04 13:50:08 mattias
|
||||
fixed Arc and changed x,y to Left,Top to make meaning more clear
|
||||
|
||||
Revision 1.177 2005/02/05 13:33:05 mattias
|
||||
implemented gtkwidgetset.IsWindowEnabled
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
//##apiwiz##sps## // Do not remove
|
||||
|
||||
function TWidgetSet.Arc(DC: HDC;
|
||||
x,y,width,height,angle1,angle2 : Integer): Boolean;
|
||||
Left,Top,width,height,angle1,angle2 : Integer): Boolean;
|
||||
var
|
||||
Points : PPoint;
|
||||
Count : Longint;
|
||||
@ -36,7 +36,7 @@ begin
|
||||
Result := False;
|
||||
Points := nil;
|
||||
Count := 0;
|
||||
PolyBezierArcPoints(X,Y,Width,Height,Angle1, Angle2, 0, Points, Count);
|
||||
PolyBezierArcPoints(Left,Top,Width,Height,Angle1, Angle2, 0, Points, Count);
|
||||
Polygon(DC, Points, Count, False);
|
||||
ReallocMem(Points, 0);
|
||||
Result := True;
|
||||
@ -1178,6 +1178,7 @@ begin
|
||||
|
||||
Pen := SelectObject(DC, GetStockObject(NULL_PEN));
|
||||
|
||||
//debugln('TWidgetSet.RoundRect ',dbgs(Rect(X1,Y1,X2,Y2)),' ',dbgs(Point(RX,RY)));
|
||||
RadialPieWithAngles(DC, X1, Y1, RX, RY, 90*16,90*16);
|
||||
RadialPieWithAngles(DC, X2 - RX, Y1, RX, RY, 0, 90*16);
|
||||
RadialPieWithAngles(DC, X1, Y2 - RY, RX, RY, 180*16,90*16);
|
||||
@ -1425,6 +1426,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.21 2005/03/04 13:50:09 mattias
|
||||
fixed Arc and changed x,y to Left,Top to make meaning more clear
|
||||
|
||||
Revision 1.20 2005/02/23 01:15:56 marc
|
||||
+ Added RemoveProp winapi call
|
||||
|
||||
|
@ -33,9 +33,9 @@
|
||||
******************************************************************************}
|
||||
//##apiwiz##sps## // Do not remove
|
||||
|
||||
function Arc(DC: HDC; x,y,width,height,angle1,angle2 : Integer): Boolean;
|
||||
function Arc(DC: HDC; Left,Top,width,height,angle1,angle2 : Integer): Boolean;
|
||||
begin
|
||||
Result := InterfaceObject.Arc(DC,x,y,width,height,angle1,angle2);
|
||||
Result := InterfaceObject.Arc(DC,Left,Top,width,height,angle1,angle2);
|
||||
end;
|
||||
|
||||
function AngleChord(DC: HDC; x,y,width,height,angle1,angle2 : Integer): Boolean;
|
||||
@ -1335,6 +1335,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.120 2005/03/04 13:50:09 mattias
|
||||
fixed Arc and changed x,y to Left,Top to make meaning more clear
|
||||
|
||||
Revision 1.119 2005/02/23 01:15:56 marc
|
||||
+ Added RemoveProp winapi call
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
******************************************************************************}
|
||||
//##apiwiz##sps## // Do not remove
|
||||
|
||||
function Arc(DC: HDC; x,y,width,height,angle1,angle2 : Integer): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||
function Arc(DC: HDC; Left,Top,width,height,angle1,angle2 : Integer): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||
function AngleChord(DC: HDC; x,y,width,height,angle1,angle2 : Integer): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||
|
||||
Function BeginPaint(Handle : hwnd; var PS : TPaintStruct): hdc; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||
@ -301,6 +301,9 @@ function RGB(R, G, B : Byte) : TColorRef;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.107 2005/03/04 13:50:09 mattias
|
||||
fixed Arc and changed x,y to Left,Top to make meaning more clear
|
||||
|
||||
Revision 1.106 2005/02/23 01:15:56 marc
|
||||
+ Added RemoveProp winapi call
|
||||
|
||||
|
@ -28,10 +28,10 @@
|
||||
|
||||
//##apiwiz##sps## // Do not remove
|
||||
|
||||
function TCarbonWidgetSet.Arc(DC: HDC; x, y, width, height, angle1,
|
||||
function TCarbonWidgetSet.Arc(DC: HDC; Left,Top, width, height, angle1,
|
||||
angle2: Integer): Boolean;
|
||||
begin
|
||||
Result:=inherited Arc(DC, x, y, width, height, angle1, angle2);
|
||||
Result:=inherited Arc(DC, Left,Top, width, height, angle1, angle2);
|
||||
end;
|
||||
|
||||
function TCarbonWidgetSet.AngleChord(DC: HDC; x, y, width, height, angle1,
|
||||
@ -926,6 +926,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.3 2005/03/04 13:50:09 mattias
|
||||
fixed Arc and changed x,y to Left,Top to make meaning more clear
|
||||
|
||||
Revision 1.2 2005/02/23 01:12:46 marc
|
||||
+ Added RemoveProp winapi call
|
||||
* Some maintenace on winapi/lclintf files
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
//##apiwiz##sps## // Do not remove
|
||||
|
||||
function Arc(DC: HDC; x,y,width,height,angle1,angle2 : Integer): Boolean; override;
|
||||
function Arc(DC: HDC; Left,Top,width,height,angle1,angle2 : Integer): Boolean; override;
|
||||
function AngleChord(DC: HDC; x,y,width,height,angle1,angle2 : Integer): Boolean; override;
|
||||
|
||||
function BeginPaint(Handle: hWnd; Var PS : TPaintStruct) : hdc; override;
|
||||
@ -215,6 +215,9 @@ function WindowFromPoint(Point : TPoint) : HWND; override;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.3 2005/03/04 13:50:09 mattias
|
||||
fixed Arc and changed x,y to Left,Top to make meaning more clear
|
||||
|
||||
Revision 1.2 2005/02/23 01:12:46 marc
|
||||
+ Added RemoveProp winapi call
|
||||
* Some maintenace on winapi/lclintf files
|
||||
|
@ -51,7 +51,7 @@ const
|
||||
|
||||
------------------------------------------------------------------------------}
|
||||
function TGtkWidgetSet.Arc(DC: HDC;
|
||||
x,y,width,height,angle1,angle2 : Integer): Boolean;
|
||||
Left,Top,width,height,angle1,angle2 : Integer): Boolean;
|
||||
var
|
||||
DCOrigin: TPoint;
|
||||
begin
|
||||
@ -73,10 +73,10 @@ begin
|
||||
if (CurrentPen^.IsNullPen) then exit;
|
||||
|
||||
DCOrigin:=GetDCOffset(TDeviceContext(DC));
|
||||
inc(X,DCOrigin.X);
|
||||
inc(Y,DCOrigin.Y);
|
||||
inc(Left,DCOrigin.X);
|
||||
inc(Top,DCOrigin.Y);
|
||||
{$IFDEF DebugGDKTraps}BeginGDKErrorTrap;{$ENDIF}
|
||||
gdk_draw_arc(Drawable, GC, 0, X-Width, Y-Height, 2*Width, 2*Height,
|
||||
gdk_draw_arc(Drawable, GC, 0, Left,Top,Width,Height,
|
||||
Angle1 shl 2, Angle2 shl 2);
|
||||
{$IFDEF DebugGDKTraps}EndGDKErrorTrap;{$ENDIF}
|
||||
end else
|
||||
@ -8937,6 +8937,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.404 2005/03/04 13:50:09 mattias
|
||||
fixed Arc and changed x,y to Left,Top to make meaning more clear
|
||||
|
||||
Revision 1.403 2005/03/04 12:21:56 mattias
|
||||
fixed TShape FPCanvas issue
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
//##apiwiz##sps## // Do not remove
|
||||
|
||||
function Arc(DC: HDC; x,y,width,height,angle1,angle2 : Integer): Boolean; override;
|
||||
function Arc(DC: HDC; Left,Top,width,height,angle1,angle2 : Integer): Boolean; override;
|
||||
function AngleChord(DC: HDC; x,y,width,height,angle1,angle2 : Integer): Boolean; override;
|
||||
|
||||
function BeginPaint(Handle: hWnd; Var PS : TPaintStruct) : hdc; override;
|
||||
@ -217,6 +217,9 @@ Function WindowFromPoint(Point : TPoint) : HWND; override;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.96 2005/03/04 13:50:09 mattias
|
||||
fixed Arc and changed x,y to Left,Top to make meaning more clear
|
||||
|
||||
Revision 1.95 2005/02/23 01:12:47 marc
|
||||
+ Added RemoveProp winapi call
|
||||
* Some maintenace on winapi/lclintf files
|
||||
|
@ -56,12 +56,12 @@ Const
|
||||
counter-clockwise while negative values mean clockwise direction.
|
||||
Zero degrees is at the 3'o clock position.
|
||||
------------------------------------------------------------------------------}
|
||||
Function TWin32WidgetSet.Arc(DC: HDC; X, Y, Width, Height, Angle1, Angle2: Integer): Boolean;
|
||||
Function TWin32WidgetSet.Arc(DC: HDC; Left,Top, Width, Height, Angle1, Angle2: Integer): Boolean;
|
||||
var
|
||||
SX, SY, EX, EY : Longint;
|
||||
Begin
|
||||
Angles2Coords(X, Y, Width, Height, Angle1, Angle2, SX, SY, EX, EY);
|
||||
Result := Boolean(Windows.Arc(DC, X, Y, X+Width, Y+Height, SX, SY, EX, EY));
|
||||
Angles2Coords(Left,Top, Width, Height, Angle1, Angle2, SX, SY, EX, EY);
|
||||
Result := Boolean(Windows.Arc(DC, Left,Top, Left+Width, Top+Height, SX, SY, EX, EY));
|
||||
End;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -3093,6 +3093,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.138 2005/03/04 13:50:09 mattias
|
||||
fixed Arc and changed x,y to Left,Top to make meaning more clear
|
||||
|
||||
Revision 1.137 2005/02/23 01:12:47 marc
|
||||
+ Added RemoveProp winapi call
|
||||
* Some maintenace on winapi/lclintf files
|
||||
|
@ -22,7 +22,7 @@
|
||||
}
|
||||
//##apiwiz##sps## // Do not remove
|
||||
|
||||
Function Arc(DC: HDC; X, Y, Width, Height, Angle1, Angle2: Integer): Boolean; Override;
|
||||
Function Arc(DC: HDC; Left,Top, Width, Height, Angle1, Angle2: Integer): Boolean; Override;
|
||||
function AngleChord(DC: HDC; x,y,width,height,angle1,angle2 : Integer): Boolean; override;
|
||||
|
||||
Function BeginPaint(Handle : hwnd; var PS : TPaintStruct): hdc; Override;
|
||||
@ -196,6 +196,9 @@ Procedure DeleteCriticalSection(var CritSection: TCriticalSection); Override;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.55 2005/03/04 13:50:09 mattias
|
||||
fixed Arc and changed x,y to Left,Top to make meaning more clear
|
||||
|
||||
Revision 1.54 2005/02/23 01:12:47 marc
|
||||
+ Added RemoveProp winapi call
|
||||
* Some maintenace on winapi/lclintf files
|
||||
|
@ -129,8 +129,8 @@ Type
|
||||
Winding: boolean{$IFNDEF VER1_0}=False{$ENDIF}); override;
|
||||
|
||||
procedure Ellipse(x1, y1, x2, y2: Integer); override;
|
||||
procedure Arc(x,y,AWidth,AHeight,angle1,angle2: Integer); override;
|
||||
procedure RadialPie(x,y,AWidth,AHeight,angle1,angle2: Integer); override;
|
||||
procedure Arc(Left,Top,AWidth,AHeight,angle1,angle2: Integer); override;
|
||||
procedure RadialPie(Left,Top,AWidth,AHeight,angle1,angle2: Integer); override;
|
||||
procedure Chord(x, y, AWidth, AHeight, angle1, angle2: Integer); override;
|
||||
|
||||
procedure TextOut(X,Y: Integer; const Text: String); override;
|
||||
@ -1594,7 +1594,7 @@ begin
|
||||
end;
|
||||
|
||||
//Draw an Arc
|
||||
procedure TPostscriptPrinterCanvas.Arc(x, y, AWidth, AHeight, angle1,
|
||||
procedure TPostscriptPrinterCanvas.Arc(Left,Top,AWidth,AHeight, angle1,
|
||||
angle2: Integer);
|
||||
var xScale : Real;
|
||||
yScale : Real;
|
||||
@ -1606,12 +1606,11 @@ begin
|
||||
Changing;
|
||||
RequiredState([csHandleValid, csBrushValid, csPenValid]);
|
||||
|
||||
writecomment(Format('Arc(%d,%d,%d,%d,%d,%d)',[x,y,AWidth,AHeight,Angle1,Angle2]));
|
||||
TranslateCoord(X,Y);
|
||||
TranslateCoord(Left,Top);
|
||||
|
||||
//calculate centre of ellipse
|
||||
cx:=x;
|
||||
cy:=y;
|
||||
cx:=Left;
|
||||
cy:=Top;
|
||||
rx:=AWidth;
|
||||
ry:=AHeight;
|
||||
|
||||
@ -1645,7 +1644,7 @@ begin
|
||||
Changed;
|
||||
end;
|
||||
|
||||
procedure TPostscriptPrinterCanvas.RadialPie(x, y, AWidth, AHeight, angle1,
|
||||
procedure TPostscriptPrinterCanvas.RadialPie(Left,Top, AWidth, AHeight, angle1,
|
||||
angle2: Integer);
|
||||
var xScale : Real;
|
||||
yScale : Real;
|
||||
@ -1657,12 +1656,12 @@ begin
|
||||
Changing;
|
||||
RequiredState([csHandleValid, csBrushValid, csPenValid]);
|
||||
|
||||
writecomment(Format('RadialPie(%d,%d,%d,%d,%d,%d)',[x,y,AWidth,AHeight,Angle1,Angle2]));
|
||||
TranslateCoord(X,Y);
|
||||
writecomment(Format('RadialPie(%d,%d,%d,%d,%d,%d)',[Left,Top,AWidth,AHeight,Angle1,Angle2]));
|
||||
TranslateCoord(Left,Top);
|
||||
|
||||
//calculate centre of ellipse
|
||||
cx:=x;
|
||||
cy:=y;
|
||||
cx:=Left;
|
||||
cy:=Top;
|
||||
rx:=AWidth;
|
||||
ry:=AHeight;
|
||||
|
||||
@ -1683,7 +1682,7 @@ begin
|
||||
ClearBuffer;
|
||||
writeB(Format('%.3f %.3f moveto',[cX+(rX*Cos((Angle1/16)*-1)),cY+(rY*Sin((Angle1/16)*-1))]));
|
||||
WriteB(Code);
|
||||
writeB(Format('%d %d lineto',[X,Y]));
|
||||
writeB(Format('%d %d lineto',[Left,Top]));
|
||||
writeB(Format('%.3f %.3f lineto',[cX+(rX*Cos((Angle1/16)*-1)),cY+(rY*Sin((Angle1/16)*-1))]));
|
||||
SetBrushFillPattern(False,True);
|
||||
|
||||
@ -1692,7 +1691,7 @@ begin
|
||||
ClearBuffer;
|
||||
writeB(Format('%.3f %.3f moveto',[cX+(rX*Cos((Angle1/16)*-1)),cY+(rY*Sin((Angle1/16)*-1))]));
|
||||
WriteB(Code);
|
||||
writeB(Format('%d %d lineto',[X,Y]));
|
||||
writeB(Format('%d %d lineto',[Left,Top]));
|
||||
writeB(Format('%.3f %.3f lineto',[cX+(rX*Cos((Angle1/16)*-1)),cY+(rY*Sin((Angle1/16)*-1))]));
|
||||
SetBrushFillPattern(True,False);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user