Board index » delphi » Merge menu from docking form into main menu

Merge menu from docking form into main menu

Hello,

I am using Delphi 5 on Win 95/98

Is there any way to merge menus from docking forms into the main form's menu
at run-time, so that the merged menu does not unmerge itself when the focus
switches to another docked form.
I am designing some dockable forms which will be used in a number of
separate applications, and I thought that by including a main menu on the
docking form, I could include it in the main menu of whatever application is
using it. Using the TMainMenu.Merge method and the TMainMenu.AutoMerge
property works if there is only one dockable form, but if there are two
different dockable forms, the menu for the first one disappears as soon as
focus is switched to the second one.
Any help would be appreciated.

Thanks,

Chris

 

Re:Merge menu from docking form into main menu


Chris,
 You can only merge one menu.  I found this out when writing an
article for application framework in which I was merging multiple
menus. I had to manually merge secondary menus.  You'll find this
article at:
http://www.delphimag.com/features/1999/06/di199906xp_f/di199906xp_f.asp

 -- x
==============================
Xavier Pacheco (TeamB)
xav...@xapware.com

Sorry but TeamB cannot answer support
questions received via email.

Re:Merge menu from docking form into main menu


I've found a workaround which allows me to permanently merge one menu,
by setting the FormStyle of the main form to fsMDIform (even though the app
is not MDI) and the docking forms FormStyle as fsNormal, by setting
AutoMerge to true, and also
calling Application.MainForm.Menu.Merge(DockFormMenu), the menu is added to
the main form's menu and does not disappear when form focus is switched,
however, as you noted, you can only merge one menu.

I'm not entirely happy with using a bodged method, and I'm sure there will
be implications in using an MDI form in a non-MDI app (which I'm sure will
be elaborated on...)

Chris

Xavier Pacheco (TeamB) <xav...@xapware.com> wrote in message
news:tv0p7scpl6u6jidco4c2mnr4oaied76gb0@4ax.com...

Quote
> Chris,
>  You can only merge one menu.  I found this out when writing an
> article for application framework in which I was merging multiple
> menus. I had to manually merge secondary menus.  You'll find this
> article at:
> http://www.delphimag.com/features/1999/06/di199906xp_f/di199906xp_f.asp

>  -- x
> ==============================
> Xavier Pacheco (TeamB)
> xav...@xapware.com

> Sorry but TeamB cannot answer support
> questions received via email.

Re:Merge menu from docking form into main menu


Chris,
 If you refer to my article you'll see that I'm not using MDI forms to
get this merging.  You can manually merge the menus on a non-mdi form.
 -- x
==============================
Xavier Pacheco (TeamB)
xav...@xapware.com

Sorry but TeamB cannot answer support
questions received via email.

Other Threads