Autor Beitrag
hui1991
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 433

Windows XP, WIndows Vista
Turbo Delphi Explorer| Delphi, PHP,Blitzbasic
BeitragVerfasst: Mi 04.10.06 18:09 
Hallo,

also ich möchte eine PRocedure ausführen, wenn sich der property Zeile ändert.

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:
unit Gleichung;

interface

uses
  SysUtils, Classes, Controls, ExtCtrls,QStdCtrls,QGraphics;

type
  TGleichung = class(TImage)
  private
    FZeile: String;
    { Private declarations }
  protected
    procedure Rendern;
    { Protected declarations }
  public
    procedure splitter(datei: String;nummer:Integer);
    { Public declarations }
  published
    property Zeile: String read FZeile write FZeile;
    { Published declarations }
  end;

Wenn sich FZeile ändert soll Rendern ausgeführt werden. Blos wie überprüfe ich, wann FZeile geändert wurde?
Weil Rendern kann man ja net von der FOrm1 ausführen. ICh hoffe mir kann auch hier geholfen werden.
ICh würde ja die suche mal schauen, blos weis ich net nach was ich suchen soll.

MfG
hui1991
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 04.10.06 18:22 
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:
26:
27:
28:
29:
unit Gleichung;

interface

uses
  SysUtils, Classes, Controls, ExtCtrls,QStdCtrls,QGraphics;

type
  TGleichung = class(TImage)
  private
    FZeile: String;
    procedure SetZeile(const Value:string);
    { Private declarations }
  protected
    procedure Rendern;
    { Protected declarations }
  public
    procedure splitter(datei: String;nummer:Integer);
    { Public declarations }
  published
    property Zeile: String read FZeile write SetZeile; //ob hier noch der Parameter genannt werden muss, weiß ich atm nicht.
    { Published declarations }
  end;

procedure TGleichung.SetZeile(const Value:string);
begin
 Rendern;
 FZeile := Value;
end;

Einfach so heruntergeschrieben, keine Garantie auf Funktionalität. ;)

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
hui1991 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 433

Windows XP, WIndows Vista
Turbo Delphi Explorer| Delphi, PHP,Blitzbasic
BeitragVerfasst: Mi 04.10.06 18:35 
Danke für die Antwort,
aber es funktioniert nicht.
Das gab es auch in dsdt.info.
ausblenden Delphi-Quelltext
1:
[Hint] Bruchgleichung.pas(12): Private symbol 'SetZeile' declared but never used					

Hmm.. kA warum das jetzt wieder kommt.
Ich musste Gleichung in Bruchgleichung ändern, sonst konnte ich es nicht installieren... Als ich nicht Rendern aufrufen konnte habe ich gedacht, das soll es selber machen, wenn es sich ändert, aber ich hab herausgefunden wie die Meldung kam, indem ich auf Compile geklickt habe.
Das hier ist das editierte:
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:
41:
42:
43:
44:
45:
46:
47:
unit Bruchgleichung;

interface

uses
  SysUtils, Classes, Controls, ExtCtrls,QStdCtrls,QGraphics;

type
  TBruchgleichung = class(TImage)
  private
    FZeile: String;
    procedure SetZeile(const Value:string);
    { Private declarations }
  protected
    procedure Rendern;
    { Protected declarations }
  public
    procedure splitter(datei: String;nummer:Integer);
    { Public declarations }
  published
    property Zeile: String read FZeile write FZeile;
    { Published declarations }
  end;

procedure Register;

var
  ListBox1:TListBox;
implementation

procedure Register;
begin
  RegisterComponents('Bruch', [TBruchgleichung]);
end;

procedure TBruchgleichung.SetZeile(const Value:string);
begin
 Rendern;
 FZeile := Value;
end;

procedure TBruchgleichung.Rendern;
begin
...
end;

end.


Da kommt halt der oben genannte Fehler:[Hint] Bruchgleichung.pas(12): Private symbol 'SetZeile' declared but never used

Und ich hab es grad gesehen, das ich nicht mehr die Komponente Installieren kann. Wie kann ich sie deinstallieren um sie neuinstallieren zu können? Weil jetzt kann ich nicht mehr testen. Auser ich benenne meine Komponente um. Weil wenn installieren nicht geht, dann kann ich schlecht sagen ob es wirklich geht...

MfG
hui1991
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mi 04.10.06 18:37 
Du hast ne Änderung nicht übernommen:
ausblenden Delphi-Quelltext
1:
property Zeile: String read FZeile write SetZeile;					


BTW: Die Meldung ist kein Fehler, sondern ein Hinweis

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
hui1991 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 433

Windows XP, WIndows Vista
Turbo Delphi Explorer| Delphi, PHP,Blitzbasic
BeitragVerfasst: Mi 04.10.06 18:41 
Achso, auch gut, blos installieren kann ich leider nicht.
Das Feld wo install drauf steht ist deaktiviert. Also so grau.
Wie kann ich jetzt installieren. Es geht ja nicht.
Kann ja nicht dauernt die Namen ändern...
Kann mir da einer Helfen, sonst weis ich nicht ob das jetzt richtig ist ;)

MfG
hui1991
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 04.10.06 18:49 
Es reicht imo das Neukompilieren des Packages. U.U. mußt du diese auch vorher deinstallieren, wenn du Delphi nicht neu Starten willst.

_________________
Markus Kinzler.
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mi 04.10.06 18:49 
Du musst erst die alte Version deinstallieren.
Das geht über einen der Menüpunkte unter "Komponenten". Wie der heißt, weiß ich grad nich.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
hui1991 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 433

Windows XP, WIndows Vista
Turbo Delphi Explorer| Delphi, PHP,Blitzbasic
BeitragVerfasst: Mi 04.10.06 19:51 
Danke euch allen für die Hilfe,
aber es mag mich nicht :cry:
Jetzt ist die "property Zeile" weg.
Gleichungen.Zeile:='4x+[2x-1]' geht nicht mehr zum rein schreiben.
ICh weis leider nicht warum :(
Wie soll ich sie ändern, wenn es sie nicht zu auswählen gibt :(
Hab doch erst gestern mit den Komponenten erstellen angefangen :(
Hoffentlich ich kriege da noch eine Hilfe, damit es endlich funktioniert ;)

MfG
hui1991
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 04.10.06 19:54 
Versuch mal Delphi zu beenden und neu zu Starten.

_________________
Markus Kinzler.
hui1991 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 433

Windows XP, WIndows Vista
Turbo Delphi Explorer| Delphi, PHP,Blitzbasic
BeitragVerfasst: Mi 04.10.06 19:59 
Im Object Inspector ist es ja drin blos kann ich nicht auf Buttonklick es ändern.
ausblenden Delphi-Quelltext
1:
[Error] Unit1.pas(28): Undeclared identifier: 'Zeile'					

Es sollte eigentlich funktionieren.
Hab in dsdt.info nochmal geschaut, es sollte funktionieren.
BLos warum es nicht funktioniert, weis ich leider nicht :(

MfG
hui1991
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 04.10.06 20:01 
Zeig mal den Code, in dem der Fehler auftritt.

_________________
Markus Kinzler.
hui1991 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 433

Windows XP, WIndows Vista
Turbo Delphi Explorer| Delphi, PHP,Blitzbasic
BeitragVerfasst: Mi 04.10.06 20:05 
Das ist Form1:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.FormCreate(Sender: TObject);
begin
  Bruchgleichungen.Zeile:='4x';
end;


Und das hier ist der Code vom Bruchgleichungen:
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:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
unit Bruchgleichungen;

interface

uses
  SysUtils, Classes, Controls, ExtCtrls,QStdCtrls,QGraphics;

type
  TBruchgleichungen = class(TImage)
  private
    FZeile: String;
    procedure SetZeile(const Value:string);
    { Private declarations }
  protected
    procedure Rendern;
    { Protected declarations }
  public
    procedure splitter(datei: String;nummer:Integer);
    { Public declarations }
  published
    property Zeile: String read FZeile write SetZeile;
    { Published declarations }
  end;

procedure Register;

var
  ListBox1:TListBox;
implementation

procedure Register;
begin
  RegisterComponents('Bruch-fraction', [TBruchgleichungen]);
end;

procedure TBruchgleichungen.SetZeile(const Value:string);
begin
 Rendern;
 FZeile := Value;
end;

procedure TBruchgleichungen.Rendern;
var
...
begin
...
end;

function TBruchgleichungen.splitter(datei: String;nummer:Integer);
var
...
begin
...
end;

end.


SO ich hoffe dieser Fehler wir endlich beseitigt ;)
Sollte alles richtig sein ;)

MfG
hui1991
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 04.10.06 20:08 
Der Source der Komponenetnunit sieht eigentlich ok aus. Poste mal die andere Unit komplett.

_________________
Markus Kinzler.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 04.10.06 20:11 
Hast du schon eine Instanz der Klasse TBruchgleichung erzeugt?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
hui1991 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 433

Windows XP, WIndows Vista
Turbo Delphi Explorer| Delphi, PHP,Blitzbasic
BeitragVerfasst: Mi 04.10.06 20:13 
Müsste nicht.
Denke das ich keine Instanz drin habe.
Wenn es den Fehler behebt wie mache ich das dann?

MfG
hui1991
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 04.10.06 20:16 
Eine Instanz entweder durch Ziehen der Komponente auf die Form oder manuell erzeugen.

_________________
Markus Kinzler.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 04.10.06 20:17 
user profile iconhui1991 hat folgendes geschrieben:
Müsste nicht.
Denke das ich keine Instanz drin habe.
Wenn es den Fehler behebt wie mache ich das dann?

MfG
hui1991

Na du willst doch die Property der Klasse TBruchgleichung ändern oder wie sehe ich das?
Das geht imho nur, wenn du erst eine Instanz dieser Klasse erzeugst:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
var MyDummy: TBruchgleichung;

MyDummy := TBruchgleichung.Create;
MyDummy.Zeile := 'pipapo'; //hier kannst du dann drauf zugreifen

@others: Oder liege ich daneben?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 04.10.06 20:22 
Zitat:
@others: Oder liege ich daneben?
Das wäre die manuelle Variante.

_________________
Markus Kinzler.
hui1991 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 433

Windows XP, WIndows Vista
Turbo Delphi Explorer| Delphi, PHP,Blitzbasic
BeitragVerfasst: Mi 04.10.06 20:32 
Oh nein!! :oops:
Ich hab bei Gleichungen.Zeile; die eins vergessen.
Es sollte
Gleichungen1.Zeile; heißen :autsch:
Ja ich hab die Komponente auf die Form gezogen.
So einfach ist es gewesen xD
Naja euch ist es vllt auch nicht gleich aufgefallen ;)
Naja etz hab ich den Fehler.
Eine Frage: Wie kann ich die ListBox da drin erstellen.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TBruchgleichungen.SetZeile(const Value:string);
begin
 FZeile := Value;
 ListBox1.Create();
 Rendern;
 ListBox1.Destroy;
end;


Weis net wie ich das erstellen soll, denn dann sollte es wirklich funktionieren.
Dann müsste ich wissen ob das jetzt geht oder nicht.

MfG
hui1991
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 04.10.06 20:35 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TBruchgleichungen.SetZeile(const Value:string);
begin
 FZeile := Value;
 ListBox1 := TListbox.Create;
 Listbox1.Parent := Self;
 Rendern;
 FreeAndNil(Listbox1);
end;

Müsste so funktionieren.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot