]> git.mxchange.org Git - flightgear.git/commitdiff
Add method to get the property root node of named dialogs. This is
authormfranz <mfranz>
Thu, 20 Oct 2005 11:15:00 +0000 (11:15 +0000)
committermfranz <mfranz>
Thu, 20 Oct 2005 11:15:00 +0000 (11:15 +0000)
necessary to edit dialog contents from C++, and will allow us to
finally let all the hardcoded dialogs be handled by the "gui"
subsystem.

src/GUI/new_gui.cxx
src/GUI/new_gui.hxx

index df81cb1fd13b651e685dde4dec6d59c8ee89614a..a0885b845caad84022e1c7b4f96a098f62615c34 100644 (file)
@@ -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)
 {
index 2d00adfcc2a82bb6c3f14653ecd7e4c562b3671b..980b7871f86d2420e812f5bcc4a442c82831bdb0 100644 (file)
@@ -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.
      */