Toolbar2000

Global Functions and Variables

TB2Dock unit

Functions:

  • procedure TBIniLoadPositions(const OwnerComponent: TComponent; const Filename, SectionNamePrefix: string); Loads the positions of all toolbars owned by OwnerComponent from the .INI file specified by Filename. Normally, OwnerComponent will be a form. This function is provided for backwards compatibility; 32-bit applications should use the registry instead. This function should be called when your application starts (usually in the OnCreate handler of your form). If the positions were not previously saved in the .INI file, TBIniLoadPositions has no effect. Each toolbar's data is loaded from a section whose name is the Name property of the toolbar prefixed by SectionNamePrefix.

    Example:
    procedure TForm1.FormCreate(Sender: TObject);
    begin
      TBIniLoadPositions(Self, 'test.ini', '');
    end;
  • procedure TBIniSavePositions(const OwnerComponent: TComponent; const Filename, SectionNamePrefix: string);
    Saves the positions of all toolbars owned by OwnerComponent to the .INI file specified by Filename. Normally, OwnerComponent will be a form. This function is provided for backwards compatibility; 32-bit applications should use the registry instead. This function should be called when your application exits (usually in the OnDestroy handler of your form). Each toolbar's data is saved to a section whose name is the Name property of the toolbar prefixed by SectionNamePrefix.

    Example:
    procedure TForm1.FormDestroy(Sender: TObject);
    begin
      TBIniSavePositions(Self, 'test.ini', '');
    end;
  • procedure TBRegLoadPositions(const OwnerComponent: TComponent; const RootKey: DWORD; const BaseRegistryKey: string);
    Loads the positions of all toolbars owned by OwnerComponent from the registry. Normally, OwnerComponent will be a form. This function should be called when your application starts (usually in the OnCreate handler of your form). If the positions were not previously saved in the registry, TBRegLoadPositions has no effect.

    RootKey and BaseRegistryKey specify the root key and subkey that it loads the data from. Normally, you should use HKEY_CURRENT_USER as the root key. TBRegLoadPositions will append the Name of the toolbars onto this. For example, if BaseRegistryKey is Software\My Company\My Program\Toolbars and the Name of a toolbar is MyToolbar, it loads the data from the Software\My Company\My Program\Toolbars\MyToolbar key.

    Delphi example:
    procedure TForm1.FormCreate(Sender: TObject);
    begin
      TBRegLoadPositions(Self, HKEY_CURRENT_USER,
        'Software\My Company\My Program\Toolbars');
    end;
    C++Builder example:
    void __fastcall TForm1::FormCreate(TObject *Sender)
    {
      TBRegLoadPositions(this, (DWORD)HKEY_CURRENT_USER,
        "Software\\My Company\\My Program\\Toolbars");
    }
  • procedure TBRegSavePositions(const OwnerComponent: TComponent; const RootKey: DWORD; const BaseRegistryKey: string);
    Saves the positions of all toolbars owned by OwnerComponent to the registry. Normally, OwnerComponent will be a form. This function should be called when your application exits (usually in the OnDestroy handler of your form).

    RootKey and BaseRegistryKey specify the root key and subkey that it saves the data to. Normally, you should use HKEY_CURRENT_USER as the root key. TBRegSavePositions will append the Name of the toolbars onto this. For example, if BaseRegistryKey is Software\My Company\My Program\Toolbars and the Name of a toolbar is MyToolbar, it saves the data from the Software\My Company\My Program\Toolbars\MyToolbar key.

    Delphi example:
    procedure TForm1.FormDestroy(Sender: TObject);
    begin
      TBRegSavePositions(Self, HKEY_CURRENT_USER, 'Software\My Company\My Program\Toolbars');
    end;
    C++Builder example:
    void __fastcall TForm1::FormDestroy(TObject *Sender)
    {
      TBRegSavePositions(this, (DWORD)HKEY_CURRENT_USER,
        "Software\\My Company\\My Program\\Toolbars");
    }