X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FGUI%2Fmenubar.cxx;h=513277dfc0f97f1dbd5b75feff4166996033b95e;hb=5cad5aa7da2476ca8323a61f81dea59676dca085;hp=9cacef59c7d68e840ea3600eff0f12c569f49bc7;hpb=284c73a95ce2d799ba5075cccac2e948817a6968;p=flightgear.git diff --git a/src/GUI/menubar.cxx b/src/GUI/menubar.cxx index 9cacef59c..513277dfc 100644 --- a/src/GUI/menubar.cxx +++ b/src/GUI/menubar.cxx @@ -6,8 +6,8 @@ #include #include #include +#include -#include #include
#include "new_gui.hxx" @@ -26,39 +26,31 @@ // user-configured dialogs and new commands where necessary. //////////////////////////////////////////////////////////////////////// -extern void reInit (puObject *); -static bool -do_reinit_dialog (const SGPropertyNode * arg) -{ - reInit(0); - return true; -} - #if defined(TR_HIRES_SNAP) -extern void dumpHiResSnapShot (puObject *); +extern void dumpHiResSnapShot (); static bool do_hires_snapshot_dialog (const SGPropertyNode * arg) { - dumpHiResSnapShot(0); + dumpHiResSnapShot(); return true; } #endif // TR_HIRES_SNAP #if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__) -extern void printScreen (puObject *); +extern void printScreen (); static bool do_print_dialog (const SGPropertyNode * arg) { - printScreen(0); + printScreen(); return true; } #endif -extern void helpCb (puObject *); +extern void helpCb (); static bool do_help_dialog (const SGPropertyNode * arg) { - helpCb(0); + helpCb(); return true; } @@ -66,7 +58,6 @@ static struct { const char * name; SGCommandMgr::command_t command; } deprecated_dialogs [] = { - { "old-reinit-dialog", do_reinit_dialog }, #if defined(TR_HIRES_SNAP) { "old-hires-snapshot-dialog", do_hires_snapshot_dialog }, #endif @@ -156,7 +147,7 @@ void FGMenuBar::fireItem (puObject * item) { const char * name = item->getLegend(); - vector &bindings = _bindings[name]; + vector &bindings = _bindings[name]; int nBindings = bindings.size(); for (int i = 0; i < nBindings; i++) @@ -188,13 +179,13 @@ FGMenuBar::make_menu (SGPropertyNode * node) for (unsigned int k = 0; k < bindings.size(); k++) { unsigned int m = 0; - SGPropertyNode *binding; + SGPropertyNode_ptr binding; while (dest->getChild("binding", m)) m++; binding = dest->getChild("binding", m, true); copyProperties(bindings[k], binding); - _bindings[items[j]].push_back(new FGBinding(binding)); + _bindings[items[j]].push_back(new SGBinding(binding, globals->get_props())); } } @@ -283,8 +274,7 @@ FGMenuBar::destroy_menubar () // Delete all those bindings SG_LOG(SG_GENERAL, SG_INFO, "Deleting bindings"); - map >::iterator it; - it = _bindings.begin(); + map >::iterator it; for (it = _bindings.begin(); it != _bindings.end(); it++) { SG_LOG(SG_GENERAL, SG_INFO, "Deleting bindings for " << it->first); for ( i = 0; i < it->second.size(); i++ )