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

Designer without open/save file - menu items

edited August 2002 in General
Hi

How can i set the menuitems like "Open report" or "Save report" invisible?
When the user closes the designer the programm should take the control for
saving the reports.

Best regards

Robert

Comments

  • edited August 2002
    You can edit the menu property of the designer. Search this newsgroup for
    prior questions on this. It would be something like:

    unit HideSave;

    interface

    uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls, ppEndUsr, ppComm, ppRelatv, ppProd, ppClass, ppReport,
    ppBands, ppCache;

    type
    TForm1 = class(TForm)
    ppReport1: TppReport;
    ppDesigner1: TppDesigner;
    Button1: TButton;
    ppHeaderBand1: TppHeaderBand;
    ppDetailBand1: TppDetailBand;
    ppFooterBand1: TppFooterBand;
    procedure Button1Click(Sender: TObject);
    procedure ppDesigner1TabChanged(Sender: TObject);
    procedure ppDesigner1TabChange(Sender: TObject; NewTab: String;
    var AllowChange: Boolean);
    private
    { Private declarations }
    FNewTab: String;

    public
    { Public declarations }
    end;

    var
    Form1: TForm1;

    implementation

    {$R *.dfm}

    uses
    raIDE, daIDE;

    procedure TForm1.Button1Click(Sender: TObject);
    begin

    FNewTab := 'Design';

    ppDesigner1.Menu.Items[0].Items[4].Visible := False;
    ppDesigner1.Menu.Items[0].Items[5].Visible := False;
    ppDesigner1.Menu.Items[0].Items[6].Visible := False;

    ppDesigner1.ShowModal;

    end;

    procedure TForm1.ppDesigner1TabChanged(Sender: TObject);
    begin

    if (FNewTab = 'Calc') then
    begin
    ppDesigner1.Menu.Items[0].Items[0].Visible := False;
    ppDesigner1.Menu.Items[0].Items[1].Visible := False;
    end

    else if (FNewTab = 'Design') or (FNewTab = 'Preview') then
    begin
    ppDesigner1.Menu.Items[0].Items[4].Visible := False;
    ppDesigner1.Menu.Items[0].Items[5].Visible := False;
    ppDesigner1.Menu.Items[0].Items[6].Visible := False;
    end;

    end;

    procedure TForm1.ppDesigner1TabChange(Sender: TObject; NewTab: String; var
    AllowChange: Boolean);
    begin
    FNewTab := NewTab;
    end;


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.