JVCL Help:TJvInspectorINIFileData.New@TJvCustomInspectorItem@string@string@string@PTypeInfo@TCustomIniFile

From Project JEDI Wiki
Jump to navigationJump to search
JEDI Visual Component Library Help

Search in JVCL Help

 
Search in all projects
 

Summary

Instantiate a data instance and attaches an item to it.


Pascal

 classfunctionNew(constAParent: TJvCustomInspectorItem; constAName: string; constASection: string; constAKey: string; ATypeInfo: PTypeInfo; constAINIFile: TCustomIniFile): TJvCustomInspectorItem; overload; reintroduce;
classfunctionNew(constAParent: TJvCustomInspectorItem; constASection: string; constAINIFile: TCustomIniFile; constAOnAddKey: TJvInspConfKeyEvent): TJvInspectorItemInstances; overload; reintroduce;
classfunctionNew(constAParent: TJvCustomInspectorItem; constAINIFile: TCustomIniFile; constAOnAddSection: TJvInspConfSectionEvent; constAOnAddKey: TJvInspConfKeyEvent): TJvInspectorItemInstances; overload; reintroduce;


Parameters

Parameters Description
const AParent: TJvCustomInspectorItem The parent to which this data should be added.
const AName: string The display name of the item.
const ASection: string Section within the configuration file/settings database.
const AKey: string Key within the section of the configuration file/settings database.
ATypeInfo: PTypeInfo Type info pointer to use.
const AINIFile: TCustomIniFile TCustomIniFile derivative to be used as a data source.
const AOnAddKey: TJvInspConfKeyEvent Event that will be called before a key is added. If no event is supplied, all keys are added, leaving the key name as the display name and the type info pointer set to string.
const AOnAddSection: TJvInspConfSectionEvent Event that will be called before a section is about to be parsed. If no event is supplied, all sections are parsed, leaving the section name as the category name.


Description

New instantiates a new data instance with the given parameters. If the data referred to by the given parameters already exists, the item will be attached to that data instance, instead of creating a new data instance. Depending on which overloaded method is called, the ini file will be scanned for sections and/or keys to instantiate. For each sec ion/key combination a check is made to see if the instance is unique. If it already exists, the pre-existing data instance is used and a new item is added to it. Using the events you can prevent certain keys being created or even prevent whole sections being scanned. In addition, these events allow you to change the name for the new item instance as well as which type info to attach to it.


About

Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page