AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Problem mit TColletion zur Designzeit

Ein Thema von static_cast · begonnen am 28. Feb 2005 · letzter Beitrag vom 6. Mär 2005
 
static_cast

Registriert seit: 19. Okt 2003
Ort: Peine
300 Beiträge
 
#1

Problem mit TColletion zur Designzeit

  Alt 28. Feb 2005, 17:53
Hi,

ich habe ein Problem und zwar versuche ich mit einer TCollection ein TCollectionItems eine Liste zu erstellen die man zur Designzeit im OI bearbeiten kann. Er öffnet einfach nicht das Fenster zum bearbeiten Aber funktionieren tut es soweit ich habe es ausporbiert ich kann zur laufzeits Items erstellen und auf sie zugreifen, nur zur Designzeit geht es nicht.

Der Code ist folgender:

Delphi-Quellcode:
  { TAccount }

  TAccount = class(TCollectionItem)
  private
    FValue: String;
    procedure SetValue(const Value: String);
  protected
  public
    constructor Create(ACollection: TCollection); override;
  published
    property Value:String read FValue write SetValue;
  end;

  { TAccounts }

  TAccounts = class(TCollection)
  private
    FOwner: TPersistent;
    function GetItem(Index: Integer): TAccount;
    procedure SetItem(Index: Integer; Value: TAccount);
  protected
    function GetOwner: TPersistent; override;
  public
    constructor Create(Owner: TPersistent);
    function Add: TAccount;
    property Items[Index: Integer]: TAccount read GetItem write SetItem; default;
  end;

  { TAccountProperties }

  TAccountProperties = class(TPersistent)
  private
    FVisibleAccounts: TAccountTypes;
    FAccounts: TAccounts;
    procedure SetVisibleAccounts(const Value: TAccountTypes);
    procedure SetAccounts(Value: TAccounts);
  protected
  public
    constructor Create;
    destructor Destroy; override;
  published
    property Accounts:TAccounts read FAccounts write SetAccounts;
    property VisibleAccounts:TAccountTypes read FVisibleAccounts write SetVisibleAccounts;
  end;
Delphi-Quellcode:
{ TAccountProperties }

constructor TAccountProperties.Create;
begin
  FAccounts:=TAccounts.Create(Self);
  VisibleAccounts:=atAll;
end;

destructor TAccountProperties.Destroy;
begin
  FreeAndNil(FAccounts);
  inherited;
end;

procedure TAccountProperties.SetAccounts(Value: TAccounts);
begin
  FAccounts.Assign(Value);
end;

procedure TAccountProperties.SetVisibleAccounts(const Value: TAccountTypes);
begin
  FVisibleAccounts:=Value;
end;

{ TAccount }

constructor TAccount.Create(ACollection: TCollection);
begin
  inherited Create(ACollection);
end;

procedure TAccount.SetValue(const Value: String);
begin
  FValue := Value;
end;

{ TAccounts }

function TAccounts.Add: TAccount;
begin
  Result := TAccount(inherited Add);
end;

constructor TAccounts.Create(Owner: TPersistent);
begin
  inherited Create(TAccount);
  FOwner:=Owner;
end;

function TAccounts.GetItem(Index: Integer): TAccount;
begin
  Result := TAccount(inherited GetItem(Index));
end;

function TAccounts.GetOwner: TPersistent;
begin
  Result := FOwner;
end;

procedure TAccounts.SetItem(Index: Integer; Value: TAccount);
begin
  inherited SetItem(Index, Value);
end;
Grüße,
Daniel.

P.S.: bin @work und hier benutzen wir Delphi 5 Pro (wenn das von relevants ist )
Daniel M.
"The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore."
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 13:39 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz