Delphi - problem pri tvorbe komponenty
Tomáš Jantač
tomasnusle
Středa Březen 17 11:51:35 CET 2004
Taky zdravim,
Prekladac se ti snazi rict, ze nemuze najit deklaraci procedury, tj.to
vlastni telo te procedury SetMark. V prikladu ta cast kodu neni vubec
uvedena, takze tezko rict, ale casta chyba je, ze tu deklaraci tam sice mas,
ale jen jako
procedure SetMark(Value:TMarkKind)
misto
procedure TOwnGraph.SetMark(Value:TMarkKind)
pak compiler netusi, ze se to vztahuje k objektu TOwnGraph. Pokud to timhle
neni, tak treba posli celou knihovnu, kouknu se na to, pokud chces.
priste asi spis na soukr. mail, mam pocit, ze tady je to mirne Off-Topic.
S pozdravem
Ota Maly
mailto:maly@space.cz
PaPouch elektronika
http://www.pap-el.cz
zdravim
nejak jsem se zaseknul pri tvorbe komponenty.Vse bylo OK az kdyz jsem pridal
polozku FMark.Kdyz nevytvorim SetMark metodu a zapisuju jen pomoci write
FMark,tak je to Ok,jakmile napisu deklaraci SetMark(Value:TMarkKind); tak to
zarve :[Error] OwnGraph.pas(48): Unsatisfied forward or external
declaration: 'TOwnGraph.setMark. a at do toho cumim jak do toho cumim,tak
nic me nenapada,kde je zakopanej pes.Cim dil na to koukam,tak nic nevidim.
Nevidi nekdo,kde je chyba??????A to samy rve kdyz chci napsat zapisovaci
metodu pro FXMarginEnable polozku.
'
diky Pavel
Ps:prikladam utrzek kodu,doufam,ze nekde nechybi nejakej end; ci ;
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type TAxisKind = (akX,akY);
type TMarkKind = (mkCircle,mkRect,mkTriangl,mkCross);
type TLine = record
case Integer of
0: (x1,y1,x2,y2:Word );
1: (StartPoint,EndPoint:TPoint);
end;
type TRealItem = class
Data:TPoint;
constructor Create(Value: TPoint);
end;
type TRealList = class(TList)
procedure AddPoint(x,y:Integer);
destructor Destroy; override;
end;
type
TOwnGraph = class(TGraphicControl)
private
FBrush:TBrush;
FMark:TMarkKind;
FPen:TPen;
FXMarginEnable:Boolean;
FYMArginEnable:Boolean;
FXRange:Integer;
FYRange:Integer;
FXStep:Word;
FYStep:Word;
procedure SetMark(Value: TMarkKind );
procedure MarkPoint(x,y:Word;druhosy:TAxisKind);
procedure
MakeAxisMarks(osa:Tline;druhosy:TAxisKind;MarkCount:Word;DeltaPix:Word);
{ procedure MakeMark(x, y: Word;znacka:TMarkKind);}
procedure SetPen(Value:TPen);
procedure SetBrush(const Value: TBrush);
procedure SetXRange(Value:Integer);
procedure SetYRange(Value:Integer);
procedure SetXStep(Value:Word);
procedure SetYStep(Value:Word);
procedure StyleChanged(Sender: TObject);
procedure Line(Cara:Tline);
protected
procedure Paint; override;
public
XRatio,YRatio:Word; // umisteni pouze pro testovani
XStepPix,YStepPix:Word; // jinak budou v private
NumXmarks,NumYmarks:Word;
XLength,YLength:Word;
XMinPix,YMinPix,XMaxPix,YMaxPix:Word;
FData:TRealList;
constructor Create(AOwner:TComponent); override;
destructor Destroy; override;
procedure Repaint; override;
procedure XMargins(CntMargins:Word;deltaPix:Word);
procedure YMargins(CntMargins:Word;deltaPix:Word);
published
property Mark:TMarkKind read FMark write SetMarkMark;
{!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}
property XMarginEnable:Boolean read FXMArginEnable write FXMArginEnable;
property YMarginEnable:Boolean read FYMArginEnable write FYMArginEnable;
property XRange:Integer read FXRange write SetXRange;
property YRange:Integer read FYRange write SetYRange;
property XStep:Word read FXStep write SetXStep;
property YStep:Word read FYStep write SetYStep;
property Brush:TBrush read FBrush write SetBrush;
property Pen:TPen read FPen write SetPen;
property Visible;
property OnClick;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
end;
Další informace o konferenci Hw-list