Welcome to the new DelphiDabbler Code Library Documentation.

This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.

Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.

OnGetIniDataEx event

Project: Window State Components.

Unit: PJWdwState.

Class: TPJWdwState

Applies to: ~>5.5

type
  TPJWdwStateGetIniDataEx = procedure(
    var AIniRootDir: TPJWdwStateIniRootDir;
    var AIniFilename, ASection: string
  ) of object;

property OnGetIniDataEx: TPJWdwStateGetIniDataEx;

Description

OnGetIniDataEx allows user to change the directory and name of the ini file and the section within it where window information is stored.

The event is triggered in the following cicumstances:

The directory location, name of the ini file and the section within it are passed as var parameters to the event handler, allowing the user to change the values, and hence the location where the window data is recorded. The values passed to the event handler are the same as those of the IniRootDir, IniFileName and Section properties.

Changing the values of the event’s parameters does not change the value of the related properties.

The purpose of the event is to enable the AutoSaveRestore property to be used without setting the IniRootDir, IniFileName and Section properties at design time - i.e. handling the event allows any of these property values to be overridden.

Changing the values of the AIniRootDir, AIniFileName or ASection parameters has exactly the same effect on the ini file and section names as setting the IniRootDir, IniFileName or Section properties to the same values. See the documentation of those properties for details.

If the path to the resulting ini file does not exist it is created, if possible, when the component first attempts to write data to the file. If the required directories can’t be created an exception will be raised.

Note: OnGetIniData is not fired if a handler is assigned to the OnGetIniDataEx event - you should only provide an event handler one event or the other, not both.