[ Passwd @ 28.12.2005. 19:46 ] @
Radim bezveze nov ukomponentu, i naslijedim TButton i kreiram Edit1 i Edit2, ali kad komponentu postavim na formu, ti editi se uopce ne vide.. Code: unit TMojDigitron; interface uses SysUtils, Classes, Controls, StdCtrls, Dialogs; type TDigitron = class(TButton) private { Private declarations } Edit1:TEdit; Edit2:TEdit; procedure zbroji(Sender: TObject); protected { Protected declarations } public { Public declarations } constructor Create(AOwner:TComponent); override; destructor Destroy; override; published { Published declarations } property Align; property Anchors; property AutoSize; property BiDiMode; property Color nodefault; property Constraints; property DragCursor; property DragKind; property DragMode; property Enabled; property Font; property ParentBiDiMode; property ParentColor; property ParentFont; property ParentShowHint; property PopupMenu; property ShowHint; property Visible; property WordWrap; property OnClick; property OnContextPopup; property OnDblClick; property OnDragDrop; property OnDragOver; property OnEndDock; property OnEndDrag; property OnMouseDown; property OnMouseMove; property OnMouseUp; property OnStartDock; property OnStartDrag; end; procedure Register; implementation procedure TDigitron.zbroji(Sender: TObject); begin ShowMessage(IntToStr(StrToInt(Edit1.Text)+StrToInt(Edit2.Text))); end; constructor TDigitron.Create(AOwner:TComponent); begin inherited Create(AOwner); Edit1:=TEdit.Create(self); Edit2:=TEdit.Create(self); Edit1.Visible:=true; Edit1.Top:=5; Edit1.Left:=10; Edit2.Visible:=true; Edit2.Top:=10; Edit2.Left:=10; Caption:='Zbroji'; OnClick:=zbroji; end; destructor TDigitron.Destroy; begin Edit1.Free; Edit2.Free; inherited; end; procedure Register; begin RegisterComponents('Samples', [TDigitron]); end; end. Prije ovoga sam stavio umjesto Self Parent..nije ni tako htjelo radit! Unaprijed hvala,p0z. |