Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Property Editors for Arrays 1

Status
Not open for further replies.

johanvdb

Programmer
Jun 18, 2001
3
GB
I have written my own component that uses OLE to create excel reports, almost the same as a QuickReport. As I finished one of the properties that contains an object which references multiple column objects, I needed to create a property editor to edit the objects.

TExcelReport.Columns: TExColumns;
TExColumns.Items[Index]: TExColumn;

The problem with the property editor is simple. I added a button next to the property, where, when clicked, should open a form which lists all the column objects. The form has been written, but the only examples I have seen of this is modal forms. This form cannot be modal, as it should display the selected column on the Object Inspector. Regretfully, I have searched Hi and Lo for any documentation, but found nothing.

Please assist.
Johan van den Berg
 
If you have Delphi VCL source code a good example is the FieldsEditor in dsDesign.pas. It is a "component editor" not a property editor. The dataset has a "designer" property which is a pointer to the designer if it has bene created. If it has not been created it will create one when it first opens the form.

Wish I could post the source code here! :) Anyway, from reading the source it looks like both the designer form and the component have pointers to one another, and the component has a pointer to a more generic form so that you don't get a circular dependency.

Anyway, hope that makes sense to you and helps a bit!

TealWren
 
I have found an easier way. Thanks once again TealWren, as I wouldn't have found it had it not been for your help. The classes TCollection and TCollectionItem are predefined with property editors that allow the insertion and deletion, and especially the storing of a list of objects at design time. With this knowledge, I have written a TExcelReport component that +- has the same functionality of TQuickReport, but uses OLE to store the results in Excel. It is still in development though, so for those who would like to know more I'll post here and keep people informed.

Thanks for the help,
Johan van den Berg
 
I'm glad that you were able to find a good way to do it.

Good luck with your project!

TealWren
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top