]> git.mxchange.org Git - flightgear.git/commitdiff
<input> elements that are <live> always update their input field from the
authormfranz <mfranz>
Mon, 3 Apr 2006 15:00:33 +0000 (15:00 +0000)
committermfranz <mfranz>
Mon, 3 Apr 2006 15:00:33 +0000 (15:00 +0000)
<property>, except if they are activated, in which case the user input
should, of course, not get overwritten. But if such an input was active and
the user selected a different widget, then its contents were dropped.
Fix that by setting the "DownCallback" for live input fields.

src/GUI/dialog.cxx

index 412da131233be303a8179d6078cadc21ae3be332..30c3004036330e120371c2cebb8d21d2d289ec54 100644 (file)
@@ -711,6 +711,7 @@ FGDialog::makeObject (SGPropertyNode * props, int parentWidth, int parentHeight)
 void
 FGDialog::setupObject (puObject * object, SGPropertyNode * props)
 {
+    string type = props->getName();
     object->setLabelPlace(PUPLACE_CENTERED_RIGHT);
 
     if (props->hasValue("legend"))
@@ -766,6 +767,10 @@ FGDialog::setupObject (puObject * object, SGPropertyNode * props)
             info->bindings.push_back(new FGBinding(binding));
         }
         object->setCallback(action_callback);
+
+        if (type == "input" && props->getBoolValue("live"))
+            object->setDownCallback(action_callback);
+
         object->setUserData(info);
         _info.push_back(info);
     }