Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create a different popup for different mdichild window?

Status
Not open for further replies.

pierrotsc

Programmer
Nov 25, 2007
358
US
I am writing an paint application. It opens mdichild window each time i open a file or create a new one.
I would like to know if it is possible to add a popup menu that is specific to each mdichild.
I know on how to add items to a menu. Every time I create a layer in the mdichild window, i add it to the popup list using the tmenuitem(popupmenu);
popupmenu.items.add(Newitem);

Now when i click to a different window, i would like to access the popup that is linked to the same window. I do not want the popup populated in window1 to show in window2.

To create a new window I use:
Child := TMDIChild.Create(Application);
Child.Caption := Name;

If it involves a lot of coding or it's too much a pain, let me know.

Thanks.
PO
 
Hi,

If your TPopupMenu takes place in a TFrame.
Then, if you insert the TFrame in your MDIChild form.
This way, you will have only one base TPopupMenu with different instances (or forms).

I think it will work.

Hope this helps

Rej Cloutier
 
just assign the desired popupmenu when you create the child.

Child1.PopupMenu := PopupMenu1;
Child2.PopupMenu := PopupMenu2;

Aaron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top