Solved

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now