JAM-Software / RibbonFramework

Delphi wrapper and standalone Designer for the Windows Ribbon Framework
Other
200 stars 58 forks source link

Unique resource ids #118

Closed markwilliams1234 closed 4 years ago

markwilliams1234 commented 4 years ago

The new ribbon designer has the ability to generate a unique resource id for a single command. However, this will not work if you have different ribbons in the same application. For example, if you have a resource with id 2 in your first ribbon, but not in your second, the ribbon app will happily pick up id 2 for the second ribbon resulting in a conflict.

I did submit some code to deal with this a year or two ago which was a button and edit that allowed you to set the minimum value of the starting id and it then applied a unique id for all resources in the ribbon starting from that number. So, for example, you could have your first ribbon with ids commencing at 2, your next ribbon at 10000 and so on thus avoiding conflict.

Clearly, this overwrites any ids already set, but I wouldn't have thought that was an issue given how important it would be to avoid conflicting resource ids between different ribbons.

markwilliams1234 commented 4 years ago

My bad! Just noticed that the auto generate for all ids is a menu item rather than a button on the toolbar