Author Topic: How do you add a submenu to a PopMenu when building a CUI in .net  (Read 3323 times)

0 Members and 1 Guest are viewing this topic.

Peter Laker

  • Guest
I'am trying to build a CUI partial menu in .net but can't see how to add submenu's to a pop menu.

In the .net samples for the CUI I can see how to build a cui menu with sub items & a separator but can't find any info on how to add a sub menu to a popmenu.

This code is from the menusample.cs in .net samples
Code: [Select]
// Add new Items to a PopMenu
private void addItemsToPM(PopMenu pm)
{
PopMenuItem pmi = new PopMenuItem(pm,-1);
pmi.MacroID = "ID_AUGI";pmi.Name = "Autodesk User Group International"; //sub item

pmi = new PopMenuItem(pm,-1); //separator

            pmi = new PopMenuItem(pm,-1);
pmi.MacroID = "ID_CustomSafe";pmi.Name = "Online Developer Center"; //sub item
}
 

« Last Edit: June 10, 2009, 05:24:25 AM by Peter Laker »

Glenn R

  • Guest
Re: How do you add a submenu to a PopMenu when building a CUI in .net
« Reply #1 on: June 09, 2009, 05:42:46 PM »
Guessing here, but try adding another PopMenu to PopMenuItem pmi...

Peter Laker

  • Guest
Re: How do you add a submenu to a PopMenu when building a CUI in .net
« Reply #2 on: June 10, 2009, 05:21:42 AM »
Thanks Glenn but no go.

The popmenuitem doesn't contain a definition for a popmenu.

 

Draftek

  • Guest
Re: How do you add a submenu to a PopMenu when building a CUI in .net
« Reply #3 on: June 10, 2009, 01:38:18 PM »
You may have to use Windows API calls to do that.

Glenn R

  • Guest
Re: How do you add a submenu to a PopMenu when building a CUI in .net
« Reply #4 on: June 10, 2009, 03:54:35 PM »
Peter, I'm not sure of your Acad version, but it appears that PopMenuRef is what you're after.

Peter Laker

  • Guest
Re: How do you add a submenu to a PopMenu when building a CUI in .net
« Reply #5 on: June 10, 2009, 05:54:01 PM »
Thanks Glenn & Draftek, I'm using Autocad 2008.

I will have a play with the PopMenuRef.