Is it possible to have a custom grayed out icon in the ribbon when this icon has been used at least once? For example, the user clicks on this icon and it becomes gray to notify the user it has been used. The purpose is to load certain DLL with Netload only once.
Solved! Go to Solution.
I could not find a way to control the appearance of single button in the ribbon directly. However, it is possible to emulate the behavior quite well, by switching from one pre-defined workspace to another pre-defined workspace. I assume you are a bit familiar with Customize User Interface and workspaces.
To do this, You have to take the following step (reads more complicated than it is):
- Make a alternate image for the button, redraw it in such a way that it appears to be grayed-out
- Make a copy of the ribbon panel that contains the button you want the user see as changed. The original panel will be used to show in the initial load of the interface, the second version of the panel will be used to show after the load of the DLL's. Therefore, in the second version of the panel, you have to replace the button image for the grayed-out version of the image, and replace the macro to do nothing (or show an alert box that the stuff has been loaded already). For these two versions of the panel, you may keep the field Display Text identical. This is the panel label as it is shown to the user, so for the user both panel versions will appear to be the one and the same.
- Next, make a copy of the associated ribbon tab. In the second version of the tab, replace the original panel with the version that contains the grayed-out button. Again, for both versions of the tab you may keep the field Display Text identical, for the same reason.
- Next, save and customize two different workspaces. The workspace you use initially has to show the tab that contains the panel with the "working" button image and hide the alternative tab. The alternative workspace is intended to be current after the DLL's has been loaded, so this has to hide the initial tab and show the alternative tab that contains the panel with the grayed-out button image.
- Finally, the macro of the "working" button in the original panel, should not only load the desired DLL's, but make the alternative workspace current as well. For that second part, you can use (setvar "wscurrent" " [YOUR WORKSPACE NAME] ")
I've been able to roll-out similar pre-defined workspaces for all our users, by saving the workspaces in the Enterprise Customization File. This makes my pre-defined workspaces read-only for users, while still allowing users to save their own personal workspaces.