afe7d996af
Before this commit, if several menu entries (possibly in different menus) had the same label after translation and latin1-ization by FGLocale::utf8toLatin1(), selecting one of them used to fire the bindings associated to all such entries. This is because the bindings used to be stored in an std::map whose keys were the translated-and-latin1-ized labels. This commit fixes the problem in the following way: - the std::map (_bindings) is turned into an std::forward_list; - each element of this std::forward_list references the bindings assigned to a menu entry; - in order to allow FGPUIMenuBar::fireItem() to find the bindings assigned to the menu entry that triggered it, FGPUIMenuBar::make_menu() calls puMenuBar::add_submenu() with an additional argument ("user data") that attaches to the puObject for each menu entry a pointer to the relevant element of _bindings. Note: given how the menubar is created, an std::vector wouldn't be appropriate for _bindings, because we need the pointers to its elements to be stable when new elements are added to _bindings. Reported by Wayne Bragg: https://sourceforge.net/p/flightgear/mailman/message/37682605/ |
||
---|---|---|
.. | ||
Add-ons | ||
AIModel | ||
Aircraft | ||
Airports | ||
ATC | ||
Autopilot | ||
Canvas | ||
Cockpit | ||
EmbeddedResources | ||
Environment | ||
FDM | ||
GUI | ||
Include | ||
Input | ||
Instrumentation | ||
Main | ||
Model | ||
MultiPlayer | ||
Navaids | ||
Network | ||
Radio | ||
Scenery | ||
Scripting | ||
Sound | ||
Systems | ||
Time | ||
Traffic | ||
Viewer | ||
CMakeLists.txt |