Thema: Delphi Property (Stackoverload)

Einzelnen Beitrag anzeigen

Benutzerbild von Taladan
Taladan

Registriert seit: 5. Aug 2003
Ort: Osnabrück
505 Beiträge
 
Delphi 2005 Professional
 
#1

Property (Stackoverload)

  Alt 4. Sep 2003, 14:28
Bei unten angegeben Code (bis jetzt soll nur die zuordnung der Images funktionieren) erhalte ich keine Fehlermeldung, wenn ich sie compeliere. Doch sobald ich die Komponente in der Form plaziere, steht im Objektinspektor, sobald ich die Untereigenschaften öffne Stacküberlauf und delphi endet mit einer fehlermeldung.

Wer kann helfen?

Delphi-Quellcode:
unit TaladansPanel;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TBitmaps = class(TPersistent)
  private
    function GetObenLinks : TBitmap;
    procedure SetObenLinks(Value : TBitmap);
    function GetObenMitte : TBitmap;
    procedure SetObenMitte(Value : TBitmap);
    function GetObenRechts : TBitmap;
    procedure SetObenRechts (Value : TBitmap);
    function GetMitteLinks : TBitmap;
    procedure SetMitteLinks (Value : TBitmap);
    function GetMitteMitte : TBitmap;
    procedure SetMitteMitte (Value : TBitmap);
    function GetMitteRechts : TBitmap;
    procedure SetMitteRechts (Value : TBitmap);
    function GetUntenLinks : TBitmap;
    procedure SetUntenLinks(Value : TBitmap);
    function GetUntenMitte : TBitmap;
    procedure SetUntenMitte(Value : TBitmap);
    function GetUntenRechts : TBitmap;
    procedure SetUntenRechts (Value : TBitmap);
  public
    procedure Assign(Source: TPersistent); override;
  published
    property ObenLinks : TBitmap Read GetObenLinks Write SetObenLinks;
    property ObenMitte : TBitmap Read GetObenMitte Write SetObenMitte;
    property ObenRechts : TBitmap Read GetObenRechts Write SetObenRechts;
    property MitteLinks : TBitmap Read GetMitteLinks Write SetMitteLinks;
    property MitteMitte : TBitmap Read GetMitteMitte Write SetMitteMitte;
    property MitteRechts : TBitmap Read GetMitteRechts Write SetMitteRechts;
    property UntenLinks : TBitmap Read GetUntenLinks Write SetUntenLinks;
    property UntenMitte : TBitmap Read GetUntenMitte Write SetUntenMitte;
    property UntenRechts : TBitmap Read GetUntenRechts Write SetUntenRechts;
  end;


  TTaladansPanel = class(TGraphicControl)
  private
    { Private-Deklarationen }
    FBitmaps : TBitmaps;
    ObenLinks : TBitmap;
    ObenRechts : TBitmap;
    ObenMitte : TBitmap;
    MitteLinks : TBitmap;
    MitteMitte : TBitmap;
    MitteRechts : TBitmap;
    UntenLinks : TBitmap;
    UntenMitte : TBitmap;
    UntenRechts : TBitmap;
    procedure zeichen;
    procedure SetBitmaps( const Value: TBitmaps);
  protected
    { Protected-Deklarationen }
  public
    constructor Create(AOwner:Tcomponent); override;
    destructor Destroy; override;
    { Public-Deklarationen }
  published //im Objektinspektor
    { Published-Deklarationen }
    property Bitmaps : TBitmaps read FBitmaps write SetBitmaps;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('TaladansTools', [TTaladansPanel]);
end;

{Taladans Panel}

constructor TTaladansPanel.Create(AOwner:Tcomponent);
begin
  inherited;
  FBitmaps := TBitmaps.create;
  ObenLinks := TBitmap.create;;
  ObenRechts := TBitmap.create;;
  ObenMitte := TBitmap.create;;
  MitteLinks := TBitmap.create;;
  MitteMitte := TBitmap.create;;
  MitteRechts := TBitmap.create;;
  UntenLinks := TBitmap.create;;
  UntenMitte := TBitmap.create;;
  UntenRechts := TBitmap.create;;
end;

destructor TTaladansPanel.destroy;
begin
  FBitmaps.free;
    ObenLinks.free;
    ObenRechts.free;
    ObenMitte.free;
    MitteLinks.free;
    MitteMitte.free;
    MitteRechts.free;
    UntenLinks.free;
    UntenMitte.free;
    UntenRechts.free;
  inherited;
end;



procedure TTaladansPanel.SetBitmaps( const Value: TBitmaps);
begin
  FBitmaps.assign(value);
end;

procedure TTaladansPanel.Zeichen;
begin
// FObenLinksPicture.draw;
end;

{BitmapsValue}

procedure TBitmaps.Assign(Source: TPersistent);
begin
end;

{ Set }
procedure TBitmaps.SetObenLinks(Value : TBitmap);
begin
  ObenLinks.assign(value);
end;
procedure TBitmaps.SetObenMitte(Value : TBitmap);
begin
 ObenMitte.assign(value);
end;
procedure TBitmaps.SetObenRechts(Value : TBitmap);
begin
  ObenRechts.assign(value);
end;
procedure TBitmaps.SetMitteLinks(Value : TBitmap);
begin
  MitteLinks.assign(value);
end;
procedure TBitmaps.SetMitteMitte(Value : TBitmap);
begin
  MitteMitte.assign(value)
end;
procedure TBitmaps.SetMitteRechts(Value : TBitmap);
begin
  MitteMitte.assign(value);
end;
procedure TBitmaps.SetUntenLinks(Value : TBitmap);
begin
  UntenLinks.assign(value);
end;
procedure TBitmaps.SetUntenMitte(Value : TBitmap);
begin
  UntenMitte.assign(value);
end;
procedure TBitmaps.SetUntenRechts(Value : TBitmap);
begin
  UntenRechts.assign(value);
end;
{get }

function TBitmaps.GetObenLinks : TBitmap;
begin
   Result := ObenLinks;
end;
function TBitmaps.Getobenmitte : TBitmap;
begin
   Result := obenmitte;
end;
function TBitmaps.Getobenrechts : TBitmap;
begin
   Result := obenrechts;
end;

function TBitmaps.Getmittelinks : TBitmap;
begin
   Result := mittelinks;
end;
function TBitmaps.Getmittemitte : TBitmap;
begin
   Result := mittemitte;
end;
function TBitmaps.Getmitterechts : TBitmap;
begin
   Result := mitterechts;
end;

function TBitmaps.Getuntenlinks : TBitmap;
begin
   Result := untenlinks;
end;
function TBitmaps.Getuntenmitte : TBitmap;
begin
   Result := untenmitte;
end;
function TBitmaps.Getuntenrechts : TBitmap;
begin
   Result := untenrechts;
end;

end.
Marco
  Mit Zitat antworten Zitat