summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2012-03-15 18:22:58 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2012-03-15 18:22:58 +0200
commit9b55ac61e1455f2ca5da3d8327f346accccb550e (patch)
tree2eec2f48531561c88611b5534ec7ba0fc4f69d29
parent70fd59b13468b12f2bd7af35992b2974fb2bafff (diff)
downloadfpGUI-9b55ac61e1455f2ca5da3d8327f346accccb550e.tar.xz
improved the signature of Canvas constructors.
-rw-r--r--src/corelib/fpg_base.pas7
-rw-r--r--src/corelib/fpg_main.pas7
2 files changed, 8 insertions, 6 deletions
diff --git a/src/corelib/fpg_base.pas b/src/corelib/fpg_base.pas
index 8a97efc6..de858640 100644
--- a/src/corelib/fpg_base.pas
+++ b/src/corelib/fpg_base.pas
@@ -353,7 +353,7 @@ type
procedure DoFillArc(x, y, w, h: TfpgCoord; a1, a2: Extended); virtual; abstract;
procedure DoDrawPolygon(Points: PPoint; NumPts: Integer; Winding: boolean = False); virtual; abstract;
public
- constructor Create; virtual;
+ constructor Create(awin: TfpgWindowBase); virtual;
destructor Destroy; override;
procedure DrawRectangle(x, y, w, h: TfpgCoord); overload;
procedure DrawRectangle(r: TfpgRect); overload;
@@ -403,6 +403,8 @@ type
property LineStyle: TfpgLineStyle read FLineStyle;
end;
+ TfpgCanvasBaseClass = class of TfpgCanvasBase;
+
TfpgComponent = class(TComponent)
private
@@ -1445,10 +1447,11 @@ begin
FInterpolation := AValue;
end;
-constructor TfpgCanvasBase.Create;
+constructor TfpgCanvasBase.Create(awin: TfpgWindowBase);
begin
FBufferedDraw := True;
FFastDoubleBuffer := True;
+ FWindow := awin;
end;
destructor TfpgCanvasBase.Destroy;
diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas
index ccae8675..46091fa6 100644
--- a/src/corelib/fpg_main.pas
+++ b/src/corelib/fpg_main.pas
@@ -176,7 +176,7 @@ type
private
function AddLineBreaks(const s: TfpgString; aMaxLineWidth: integer): string;
public
- constructor Create(awin: TfpgWindow); reintroduce;
+ constructor Create(awin: TfpgWindowBase); override;
destructor Destroy; override;
// As soon as TfpgStyle has moved out of CoreLib, these must go!
@@ -1758,12 +1758,11 @@ begin
end;
end;
-constructor TfpgCanvas.Create(awin: TfpgWindow);
+constructor TfpgCanvas.Create(awin: TfpgWindowBase);
begin
- inherited Create;
+ inherited Create(awin);
FBeginDrawCount := 0;
- FWindow := awin;
// options
FBufferedDraw := True; // transparent widgets must turn this off