Solved

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

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

Independent Software Vendors: 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
Dynamically Created Query 3 69
RESTRequest Parameter 4 51
firemonkey Android Listview Sort items 7 70
Delphi android app hide keyboard 3 36
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

680 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