Autor Beitrag
adler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 511

Windows XP
Delphi 05 Pers
BeitragVerfasst: Di 06.09.05 20:40 
Hallo.

Beim Aufziehen meiner Komponente auf die Form im FormularDesigner ergibt sich ein Error.
Fehlermeldung lautet "Element '' hat kein übergeordnetes Fenster"
Hööö??? Normal verständlich?

Danke :-)

_________________
Wo's nix zu gucken gibt, gibts vielleicht was zu hören.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mi 07.09.05 12:46 
1. Was macht deine Komponente?
2. Welche Basisklasse verwendest Du?
3. Kannst Du unseren Antworten Würze durch etwas Souce geben?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
adler Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 511

Windows XP
Delphi 05 Pers
BeitragVerfasst: Mi 07.09.05 21:29 
Warum hab ich den Source nur vergessen :-/

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
interface

uses
  SysUtils, Classes, Controls, graphics, windows;

type
  TEditText = class(TObject)
  Public
    Text  : Array of array of char;
  private
//
  end;

  ThlEdit = class(TGraphicControl)
  private
    FontWidth , FontHeight : integer;
    SelStart  : integer;
    SelEnd    : integer;
  protected
    procedure Paint; override;
  public
    Cursor    : TPoint;
    constructor Create(AOwner: TComponent); override;

    function GetSelLength:integer;
    procedure CursorPos(x,y: integer; selstring: boolean);
    procedure MouseDown(x,y: integer);
    procedure MouseUp(x,y: integer);
  published
    { Published-Deklarationen }
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Samples', [ThlEdit]);
end;


Das ist halt nun so die Definition...
Könnt ihr ja dann nach proceduren fragen... wobei noch nicht viel drinn steht ;)

_________________
Wo's nix zu gucken gibt, gibts vielleicht was zu hören.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 08.09.05 10:36 
hmmm, laut Def erstmal FAST alles in Ordnung...

Definier bitte mal noch einen Destructor (Override), ist aber erstmal für das Problem nebensächlich.

Eher interessant für das Problem sind die Methoden Create und Paint (sowie alle davon abhängigen). Ich vermute mal, da fehlt irgendwo wat ;-)

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
adler Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 511

Windows XP
Delphi 05 Pers
BeitragVerfasst: Do 08.09.05 14:40 
Also der Destructor ist nun definiert...
Hier mal die Funktionen an sich.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
destructor ThlEdit.Destroy();
begin
  inherited;
    
end;

constructor ThlEdit.Create(AOwner: TComponent);
begin
  inherited;
    Canvas.Pen.style := psSolid;
    Canvas.Brush.style := bsSolid;
    canvas.Font.name := 'Courier New';
    FontWidth := Canvas.TextWidth('H');
    FontHeight := Canvas.TextHeight('H');
end;

procedure ThlEdit.Paint;
begin
  inherited;
    Canvas.Brush.Color := clWhite;
    Canvas.Pen.Color := clBlack;
    Canvas.Rectangle(0,0,width,height);//Rechteck zeichnen

//Normale Zeichen-Anweisungen
end;

_________________
Wo's nix zu gucken gibt, gibts vielleicht was zu hören.
adler Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 511

Windows XP
Delphi 05 Pers
BeitragVerfasst: Sa 10.09.05 09:54 
Keiner sonst mehr eine Idee?

_________________
Wo's nix zu gucken gibt, gibts vielleicht was zu hören.
Spaceguide
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 552


(D3/D7/D8) Prof.
BeitragVerfasst: Sa 10.09.05 10:04 
Parent mal auf aOwner im Create gesetzt?
adler Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 511

Windows XP
Delphi 05 Pers
BeitragVerfasst: Sa 10.09.05 10:17 
Das geht nicht.
AOwner ist als TComponent deklariert.
und Parent ist TWinControl.

Meckert er rum...

_________________
Wo's nix zu gucken gibt, gibts vielleicht was zu hören.
Spaceguide
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 552


(D3/D7/D8) Prof.
BeitragVerfasst: Sa 10.09.05 11:14 
Dann caste halt.
adler Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 511

Windows XP
Delphi 05 Pers
BeitragVerfasst: Sa 10.09.05 11:33 
Klingt ja gut aber was meinst du mit kasten.
ich bin in dem gebiet noch net so fit.
Hab die ganze zeit nur mehr OpenGL oder so gemacht.

_________________
Wo's nix zu gucken gibt, gibts vielleicht was zu hören.
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: Sa 10.09.05 12:51 
Hi.

Was spricht eigentlich dagegen von TWinControl abzuleiten?
Wie es aussieht, willst du ja auch auf Mausereignisse reagieren. Da bietet sich TWinControl geradezu an. Was soll denn der Vorteil von TGraphicControl sein?

Gruß
Ken

_________________
Eine Klasse beschreibt die Struktur und das Verhalten einer Menge gleichartiger Objekte.
adler Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 511

Windows XP
Delphi 05 Pers
BeitragVerfasst: Sa 10.09.05 13:41 
Wegen dem Canvas.
Wäre schon besser, ja aber...
Dann sagt er mir aber Leinwand/Bild erlaubt kein Zeichen...

_________________
Wo's nix zu gucken gibt, gibts vielleicht was zu hören.