Syntax for adding Icon to Pulldown menu.

Syntax for adding Icon to Pulldown menu.

Julio_Soto
Advisor Advisor
1,318 Views
7 Replies
Message 1 of 8

Syntax for adding Icon to Pulldown menu.

Julio_Soto
Advisor
Advisor

I know you can add icon to pull down menus the way ACAD has in their default menus.  What would be the syntax for doing this in an mnu file?  I tried using the syntax I used to use in the toolbars but this doesn't work.  I don't want to add this via the CUI because editing large menus becomes incredibly time consuming.  It found a few customization guides for older versions but they don't seem to cover this.  Maybe it wasn't an option then. 

 

I have an excel sheet set up to compile all the code with "textjoin" which I then copy/past into the mnu file for loading. I want to add this icon sytax to this sheet. 

0 Likes
1,319 Views
7 Replies
Replies (7)
Message 2 of 8

ronjonp
Mentor
Mentor

I have not done this in years but if I remember correctly, if you have your button images correctly assigned to your buttons ( I use a compiled DLL same name as .mns ) the images in the pulldown *should showup when you refefence the same button command.

 

Here's a snippet of what I have:

//	Old School but backwards compatible and AutoCAD automagically converts to CUI for newer versions :)
//

***MENUGROUP=IDT

***POP30
**IDT
IDT_M0	[IDT]
		[Draw &Pipes]^C^CIDT_InsertPipes;
		[Paint Pipes]^C^CIDT_PaintBrush;
		[Pipe Hops]^C^CHop;
		[Pipe Labels]^C^CIDT_PipeLabels;

***TOOLBARS

**IDT_PIPES
IDT_PIPES_0	[_Toolbar("IDT_Pipes",_Floating, _Show, 380, 160, 1)]
IDT_PIPES_1	[_Button("Pipes", "IDT_InsertPipes", "IDT_InsertPipes")]^C^CIDT_InsertPipes;
IDT_PIPES_2	[_Button("Paint Pipes", "IDT_PaintBrush", "IDT_PaintBrush")]^C^CIDT_PaintBrush;
IDT_PIPES_3	[_Button("Pipe Hops", "IDT_PipeHops", "IDT_PipeHops")]^C^CHop;
IDT_PIPES_3	[_Button("Pipe Labels", "IDT_PipeLabels", "IDT_PipeLabels")]^C^CIDT_PipeLabels;

***HELPSTRINGS

//
//      End of AutoCAD menu file - C:\Program Files\AutoCAD Tools\IDT\Menu\IDT.mns
//

image.png

0 Likes
Message 3 of 8

Julio_Soto
Advisor
Advisor

Oh interesting.  So I need to create toolbar buttons for all of my commands?  

 

For my pull down, it's nested an when you get to the end of the tree many of the command have the same name.  For example, the command may say "Front" for the front view of a block.  in my CUI there are quite a few commands with the name "Front".  I suppose as long as the ID is different it shouldn't be a problem.  I noticed that in the cui each button gets an "Element ID".  Is that what "IDT_PIPES_1" refers to in your example?

 

I'm going to do some experimenting later today and report back. 

0 Likes
Message 4 of 8

ronjonp
Mentor
Mentor

 


@Julio_Soto wrote:

Oh interesting.  So I need to create toolbar buttons for all of my commands?  

 

For my pull down, it's nested an when you get to the end of the tree many of the command have the same name.  For example, the command may say "Front" for the front view of a block.  in my CUI there are quite a few commands with the name "Front".  I suppose as long as the ID is different it shouldn't be a problem.  I noticed that in the cui each button gets an "Element ID".  Is that what "IDT_PIPES_1" refers to in your example?

 

I'm going to do some experimenting later today and report back. 


I think those element ID's can be tied to the ***HELPSTRINGS section so the buttons can have a description when you hover over them. Like I said though .. this is some voodoo magic I messed with many years ago so take my advice with a grain of salt :-).

 

Not sure if you've seen THIS ... but there is a ton of info in it for customizing old school menus.

0 Likes
Message 5 of 8

Julio_Soto
Advisor
Advisor

I had forgotten that I posted this question already.  I copy/pasted your example and reworked it but I don't really understand what's happening lol.

Julio_Soto_0-1661787082586.png

 

0 Likes
Message 6 of 8

Julio_Soto
Advisor
Advisor

I did another test, and it appears as the menu item and toolbar item are linked through the actual macro.  Like I mentioned, I have many menu items that have the same name.  If the button name and menu name have the same macro the images are linked to both. 

0 Likes
Message 7 of 8

Sea-Haven
Mentor
Mentor

Do you want this ? Its old fashioned mnu using image section. You need to make slides for the images but that can be scripted etc so make 20-30 or more at a time. I did do a make mnu to save some time just writes a text file/mnu.

 

SeaHaven_0-1661822789863.png

Same with toolbar.mnu but it has icons which are BMP files. 

 

Can provide example code.

 

 

 

0 Likes
Message 8 of 8

Julio_Soto
Advisor
Advisor

Sure, I'd like to give it a shot.

0 Likes