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
Solved

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

Posted on 1997-04-03
5
162 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
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

809 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