ich schick dir nochnal die
unit:
Delphi-Quellcode:
unit PRichEdit;
interface
uses
SysUtils, Classes, Controls, StdCtrls, ComCtrls, Dialogs;
type
TColoredStrings =
class(TStrings)
private
{ Private-Deklarationen }
protected
{ Protected-Deklarationen }
public
function Add(
const S:
string): integer;
override;
{ Public-Deklarationen }
published
{ Published-Deklarationen }
end;
TPRichEdit =
class(TRichEdit)
private
{ Private-Deklarationen }
FMyLines: TColoredStrings;
protected
{ Protected-Deklarationen }
public
constructor Create( AOWner: TComponent);
override;
destructor Destroy;
{ Public-Deklarationen }
published
{ Published-Deklarationen }
property Lines: TColoredStrings
read FMyLines
write FMyLines;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('
Beispiele', [TPRichEdit]);
end;
function TColoredStrings.Add(
const S:
string): integer;
begin
showmessage(S);
end;
constructor TPRichEdit.Create(AOWner: TComponent);
begin
inherited Create( AOwner);
FMyLines := TColoredStrings.Create;
end;
destructor TPRichEdit.Destroy;
begin
FMyLines.Destroy;
inherited Destroy;
end;
end.