]> git.mxchange.org Git - flightgear.git/commitdiff
on closing a dialog write the last position back, so that the caller can
authormfranz <mfranz>
Sun, 29 Jan 2006 21:21:56 +0000 (21:21 +0000)
committermfranz <mfranz>
Sun, 29 Jan 2006 21:21:56 +0000 (21:21 +0000)
open it there again next time

src/GUI/dialog.cxx
src/GUI/dialog.hxx

index 450b1977fac722756b2f1adc88fef4250e6b897b..4982ec33f7da73753bc045a8aa5080c301c277cf 100644 (file)
@@ -317,13 +317,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;
index ef0cd4e939c57131e12c946825a92118f6e23427..f9f51705f408706411062eda02e5f2215289b302 100644 (file)
@@ -146,6 +146,10 @@ private:
     // overridden by a top level font definition.
     puFont * _font;
 
+    // The source xml tree, so that we can pass data back, such as the
+    // last position.
+    SGPropertyNode *_props;
+
     // PUI provides no way for userdata to be deleted automatically
     // with a GUI object, so we have to keep track of all the special
     // data we allocated and then free it manually when the dialog