Stefan's Corner

 

KEEP PROPERTIES COMPONENTS 1.1

THERE ARE 3 COMPONENTS, WORKING TOGETHER:
master TssPropsMaster - takes care about INI file name; there is only one MASTER component per project;
client TssPropsClient - keeps information about Components & Properties to Save/Restore; there is one CLIENT component on each form in the project
alone1.gif (1340 bytes) (new 1.1)TssPropsClientAlone - CLIENT component that works without MASTER

these components together allow you to create project with facility to "open-as-closed" without any additional code!

MAIN FEATURES:
(new 1.1)Registry Support
(new 1.1)New technology for user defined properties (simmilar to DefineProperties in TComponent)
(new 1.1)Supports StringGrid - ColWidths, RowHeights, Cells
(new 1.1)Supports List & Combo Boxes - ItemIndex
Supports all published properties
Supports all standard and user defined types and classes
Supports collection items - by name or by Index
Supports TStrings properties (like Items in TListBox & TComboBox)
KEEP PROPERTIES COMPONENTS EDITORS (screenshots):
COMING SOON:
Default selected properties for different classes
Registry support
BENEFITS:
Free update for registered users in 6 months
Free migration to Delphi 5 & next versions
HOW TO INSTALL:
Extract ZIP file in some directory
Open ssKeepPropsTrial.dpk
Click on INSTALL button (package window)
For Delphi 3 - add directory to search path
HOW TO USE:
Place master component on Main Form of your project
Place one client component on each form in your project
Link client component to master (set its property Master); if there don't appear master component in drop-down list - put your main form in uses clause (menu File|Use unit)
Use popup menu over the master and client components to select desired properties to keep
PUBLISHED PROPERTIES AND EVENTS:
MASTER

PROPERTIES
IniFileName - name of INI file to store values of properties
(new 1.1)If IniFileName is not specified - default value is Executable name with extension INI, stored in executable directory
(new 1.1)Destination -
     dstINIFile - information is stored into INI file
     dstRegistry - information is stored into windows registry
(new 1.1)Root - root key in registry (only in case Destination=dstRegistry). Possible values are:
HKEY_CLASSES_ROOT; HKEY_CURRENT_USER; HKEY_LOCAL_MACHINE; HKEY_USERS; HKEY_PERFORMANCE_DATA; HKEY_CURRENT_CONFIG; HKEY_DYN_DATA
(new 1.1)Path - path in root key in registry (only in case Destination=dstRegistry).
METHODS
(new 1.1)procedure ReadNow - executes ReadNow for all active CLIENTS
(new 1.1)procedure WriteNow - executes WriteNow for all active CLIENTS
EVENTS
OnNeedIniFileName - gives options for dynamic set of IniFile Name
OnBeforeRead - fired before reading values of properties
OnAfterRead - fired after reading values of properties
OnBeforeWrite - fired before writing values of properties
OnAfterWrite - fired after writing values of properties
*note that these events are fired for each CLIENT
CLIENT

PROPERTIES
PropsMaster
WhenRead - when CLIENT will read values of properties (readBeforeCreate, readAfterCreate, readBeforeShow, readAfterShow)
WhenWrite - when CLIENT will write values of properties (writeBeforeHide, writeAfterHide, writeBeforeDestroy, writeAfterDestroy)
METHODS
(new 1.1)procedure ReadNow - reads saved values of properties
(new 1.1)procedure WriteNow - writes values of properties
EVENTS
OnNeedMaster - fired berore read or write if property PropsMaster is not set
OnBeforeRead - fired before reading values of properties
OnAfterRead - fired after reading values of properties
OnBeforeWrite - fired before writing values of properties
OnAfterWrite - fired after writing values of properties
(new 1.1)ALONE CLIENT

PROPERTIES
IniFileName - name of INI file to store values of properties
If IniFileName is not specified - default value is Executable name with extension INI, stored in executable directory
Destination -
     dstINIFile - information is stored into INI file
     dstRegistry - information is stored into windows registry
Root - root key in registry (only in case Destination=dstRegistry). Possible values are:
HKEY_CLASSES_ROOT; HKEY_CURRENT_USER; HKEY_LOCAL_MACHINE; HKEY_USERS; HKEY_PERFORMANCE_DATA; HKEY_CURRENT_CONFIG; HKEY_DYN_DATA
Path - path in root key in registry (only in case Destination=dstRegistry).
WhenRead - when CLIENT will read values of properties (readBeforeCreate, readAfterCreate, readBeforeShow, readAfterShow)
WhenWrite - when CLIENT will write values of properties (writeBeforeHide, writeAfterHide, writeBeforeDestroy, writeAfterDestroy)
METHODS
procedure ReadNow - reads saved values of properties
procedure WriteNow - writes values of properties
EVENTS
OnNeedIniFileName - gives options for dynamic set of IniFile Name
OnBeforeRead - fired before reading values of properties
OnAfterRead - fired after reading values of properties
OnBeforeWrite - fired before writing values of properties
OnAfterWrite - fired after writing values of properties
USERDEFINED PROPS (HOW TO CREATE):
1. Define descendant of TssCustomProperty;
2. Overwrite virtual method - function GetValue(Dest: TObject): string; virtual;
3. Overwrite virtual method - procedure SetValue(Dest: TObject; const Value: string); virtual;
4. call procedure KeepPropsRegisterCustomProperty(PropClass: TssCustomProperty); in initialization part of your unit with instance of your class;
5. Previous steps should be done in ssKeepPropCustomProps.pas
Examples of UserDefinedProps included in package:
TStrings.Strings with name 'Text';
TCustomComboBox.ItemIndex with name 'ItemIndex';
TCustomListBox.ItemIndex with name 'ItemIndex';
TCollectionItem.Index with name 'Index';
TCustomGrid.ColWidths with name 'ColWidths';
TCustomGrid.RowHeights with name 'RowHeights';
TStringGrid.Cells with name 'Cells';
TPageControl.ActivePage with name 'ActivePage';
Example - Strings in TStrings (and all descendants);
NOTE: This feature is available only for registered users
TIPS:

visits since 15/May/1999

Copyright © 1999, Stefan Stefanov, last updated 21 Септември 1999