I have created merged menus so that I can get the RAP Language guide in the report designer. But how can I add it to the Help menu when the Calc tab is selected (where it is needed most)
Rather than using a merge menu, you need to programmatically access the TppDesigner.Menu property when the Calc page becomes active. Then traverse the menu items and subitems and customize things as desired. You can enable/disable items, set item visibility, and assign event-handlers:
The code below uses the Designer OnTabChanged event to access the Help menu item. The next step (not shown here) would be to traverse the subitems of the HelpMenu and assign an event-handler.
procedure TForm1.ppDesigner1TabChanged(Sender: TObject); var lHelpMenu: TMenuItem; begin ShowMessage(ppDesigner1.Notebook.ActivePage.Caption);
if (ppDesigner1.Notebook.ActivePage.Caption = 'Calc') then begin lHelpMenu := ppDesigner1.Menu.Items[3]; ShowMessage(lHelpMenu.Caption)
Comments
Couple of options:
Rather than using a merge menu, you need to programmatically access the
TppDesigner.Menu property when the Calc page becomes active. Then traverse
the menu items and subitems and customize things as desired. You can
enable/disable items, set item visibility, and assign event-handlers:
The code below uses the Designer OnTabChanged event to access the Help menu
item. The next step (not shown here) would be to traverse the subitems of
the HelpMenu and assign an event-handler.
procedure TForm1.ppDesigner1TabChanged(Sender: TObject);
var
lHelpMenu: TMenuItem;
begin
ShowMessage(ppDesigner1.Notebook.ActivePage.Caption);
if (ppDesigner1.Notebook.ActivePage.Caption = 'Calc') then
begin
lHelpMenu := ppDesigner1.Menu.Items[3];
ShowMessage(lHelpMenu.Caption)
end;
end;
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com