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

Accessing Custom Toolbars

edited September 2006 in General
Hi all

BDS 2006; RB 10

What is the easiest way to access custom added toolbars. We added a new
toolbar using:

TppToolbarFactory.Register(StylingToolbar)

We need to enable/disable the styling dependent on selections in the
designer. What is the easiest way to access the toolbar. The best i have
found is getting the toolbar manager like this:

ToolbarManager :=
TppDesignerWindow(ReportDesigner.Form).LayoutManager.ToolManager

But that is not really pretty. Any better way?

Thanks in advance
Steffen

Comments

  • edited September 2006
    Hi Steffen,

    Take a look at the following example. It gives a few good examples on how
    to manage and customize the new toolbars for RB 10.x. From your code below
    it looks like you have the basic idea. It is possible to split that code up
    using local varialbes to make it more readable as shown in the example.

    http://www.digital-metaphors.com/tips/Designer10_CustomizeMenusAndToolbars.zip

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2006
    Thanks Nico

    Great examples, and it now work... almost. The combobox does not change when
    I set an ItemIndex.

    From my debugging it looks like I need a viewer, but I have not been able to
    find out where I should add this one.

    Any help would be appreciated.

    Best regards
    Steffen



  • edited September 2006
    Hi Steffen,

    Which combobox are you speaking of? Is this the font combobox of the format
    toolbar or something else?

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2006
    The toolbar we added contains a combobox, and if you in code changes its
    ItemIndex nothing happens. It is of type: TppDesignComboBoxToolItem.

    When debugging this issue the TppTBXCustomList.SetItemIndex is called. It
    only executes part of the code, if a viewer is attached.

    How should a viewer be attached, or is there a better way to syncronize the
    content on custom toolbars with the current selection?

    Best regards
    Steffen


  • edited September 2006

    We also encountered some issues getting the TBX combobox to work properly.
    Note that in the TppEditToolbar.CreateItems method we call the Loaded
    method. This was necessary to get the control to initilialize itself.


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited September 2006
    Yes I did see that, and have done that too, but it still does not work :-(

    Any other ideas?

  • edited September 2006

    Try setting the Text property of the combobox rather than the ItemIndex.



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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited September 2006
    Thanks guys.

    As always you supply excellent help.

    Keep up the good work.
    Steffen

This discussion has been closed.