Solved

Property Editor For A List of Obects (eg. items)

Posted on 1997-04-03
5
165 Views
Last Modified: 2010-04-06
I am trying to write a property editor for a list of Items
these items are of type TMyObject (custom class)

At design time I click the elipses and edit the property
but the items I added at design time are cleared at
run time.

how do I place them on the stream...?

Is is possible to get example code ?

Thanx in advance
"Beta" aKa "Zero 1"
0
Comment
Question by:Brendan040397
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 3

Expert Comment

by:mheacock
ID: 1335124
Not for 20 points.
0
 

Author Comment

by:Brendan040397
ID: 1335125
Sorrry I am not used to this point system thing
I rate the question Easy... but hey ...
0
 

Accepted Solution

by:
addict earned 80 total points
ID: 1335126
> how do I place them on the stream...?

You must write a wrapper list object around your object that decends from TPersistent.  TPersistent is the object that allows saving to a stream.  Then override the DefineProperties method to  define what you want to save to the stream.

  TLList = class(TPersistent)
  protected
    FList     :TList;
    procedure WriteData( Writer:TWriter );
    procedure ReadData( Reader:TReader );
    procedure DefineProperties( Filer:TFiler ); override;
  public
    constructor Create;
    destructor  Destroy; override;
    property    List:TList read FList write FList;
  end;

procedure TLList.DefineProperties( Filer:TFiler );
begin
  inherited DefineProperties( Filer );
  Filer.DefineProperty('LST', ReadData, WriteData, true );
end;


Michael Novak
Addictive Software
addict@flinthills.com
http://www.flinthills.com/~addict/

0
 

Author Comment

by:Brendan040397
ID: 1335127
This is my first venture into TPersistant.. etc

What will the ReadData and WriteData Procedures
Look like.?


0
 

Author Comment

by:Brendan040397
ID: 1335128
Thanx I'll take a look @ that
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi Form ownership 4 160
oracle global variables 4 80
QRReport  TQrmemo vertical stretching 1 67
MS Access from Delphi 31 102
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question