Deactivate menu options
Hello,
We are trying to deactivate the "save as", "Import", "Export" options
in the report builder menu's (Design, Preview, Data, Calc).
So far I've managed to "find" the code and deactivate everything but
the Calc (RAP).
We don't have the code of rap so I don't know where the menu's are.
This is the code for the design tab.
---------
if (ppDesigner.Form.DesignModules.Items[iLoop] is
TppDesignLayoutManager) then
begin
with
TppDesignLayoutManager(ppDesigner.Form.DesignModules.Items[iLoop]).ToolManager.Menubar
do
begin
FileMenu.SaveAs.Visible := False;
end;
end;
---------
Is there something similar I can do for the calc tab?
(Or another may be "easier" way to do it ?!?!)
Thankx,
Chantal
We are trying to deactivate the "save as", "Import", "Export" options
in the report builder menu's (Design, Preview, Data, Calc).
So far I've managed to "find" the code and deactivate everything but
the Calc (RAP).
We don't have the code of rap so I don't know where the menu's are.
This is the code for the design tab.
---------
if (ppDesigner.Form.DesignModules.Items[iLoop] is
TppDesignLayoutManager) then
begin
with
TppDesignLayoutManager(ppDesigner.Form.DesignModules.Items[iLoop]).ToolManager.Menubar
do
begin
FileMenu.SaveAs.Visible := False;
end;
end;
---------
Is there something similar I can do for the calc tab?
(Or another may be "easier" way to do it ?!?!)
Thankx,
Chantal
This discussion has been closed.
Comments
Take a look at the following example on hiding the DADE menu items. You
should use a similar method to hide the RAP menu items. Below are the
changes that need to be made.
http://www.digital-metaphors.com/tips/Designer10-HideDataMenuItems.zip
uses
raIDE;
procedure TForm1.ppDesigner1TabChanged(Sender: TObject);
var
lSubMenu: TppTBCustomItem;
lCodeFileMenu: TraCodeFileSubMenu;
begin
if (ppDesigner1.Notebook.ActivePageIndex = 1) then //Calc tab
begin
// this can be used to get at any menu times
lSubMenu := ppDesigner1.Menu.Items[0]; // get file menu
ShowMessage(lSubMenu.Items[0].Caption);
// For the Data | File menu we can typecast as TdaDataFileMenu
// The TdaDataFileMenu class has properties that correspond to the
items,
// see RBuilder\Source\daDataManager for the class declaration
if (lSubMenu is TraCodeFileSubMenu) then
begin
lCodeFileMenu := TraCodeFileSubMenu(lSubMenu);
lCodeFileMenu.Export.Visible := False; // hide Export menu item
end;
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Chantal
On Fri, 30 May 2008 08:45:06 -0600, "Nico Cizik \(Digital Metaphors\)"