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

Add a new page in the designer

edited July 2006 in General
We used to have a custom page in the designer prior to RB10.
When we moved to RB10, I realised this has been replaced
by a ppNotebook. How can I add a page on this one properly?
I can manually call ppDesigner1.Notebook.AddPage('My Custom Page')
however the OnChangedTab event is not firing. I traced the condition
and it seems that it needs to be added via a designmodule class.

thanks !

Comments

  • edited July 2006

    - that is the correct code to add a page

    uses
    ppTabbedNotebook,
    ExtCtrls;

    procedure TForm1.Button1Click(Sender: TObject);
    var
    lPage: TPage;
    begin

    lPage := ppDesigner1.Notebook.AddPage('myPage');
    ppDesigner1.Notebook.SetPageIndex(lPage, 0);

    end;

    - we were not aware that the OnTabChange events were not fireing for the
    custom pages, thanks for pointing that out. A patch is now available for RB
    10.03 that corrects this. You can send an email to
    support@digital-metaphors.com and request the patch.

    - another approach is to create a TppDesignModule descendant and register it
    with RB. Then RB will create a design page that contains your design module.
    Your design module class can create and manage the user interface elements
    that comprise your workspace. This is how each of the workspaces in RB are
    implemented. A simple example is the TppDesignPreviewManager class
    (ppDesignPreview.pas) which manages the preview workspace.







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



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2006
    excellent !
    i already emailed the request for the patch.

    cheers


This discussion has been closed.