ich habe bei meiner GUI heute alles auf PP und Inc Dateien umgestellt.
Als ich fertig wahr, bekomme ich vom Complier diese Meldung:
uMyGui.pp(121,14) Error: Forward declaration not solved "TmyShape.GetSitePen(LongInt):TPen"
das Komisch ist jetzt folgendes:
Code: Alles auswählen
{ $Id: uMyGui.pp $}
{
Autor : Michael Springwald
Erstllungs Datum : Donnerstag, 24.Mai.2007
upgedatet :
}
unit uMyGui;
{$mode objfpc}{$H+}
interface
{$ifdef Trace}
{$ASSERTIONS ON}
{$endif}
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,Tools,types,uMyStyle,uMyObjManger;
const
stVerti = 0;
stHori = 1;
sBrush = 0;
sPen = 1;
sFont = 2;
type
TChanged = array of Trect;
tOnDraw = procedure() of Object;
TMouseEV = procedure(Typ,x,y:integer;Shift:TShiftState) of Object;
TOnBackupBuffer = procedure (t:Integer; r:TRect;sCanvas:TCanvas) of Object;
TOnFocus = procedure of Object;
TmyShapeStyle = (MssRectangle,MssElipsse);
{ TMyCompo }
TMyCompo = class
protected
fEnabled: Boolean;
frx,fry,frw,frh:Integer;
fBrush:TBrush;
fPen:TPen;
fFont:TFont;
fFocus: Boolean;
fTest:Boolean;
procedure SetValue(Index: integer; const AValue: Integer);Virtual;
procedure SetName(const AValue: String); Virtual;
procedure SetEnabled(const AValue: Boolean); Virtual;
procedure SetVisible(const AValue: Boolean); Virtual;
procedure BrushChange(Sender:TObject);Virtual;
private
fName: String;
fvisible: Boolean;
fHotStyle, fEnabledStyle:TmyStyle;
function GetEnabled: Boolean;
function GetEnabledStyle: TmyStyle;
function GetHotStyle: TmyStyle;
function GetValue(Index: integer): Integer;
procedure SetEnabledStyle(const AValue: TmyStyle);
procedure SetHotStyle(const AValue: TmyStyle);
public
onBackupBuffer:TOnBackupBuffer;
// Für das Anzeigen
OutCanvas:TCanvas;
// Für den Internen Buffer
fCanvas:TCanvas;
// Sobald was Neu gezeichnet werden soll
ChangeItems:TChanged;
onDraw:TOnDraw;
// FontColor,bgColor,fgColor:TColor;
FocusStyl:TmyStyle;
onMouseEV:TMouseEV;
onFocus:TOnFocus;
Parent:TMyCompo;
procedure Clear(rrw:Integer = 0; rrh:Integer = 0);
procedure AddRect(r:TRect);
constructor Create;
procedure SetFocus(const AValue: Boolean);Virtual;
// Jede Komponente hat einen Eigene Draw Procdure
procedure Draw;virtual;
procedure SetStyle(index:Integer;Compo:TMyCompo = nil);
procedure SetDefaultStyl(Index:Integer);
function CanDraw:Boolean;
published
property rx:Integer index 0 read GetValue write SetValue;
property ry:Integer index 1 read GetValue write SetValue;
property rw:Integer index 2 read GetValue write SetValue;
property rh:Integer index 3 read GetValue write SetValue;
property EnabledStyle:TmyStyle read GetEnabledStyle Write SetEnabledStyle;
property HotStyle:TmyStyle read GetHotStyle write SetHotStyle;
property Brush:TBrush read fBrush write fBrush;
property Pen:TPen read fPen write fPen;
property Font:TFont read fFont write fFont;
property Enabled:Boolean read GetEnabled write SetEnabled;
property visible:Boolean read fvisible write SetVisible;
property Name:String read fName write SetName;
property Focus:Boolean read fFocus write SetFocus;
end;
{ TmyShape }
TmyShape = class(TMyCompo)
private
fFillBrush: TBrush;
fFillRec: Boolean;
fStyle: TmyShapeStyle;
fViewLeftSite, fViewRightSize, fViewTopSite, fViewBottomSite:Boolean;
fLeftPen, fRightPen, fTopPen, fBottomPen:TPen;
function GetSitePen(Index: integer): TPen;
function GetViewSite(Index: integer): Boolean;
procedure SetFillBrush(const AValue: TBrush);
procedure SetFillRec(const AValue: Boolean);
procedure SetShapeStyle(const AValue: TmyShapeStyle);
procedure SetSitePen(Index: integer; const AValue: TPen);
procedure SetViewSite(Index: integer; const AValue: Boolean);
protected
procedure SetValue(Index: integer; const AValue: Integer);Override;
procedure ChangePen(Sender:TObject);Virtual;
procedure Draw; Override;
public
constructor Create;
destructor Destroy;
published
property Style:TmyShapeStyle read fStyle write SetShapeStyle;
property FillRec:Boolean read fFillRec write SetFillRec;
property FillBrush:TBrush read fFillBrush write SetFillBrush;
property ViewLeftSite:Boolean index 0 read GetViewSite write SetViewSite;
property ViewRightSite:Boolean index 1 read GetViewSite write SetViewSite;
property ViewTopSite:Boolean index 2 read GetViewSite write SetViewSite;
property ViewBottomSite:Boolean index 3 read GetViewSite write SetViewSite;
property LeftPen:TPen index 0 read GetSitePen write SetSitePen;
property RightPen:TPen index 1 read GetSitePen write SetSitePen;
property TopPen:TPen index 2 read GetSitePen write SetSitePen;
property BottomPen:TPen index 3 read GetSitePen write SetSitePen;
end;
//noch mehr code
implementation
{$I uMyCompo.inc}
{$I uMyShape.inc}
{$I uMyListbox.inc}
{$I uLabel.inc}
{$I uMyCheckbox.inc}
{$I uProssesbar.inc}
{$I uMyStatusbar.inc}
{$I uMyButton.inc}
{$I uMyTrackbar.inc}
end.
Aber leider geht myShape nicht wegen dieser Fehler Meldung....
Kann mir da jemand weiter Helfen ?
edit00:
jetzt habe ich den Inhalt von uMyShape in uMyCompo kopiert und siehe da: es geht...
Heißt das jetzt: ich kann den Code nicht auf mehrer Dateien aufteilen ?