Author Topic: button images  (Read 5321 times)

0 Members and 1 Guest are viewing this topic.

AfricaAD

  • Guest
button images
« on: November 16, 2004, 12:41:37 PM »
I am trying to compile all the images from our toolbars into a dll. There are about 90 bmp's. When I compile about half of them into the dll, the images will appear & the smiley's for the ones missing. But once I compile all of them into the dll, they all turn to smileys.
I have checked the mns file, pathing, names, and all seems fine.

Am I missing something?
Is there a max limit of images in a dll?
Are there any characters that you cannot use in a dll?

Mns sample:
Code: [Select]
ID__54         [_Button("STEEL PIPE", "PIPE", "ICON_24_BLANK")]^C^CPIPE

M-dub

  • Guest
button images
« Reply #1 on: November 16, 2004, 12:57:06 PM »
This might seem like a stupid question, but are all of them 16 x 15 pixels?

In the example you have shown, the icon name is "PIPE".  Is that how you have named it in your DLL?  To stay with some sort of standard, I used the prefix ICON_16_whatever and ICON_24_Blank (because no one uses the large icons and I didn't feel the need to create them).  What I'm saying is that the two have to match.  If you've named it ICON_16_PIPE in the DLL, you have to refer to it in your menu as ICON_16_PIPE as well....
Does that help at all?

M-dub

  • Guest
button images
« Reply #2 on: November 16, 2004, 12:57:54 PM »
Also, the dll file has to have the same name as your menu file and also must reside in the same directory.

AfricaAD

  • Guest
button images
« Reply #3 on: November 16, 2004, 02:08:20 PM »
Yes, they are of 16x15, cuz I used the original images.  :wink:
Yes, PIPE is the name in the dll.
Yes, the name of the dll is the same as the menu name & is located in the same directory.

AVCAD

  • Guest
button images
« Reply #4 on: November 16, 2004, 02:10:32 PM »
I dont like DLL files for these, for some reason they always get screwed up for me.

Just take all the individual BMP files through them in one directory and tell it where to get the button file at.

Code: [Select]

[_Button("Laptop", "G:/CHI-CUSTOMCAD/BUTTONS/LAPTOP.bmp", "G:/CHI-CUSTOMCAD/BUTTONS/LAPTOP.bmp")]^C^Csnap;.25;-insert;"G:/CHI-CUSTOMCAD/SYMBOLS/laptop.dwg";\;;;


works for me and they never get lost.

M-dub

  • Guest
button images
« Reply #5 on: November 16, 2004, 02:12:22 PM »
ok....Hmmm.......



You've tried reloading the menu?
Sorry, I'm running out of ideas...

M-dub

  • Guest
button images
« Reply #6 on: November 16, 2004, 02:15:38 PM »
Actually, I just noticed something, but I'm not sure if it would result in smilies....

You have two underscores where there should be one. (I think)

ID__54 should be
ID_54


:?:

M-dub

  • Guest
button images
« Reply #7 on: November 16, 2004, 02:21:04 PM »
Also, are you working on the MNS or the MNU file?  Regardless of which one it is, you should ALWAYS ALWAYS ALWAYS keep a backup copy every time you go to make a change.  Make a copy and rename it to MenunameMNS.old or MenunameMNU.old...something like that...you get the idea, right? ;)

AfricaAD

  • Guest
button images
« Reply #8 on: November 16, 2004, 02:42:14 PM »
Quote from: M-dub

ID__54 should be
ID_54
:?:


Odd, worked for bitmaps. Not all of them have the 2 underscores, & they all still have smileys.

M-dub

  • Guest
button images
« Reply #9 on: November 16, 2004, 02:45:13 PM »
...and you HAVE in fact reloaded the menu?
ie; MENULOAD command?

AfricaAD

  • Guest
button images
« Reply #10 on: November 16, 2004, 02:49:43 PM »
Yup! Reloaded, deleted the mnc & mnr, removed the double "_", still same thing. I think I will just split the menu & dll's & reconstruct from there. :(

M-dub

  • Guest
button images
« Reply #11 on: November 16, 2004, 02:53:18 PM »
Quote from: The AutoCAD Help File
In the Toolbars section of an MNU file, you can create toolbars with buttons, flyouts, and special control elements and use your own bitmaps for the button icons.

If you just want to create or change toolbars or create, rearrange, add, or remove buttons and flyouts, you can use CUSTOMIZE. See Create Custom Toolbars.

The menu item syntax for the Toolbars section of the MNU file is shown in the following example. All lines other than the separator begin with a standard name tag, which is used to associate help information with the item. In the example, **TOOLS1 is a submenu that uses the alias TOOLS1 as a label to reference the subsequent toolbar definition.

***TOOLBARS
**TOOLS1
TAG1 [Toolbar ("tbarname", orient, visible, xval, yval, rows)]
TAG2 [Button ("btnname", id_small, id_large)]macro
TAG3 [Flyout ("flyname", id_small, id_large, icon, alias)]macro
TAG4 [Control (element)]
[--]
The first line of a toolbar submenu is the toolbar definition (TAG1 in the example), which defines the characteristics of the toolbar. The remaining lines in the submenu can be a mix of the remaining toolbar items. The second line in the example above (TAG2) defines a button. The third line (TAG3) defines a flyout control, and the fourth line (TAG4) defines a special control element. The fifth line defines a separator (--).

The toolbar definition includes the keyword Toolbar and a series of options that are contained in parentheses. The options define the display characteristics of the toolbar.

TAG1 [Toolbar ("tbarname", orient, visible, xval, yval, rows)]
The options are as follows:

tbarname

The string that names the toolbar. The string must include alphanumeric characters with no punctuation other than a dash (–) or an underscore (_). With this name (along with the alias) the toolbar can be referenced programmatically.

orient

The orientation of the toolbar. The values are floating, top, bottom, left, and right and are not case-sensitive.

visible

The visibility of the toolbar. The values, show and hide, are not case-sensitive.

xval

A numeric value specifying the X coordinate in pixels. This value is measured from the left edge of the screen to the left side of the toolbar.

yval

A numeric value specifying the Y coordinate in pixels. This value is measured from the top edge of the screen to the top of the toolbar.

rows

A numeric value specifying the number of rows.

The folllowing example is the first few lines of the Zoom toolbar in acad.mnu:

**TB_ZOOM
ID_TbZoom [_Toolbar("Zoom", _Floating, _Hide, 100, 380, 1)]
ID_ZoomWindo [Button("Zoom Window", ICON_16_ZOOWIN, ICON_16_ZOOWIN,)]'_zoom_w
ID_ZoomDynam [Button("Zoom Dynamic", ICON_16_ZOODYN, ICON_16_ZOODYN,)]'_zoom_d
ID_ZoomScale [Button("Zoom Scale", ICON_16_ZOOSCA, ICON_16_ZOOSCA,)]'_zoom_s
Note  Each line begins with ID and there are no line breaks.

To control Toolbars with partial menus, use the following syntax at the Toolbar Name prompt of the -TOOLBAR command:

menugroup.toolbarname
The following AutoLISP code displays the toolbar MYBAR in the menu group MYGROUP. (This code assumes that the MYGROUP menu is already loaded.)

(command "toolbar" "mygroup.mybar" "show")
If menugroup is not included, then AutoCAD defaults to the base menu.

M-dub

  • Guest
button images
« Reply #12 on: November 16, 2004, 02:55:01 PM »
Could you send me the mnu & mns files and the dll file?  Zipped up, of course...
mwilliams (at) terraindustries.com

AfricaAD

  • Guest
button images
« Reply #13 on: November 16, 2004, 05:40:21 PM »
After separating into 4 different mns & re-combining, I got it to work. I removed some other unnecessary characters which was interfering with the code.

Thanks for the help!

M-dub

  • Guest
button images
« Reply #14 on: November 17, 2004, 08:05:26 AM »
Glad you got it working.


...I wasn't much help at all!  You did it!

;)