From: mfranz Date: Thu, 20 Oct 2005 11:15:00 +0000 (+0000) Subject: Add method to get the property root node of named dialogs. This is X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=685076e9ceb2bf14b63c400ef23467f235ba0198;p=flightgear.git Add method to get the property root node of named dialogs. This is necessary to edit dialog contents from C++, and will allow us to finally let all the hardcoded dialogs be handled by the "gui" subsystem. --- diff --git a/src/GUI/new_gui.cxx b/src/GUI/new_gui.cxx index df81cb1fd..a0885b845 100644 --- a/src/GUI/new_gui.cxx +++ b/src/GUI/new_gui.cxx @@ -142,6 +142,15 @@ NewGUI::closeDialog (const string& name) return false; // dialog wasn't open... } +SGPropertyNode_ptr +NewGUI::getDialog (const string &name) +{ + if(_dialog_props.find(name) != _dialog_props.end()) + return _dialog_props[name]; + else + return 0; +} + void NewGUI::setActiveDialog (FGDialog * dialog) { diff --git a/src/GUI/new_gui.hxx b/src/GUI/new_gui.hxx index 2d00adfcc..980b7871f 100644 --- a/src/GUI/new_gui.hxx +++ b/src/GUI/new_gui.hxx @@ -133,6 +133,13 @@ public: */ virtual bool closeDialog (const string &name); + /** + * Get dialog property tree's root node. + * @param name The name of the dialog box. + * @return node pointer if the dialog was found, zero otherwise. + */ + virtual SGPropertyNode_ptr getDialog (const string &name); + /** * Return a pointer to the current menubar. */