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

Customized preview & adding/modifying buttons - RB10

edited March 2006 in General
I'm back visiting the upgrade to RB10 and trying to
get my customized Preview from RB7 to work

I have taken into account the change of
CreateToolbarControls to CreateToolbarItems

but I having trouble locating the buttons and associated
toolbar. The example code (listed in a recent thread)

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

seems to be the code for other than RB10 (unless I missed something).

I need to be able to add some buttons and hide some buttons.
A specific code example for RB 10 would be great.

Thanks,
Jon

Comments

  • edited March 2006
    Hi Jon,

    I uploaded a new version of the demo you mentioned below that works with RB
    10.x. If you are looking to add buttons to the toolbar, take a look at the
    CreateToolbarItems inside the ppPreview.pas file for an example of how this
    should be done. You can also take a look at the TppToolbar class located
    inside the ppToolbarTBX.pas file for other helper function for creating
    toolbars.

    --
    Regards,

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

    Best Regards,

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

    The new example works fine

    2 more questions.

    1. When I add buttons how to insert within the existing buttons
    rather than just at the end. Right at the beginning would
    be a satisfactory compromise.

    2. How to assign images to my new buttons. I have the resource that
    I created & used with my RB7 buttons.

    I had all of this working in RB7 but the new design is challenging
    my senior citizen brain :-)

    Jon

  • edited March 2006
    Hi Jon,

    1. It's possible to add a new button to the beginning of the toolbar by
    simply placing the code before the inherited call. Example...

    uses
    ppTBX;

    procedure TMyPreviewPlugin.CreateToolbarItems;
    begin

    FMyButton := Toolbar.AddButton();
    FMyButton.Images := MyImageList;
    FMyButton.ImageIndex := 0;
    FMyButton.OnClick := ehToolbutton_Click;

    inherited;

    PrintButton.Visible := False;

    end;

    - If you need to insert a button, you will need to recreate the entire
    toolbar from scratch and add the buttons you need.

    2. Each TppTBXItem contains an Images property to assign its own image
    list. You will need to give your new button a custom image list in order to
    display a custom image.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.