ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to support AutoCAD 2015 Dark & Light Themes for Ribbon button Images?

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
cadsindia
5228 Views, 9 Replies

How to support AutoCAD 2015 Dark & Light Themes for Ribbon button Images?

We have a custom CUI with ribbons customized in it.

The ribbon command buttons uses button images from a resource DLL (with name same as that of CUI file).

Since single image is used as ribbon button image, the Look and Feel of the button images are not good with the AutoCAD 2015's Light and Dark themes.

 

I have attached here with the snippets of Ribbon with Dark and Light themes "AutoCAD 2015 Dark and Light Theme.png"

 

Do we need to handle button images for Dark and Light themes in a different way?

 

Please suggest on the right way to handle button images for Dark and Light themes.

9 REPLIES 9
Message 2 of 10
CWernung
in reply to: cadsindia

Hi,

 

you can do it in two ways.

 

One is to redraw your images so the work in both the dark and light themes. We haven't done that ourselves but I have heard that it isn't easy to make that look ok.

 

The other way is to create a new set of images for the dark theme. In this case you need to create a second resource dll that has the same name as your current one but with _light added before the extension.

For example:

TheGreatRibbon.cuix

TheGreatRibbon.dll          (The dark theme images)

TheGreatRibbon_light.dll  (The light theme images)

 

AutoCAD will switch between the dll's automatically when you change theme color. On problem that I have seen is that the toolbar (if anyone use them nowdays) don't change image. To make this happen you need to delete the corresponding .mnr files that AutoCAD creates in the same folder as the .cuix and .dll files.

 

Then, of course, if you use the same files for earlier AutoCAD versions you need to use the TheGreatRibbon_light.dll file but rename it to TheGreatRibbon.dll

 

/Christian

Tags (2)
Message 3 of 10
smbrennan
in reply to: CWernung

Christain - where do those DLL files come from? Are they manually created by someone who knows API programming, or can a non-programmer (like myself) figure it out? I've been trying to figure this out. But, in the interest of time, I released 2015 with dark icons only. I had a lot of changes to our custom menu & contnet as it was, so the time to change all of the icons was nothing compared to that.

 

Thanks,

Shawn

Shawn B.

  ||    
To help improve Autodesk Products, please Click Here to Vote for ideas and submit your own.
Message 4 of 10
cdcaron
in reply to: CWernung

I have a company of users who prefer toolbars...  So please address the following:

 

Since the only way for appropriate display of the tools when doing a switch is to delete the .MNR file, I've opted to NOT SUPPORT the Dark theme and pushout a default profile as light.  I use the /p switch to force load an .ARG file upon startup/initialization.  The defualt profile is set to Light, however something in the initiazation of ACA 2015 still forces the dark theme icons.  So I'm left with again deleting the .MNR file... for every user, for every machine.  Rather annoying when you attempting to customize a standard setup and install across an entire office.

 

If I could find the switch that forces the light versus dark theme, that would make me a happy CAD manager.

 

C

Message 5 of 10
cdcaron
in reply to: cdcaron

Fix it by copying the MNR file into the UserDataCache folder and that resolved the icon issue.  Lovely work arounds.

 

C

Message 6 of 10
jsoto1685
in reply to: CWernung

How does one create this dll fie?

Message 7 of 10
c3dsolutions
in reply to: CWernung

@CWernung @jsoto1685

I cannot see any .dll files in the folder of my custom .cuix file, however they do exist in the folder of the default customization files. Do I have to create new ones or copy and rename from that folder?

 

Regards,

Attila

Message 8 of 10
cdcaron
in reply to: c3dsolutions

Wow, this is an old thread.

 

I can't speak to 2015... It's been years.  I'm working on 2019 currently.  Special icons, I create a Dynamic-Link Library in C++ inside of Microsoft Visual Studio (free from Microsoft).  You need to add the DLL C++ component as it's not a part of the core download.  You add your image and associated link code in the Resource Files and .rc file, respectively as RCDATA.  Create one for default (dark) named {customCUIname}.dll, and for light {customCUIname}_light.dll.

Sample code in .rc file AFTER TEXTINCLUDE sections ENDIF:

//
// RCDATA  {Code header}
//

RCDATA_A1-16    RCDATA    "A1-16.png"        {Name referenced in CUI file   RCDATA    image name}

....

 - Make sure to end the section with an ENDIF after your entries.

 

Add your images into the Resource Files folder matching the "image name" in the above code.  Reference the icon in the CUI using "Name reference".

 

In theory this should work the same...  There may be differences in DLL structure for 2015.  Search for the above information for a more descriptive explanation.  This seemed to work best for me once I figured out all the nuances...  I'm a hack, so anyone who has better information, please correct me.

 

Good luck

C

Message 9 of 10
hawstom
in reply to: cdcaron

2020 update: This entire thread, especially Christian's descriptions and some personal help from Christian, was very instrumental in helping me finally figure this out after a week of effort. I created some sample files and a blog post to explain the entire process in detail. http://tomsthird.blogspot.com/2020/03/creating-custom-menu-button-icon-image.html

 

It turns out to be pretty simple once you finally figure it out, just like most things.

Message 10 of 10
cdcaron
in reply to: hawstom

Nice.  Thanks for putting all this together.

 

Now for Tool Palettes.... xD

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost