It turns out that moving the sample gallery into the main menu was only a little bit troublesome and only took an hour for me to figure out how to fix. The problem appeared to be that the MFC code created a new gallery window of some sort when displaying my sample gallery and it was that temporary window that held the number of the selected item. After stepping through the Microsoft code for an hour or more, I finally saw that a hash table was being set to contain the last selected item for the main menu, gallery, or whatever. The key to the table was the ID of my gallery window even though the window being displayed and used was not.

So in the end, I needed to call the GetLastSelectedItem( MyGalleryID ) function for my gallery window instead of the GetSelectedItem() function for my gallery window. The last selected item seems to be common for all ribbon bar windows and controls, or so it seems.

image

Samples in the Main Menu

The Sample Gallery is now where it should be. I may change the icon to look more like the Open… icon at some point but having it the same as before will be helpful to anyone who used the program in the past.

image

Ribbon Bar Without Samples

And of course the ribbon bar now has a bit more room.

I also added an icon for the Select All button so that it could be shrunk down to just an icon and no text if the window gets too narrow. I still have not figured out how to tell the ribbon bar code which buttons and controls to shrink first and which are important and need to stay visible as much as possible. I would prefer to have the Clipboard panel be reduced to a single button before any other panel is shrunk at all.

I wanted to move the Insert/Elements panel to the very right side because it probably does not get used much but moving things around is a sure way to piss off existing users. The changes that I already make are bad enough.

Dave