]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/dialog.cxx
Add missing include files needed by the new math code under windows
[flightgear.git] / src / GUI / dialog.cxx
index 450b1977fac722756b2f1adc88fef4250e6b897b..451cee38da02f4a7a165fe313372586f9db655d4 100644 (file)
@@ -1,5 +1,9 @@
 // dialog.cxx: implementation of an XML-configurable dialog box.
 
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
 #include <stdlib.h>            // atof()
 
 #include <Input/input.hxx>
@@ -317,13 +321,18 @@ copy_from_pui (puObject * object, SGPropertyNode * node)
 
 FGDialog::FGDialog (SGPropertyNode * props)
     : _object(0),
-      _gui((NewGUI *)globals->get_subsystem("gui"))
+      _gui((NewGUI *)globals->get_subsystem("gui")),
+      _props(props)
 {
     display(props);
 }
 
 FGDialog::~FGDialog ()
 {
+    int x, y;
+    _object->getAbsolutePosition(&x, &y);
+    _props->setIntValue("lastx", x);
+    _props->setIntValue("lasty", y);
     puDeleteObject(_object);
 
     unsigned int i;
@@ -440,9 +449,9 @@ FGDialog::display (SGPropertyNode * props)
 
     // Negative x/y coordinates are interpreted as distance from the top/right
     // corner rather than bottom/left.
-    if (px < 0)
+    if (userx && px < 0)
         px = screenw - pw + px;
-    if (py < 0)
+    if (usery && py < 0)
         py = screenh - ph + py;
 
     // Define "x", "y", "width" and/or "height" in the property tree if they