on closing a dialog write the last position back, so that the caller can
open it there again next time
This commit is contained in:
parent
eb69ef592e
commit
aec1d580c2
2 changed files with 10 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue