Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

Adding toolbars to the designer window

edited November 2004 in End User
Using D7, RB9, Win2000

Hi

We have just upgraded to RB9 and are trying to get our toolbars to work. We
use the following code

ToolbarManager := TppDesignerWindow(ReportDesigner.Form).ToolbarManager;
StylingToolbar := ToolbarManager.NewToolbar('Styling');

StyleSelectionComboBox := TComboBox.Create(StylingToolbar);
... more initializations ...

We used to have it in TppDesigner.OnCreate (using RB7), but the
ToolbarManager is here nil. It is not accessible until
TppDesigner.OnActivate because it isn't created before
TppDesignerWindow.WMShowWindow.
Is this an error?

It also seems that TppToolbarManager.NewToolbar is not calling the private
method TppToolbarManager.BuildPopupMenu that is called from
TppToolbarManager.AddToolbar.
Is this intended?

Kind Regards
Steffen

Comments

  • edited November 2004
    Looked a bit more into the case.

    I get an access violation when i change any of the components in the
    TppDesigner.ShowComponents list to false. Traced the error to the method
    TppDesigner.CreateDesignerWindow where the following code is executed:

    if (FShowComponents <> cAllShowComponents) then
    FDesignerWindow.ComponentClasses := FComponentClasses;

    This calls the TppDesignerWindow.GetComponentClasses that uses the
    TppToolbarManager, that is not yet initialized causing the access violation.

    Hope you will fix this soon.

    Kind Regards
    Steffen

  • edited December 2004

    1. There is an RB 9.0 patch available that fixes the
    TppDesigner.ShowComponents feature. Email support@digital-metaphors.com and
    request the patch.

    2. The timing of the ToolbarManager/Toolbar creation and initialization has
    changed. The underlying toolbar architecture is now relying on Delphi's
    built-in toolbar functionality rather than the Toolbar 97 that we were using
    before. We had to make some changes to the timing in order to get things to
    work properly.

    Try using the Designer.OnShow event to create your custom toolbars.

    3. I am not sure whether that is intended or not (I wrote the code long
    ago). It was not designed to accomodate adding custom toolbars, but I think
    it should work. For now, try using AddToolbar.



    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.