From 19b09cef282c95e16a423b25f319793dc923d86c Mon Sep 17 00:00:00 2001 From: mfranz Date: Fri, 24 Jun 2005 13:44:22 +0000 Subject: [PATCH] FGBindings doesn't create its own, detached copy of the bindings property subtree. Keeping bindings available is in the responsibility of the caller. --- src/GUI/dialog.cxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/GUI/dialog.cxx b/src/GUI/dialog.cxx index 74245da83..2763d29f8 100644 --- a/src/GUI/dialog.cxx +++ b/src/GUI/dialog.cxx @@ -610,12 +610,21 @@ FGDialog::setupObject (puObject * object, SGPropertyNode * props) _liveObjects.push_back(po); } - vector nodes = props->getChildren("binding"); - if (nodes.size() > 0) { + SGPropertyNode * dest = fgGetNode("/sim/bindings", true); + vector bindings = props->getChildren("binding"); + if (bindings.size() > 0) { GUIInfo * info = new GUIInfo(this); - for (unsigned int i = 0; i < nodes.size(); i++) - info->bindings.push_back(new FGBinding(nodes[i])); + for (unsigned int i = 0; i < bindings.size(); i++) { + unsigned int j = 0; + SGPropertyNode *binding; + while (dest->getChild("binding", j)) + j++; + + binding = dest->getChild("binding", j, true); + copyProperties(bindings[i], binding); + info->bindings.push_back(new FGBinding(binding)); + } object->setCallback(action_callback); object->setUserData(info); _info.push_back(info);