]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/new_gui.hxx
Melchior: Make line wrapping in textboxes configurable, and enable it by default
[flightgear.git] / src / GUI / new_gui.hxx
index c0cda22b31f27a4d30bb51f89d8cd253366aebae..6e96a5aa060778a16902cbf9b205aef63219254c 100644 (file)
@@ -7,6 +7,10 @@
 # error This library requires C++
 #endif
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include <plib/pu.h>
 
 #include <simgear/compiler.h>  // for SG_USING_STD
@@ -80,6 +84,18 @@ public:
      */
     virtual void update (double delta_time_sec);
 
+    /**
+     * Creates a new dialog box, using the same property format as the
+     * gui/dialogs configuration files.  Does not display the
+     * resulting dialog.  If a pre-existing dialog of the same name
+     * exists, it will be deleted.  The node argument will be stored
+     * in the GUI subsystem using SGPropertNode_ptr reference counting.
+     * It should not be deleted by user code.
+     *
+     * @param node A property node containing the dialog definition
+     */
+    virtual void newDialog (SGPropertyNode* node);
+
     /**
      * Display a dialog box.
      *
@@ -96,12 +112,22 @@ public:
 
 
     /**
-     * Close the currently-active dialog, if any.
+     * Close the currenty active dialog.  This function is intended to
+     * be called from code (pui callbacks, for instance) that registers
+     * its dialog object as active via setActiveDialog().  Other
+     * user-level code should use the closeDialog(name) API.
      *
-     * @return true if a dialog was active, false otherwise.
+     * @return true if a dialog was active, false otherwise
      */
     virtual bool closeActiveDialog ();
 
+    /**
+     * Close a named dialog, if it is open.
+     *
+     * @param name The name of the dialog box.
+     * @return true if the dialog was active, false otherwise.
+     */
+    virtual bool closeDialog (const string &name);
 
     /**
      * Return a pointer to the current menubar.
@@ -151,7 +177,8 @@ private:
 
     FGMenuBar * _menubar;
     FGDialog * _active_dialog;
-    map<string,SGPropertyNode *> _dialog_props;
+    map<string,FGDialog *> _active_dialogs;
+    map<string,SGPropertyNode_ptr> _dialog_props;
 
 };