Change Popup menu on Designer.
Hi All,
First Please Forgive me I Don't use news Groups very often and I'm New to
Report Builder.
I have an Enduser Program that I would like to Remove the 'Data Tree' and
'Report Tree' from the Popup menu( the right click on the toolbar) in the
Designer. I have try the ToolBarManager But it Does not seem to be building
the Menu from there. Any Ideas?
Thank you
--
Glenn@ cassoftware.com
Web www.cassoftware.com
First Please Forgive me I Don't use news Groups very often and I'm New to
Report Builder.
I have an Enduser Program that I would like to Remove the 'Data Tree' and
'Report Tree' from the Popup menu( the right click on the toolbar) in the
Designer. I have try the ToolBarManager But it Does not seem to be building
the Menu from there. Any Ideas?
Thank you
--
Glenn@ cassoftware.com
Web www.cassoftware.com
This discussion has been closed.
Comments
The same menu items are used for the Designer's View | Toolbars menu and the
popup menu. You can use the TppDesigner.Menu property to access the items
and toggle their visibility.
Here is an example that hides the report tree...
Example:
uses
menus;
procedure TForm1.Button1Click(Sender: TObject);
var
lViewMenu: TMenuItem;
lToolbarsMenu: TMenuItem;
begin
lViewMenu := ppDesigner1.Menu.Items[2];
lToolbarsMenu := lViewMenu.Items[0];
lToolbarsMenu.Items[3].Visible := False; // report tree
ShowMessage(lToolbarsMenu.Items[3].Caption);
ppDesigner1.Show;
end;
--
Thanks for supporting ReportBuilder! Please vote for ReportBuilder in the
Delphi Informant Readers Choice awards!
http://www.delphizine.com/ballot2004/
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
--
Glenn@cassoftware.com
Web www.cassoftware.com
Voice 909-335-1205
fax 909-793-6974
I have another Question Alone the same lines. Can I control the Tool Bar
menu? Like I would like to remove the Open New? and Change the Open File to
my Custom Open?
--
Glenn@cassoftware.com
Web www.cassoftware.com
Voice 909-335-1205
fax 909-793-6974
You can remove the Designer menu options as describe before. However to
remove the toolbar options would require that you modify the source code -
that is the only way.
Below is an article that lists some options for controlling open/save
actions....
-------------------------------------------------------
Tech Tip: Controlling Designer New, Save, Open actions
-------------------------------------------------------
There are several options for controlling the actions
that occur when a user opens, saves, or creates a new report.
1. Use Report.Template events: OnLoadStart, OnLoadEnd,
OnSaveStart, OnSaveEnd and OnNew.
These events are frequently used to add additional functionality - such as
saving and reading additional meta data when a report loads. They are also
used for performing initializations when a report loads or a new report is
created.
2. Use the TppDesigner.OnOpenDoc and OnSaveDoc.
If you code event-handlers for these events, then the ReportDesigner will
rely on your event-handler code to load and save reports rather than its own
internal logic.
3. Use the TppDesigner.Menu property to access the menu items and attach you
own event-handlers.
--
Tech Support mailto:support@digital-metaphors.com
Digital Metaphors http://www.digital-metaphors.com
--
Thanks for supporting ReportBuilder! Please vote for ReportBuilder in the
Delphi Informant Readers Choice awards!
http://www.delphizine.com/ballot2004/
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Thanks for the Info. I am not wanting to change Source. Could you give me
an Example of How to Change the New Button on the Tool Bar. Everything I
have tried Still gives me the Wizard before Running my code I Do not want to
show the Wizard.
Thank you
--
Glenn@cassoftware.com
For future reference, please choose either the newsgroups or
support@digital-metaphors.com.
I researched this and there is no way to control the behavior of the New
button on the Standard toolbar without modifying the source code. The New
button of the Standard toolbar calls the TppDesignerWindow.FileNewClick
method. See ppDsgner.pas
Whether you modify the source is your decision, we do not encourage it, but
sometimes there is no other way to customize a behavior.
--
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com