[edit] That's pretty funny! I didn't notice you'd mentioned it, but notice the accelerator key "lshift f10" in the XML file below . . .
All of these would have actions specified by the same set of action identifiers (the strings in the aforementioned map). Plugins could expose their actions through the same interface (via. registration with an action manager), so actions not built into the menus could also be customized.
That's precisely the kind of thing in mind when I created this part of xuni.
[/edit]
In case you're interested, I did something quite similar to this with my project xuni. Basically, different menus or screens could be specified in .so files, which could then be loaded by name.
I added support for loading .so files using the SDL, and using just libdl, and using hard-coded names in case neither of these was supported. (I never implemented Windows support for this, unfortunately; I just used static names on Windows.) The code for this is in src/loadso.c and src/loadso.h (you can download xuni's source from here).
Menus were specified in XML files; here's a sample of one.
Code:
<?xml version="1.0"?>
<!-- gui/data/game.xml -->
<xuni-resource xuni-version="0.3.0" type="gui-data">
<widget type="panel" name="game">
<width>100</width>
<height>100</height>
<visible>0</visible>
<handler file="src/test/libtest.so">
<init>game_init</init>
<start>game_start</start>
<event>game_event</event>
<click>game_click</click>
<paint>game_paint</paint>
<free>game_free</free>
</handler>
<widget type="image">
<name>background 1</name>
<xpos>0</xpos>
<ypos>0</ypos>
<width>100</width>
<height>100</height>
<path>../background/m31.jpg</path>
<selable>0</selable>
</widget>
<widget type="button">
<name>menu</name>
<xpos>100.0 - 100.0 / 8</xpos>
<ypos>0</ypos>
<width>100.0 / 8</width>
<height>100.0 / 15</height>
<text>Menu</text>
<accelerator>lshift f10</accelerator>
</widget>
<widget type="button">
<name>layer 1</name>
<xpos>30</xpos>
<ypos>30</ypos>
<width>20</width>
<height>10</height>
<text>1</text>
</widget>
...
As you can see, handler functions for certain actions are specified by name, along with the library in which those functions are found. These handlers would then reference widgets in the menu by name.
I don't think I ever got to the point where you could add an entirely new menu without adding at least another enum value, but you certainly could if you put your mind to it. One tip: consider always using strings. I opted out of that for efficiency reasons, but it made the code much harder to understand and less flexible.
My code is probably way too confusing for you, but it's so similar to this that I just had to mention it. If you're interested, feel free to ask me more questions about it.
Disclaimer: xuni's code isn't the most readable, and it is in C (not C++), so it's not as simple as it could be. This is the kind of thing that C++ lends itself really well to.