TFileToolbar enables the common TToolbar97 (separate available from Jordan Russel) to save and restore its buttons and separators to a ini file or the registry. Very useful, if you want the user of your program to customize the toolbars and restore this at startup.
TFileToolbar enables the common TToolbar97 (separate available from Jordan Russel) to save and restore its buttons and separators to a ini file or the registry. Very useful, if you want the user of your program to customize the toolbars and restore this at startup.
To get this to work, the loaded buttons must be attached with a TActionList (new with Delphi 4). In the ActionList are the Eventhandlers for each button. If you want display a Glyph you have to use an Imagelist, attached to the TActionList. TFileToolbar save the methode names attached to the TToolbarButtons and the names of the buttons. For example like this:
[FileToolbar1]Caption=FileToolbar1 ToolbarButton971.G_Action=Action1 ToolbarButton972.G_Action=Action2 ToolbarButton973.G_Action=Action3 ToolbarSep971.Separator=X ToolbarButton974.G_Action=Action4 ToolbarButton975.G_Action=Action5 ToolbarButton976.G_Action=Action6 ToolbarSep972.Separator=X ToolbarButton977.G_Action=Action7 ToolbarButton978.G_Action=Action8 ToolbarButton979.G_Action=Action9
After loading the saved buttons, TFileToolbar looks for the TAction with the loaded name, generates a TToolbarButton97 or a TToolbarSep97 on the fly an connects it with the TAction. If there is already a button with the same name as the loaded button on the FileToolbar, it will be destroyed and replaced by the newly generated one. TFileToolbar extends the TToolbar97 with the following properties and methodes: