]> git.mxchange.org Git - flightgear.git/blob - src/GUI/dialog.hxx
VS2015 compatability fixes.
[flightgear.git] / src / GUI / dialog.hxx
1 // dialog.hxx - XML-configured dialog box.
2
3 #ifndef __DIALOG_HXX
4 #define __DIALOG_HXX 1
5
6 #include <string>
7
8 // forward decls
9 class SGPropertyNode;
10
11 /**
12  * An XML-configured dialog box.
13  *
14  * The GUI manager stores only the property tree for the dialog
15  * boxes.  This class creates a PUI dialog box on demand from
16  * the properties in that tree.  The manager recreates the dialog
17  * every time it needs to show it.
18  */
19 class FGDialog
20 {
21 public:
22
23
24
25     /**
26      * Destructor.
27      */
28     virtual ~FGDialog ();
29
30
31     /**
32      * Update the values of all GUI objects with a specific name,
33      * or all if an empty name is given (default).
34      *
35      * This method copies values from the FlightGear property tree to
36      * the GUI object(s).
37      *
38      * @param objectName The name of the GUI object(s) to update.
39      *        Use the empty name for all objects.
40      */
41     virtual void updateValues(const std::string& objectName = "") = 0;
42
43
44     /**
45      * Apply the values of all GUI objects with a specific name,
46      * or all if an empty name is given (default)
47      *
48      * This method copies values from the GUI object(s) to the
49      * FlightGear property tree.
50      *
51      * @param objectName The name of the GUI object(s) to update.
52      *        Use the empty name for all objects.
53      */
54     virtual void applyValues(const std::string& objectName = "") = 0;
55
56
57     /**
58      * Update state.  Called on active dialogs before rendering.
59      */
60     virtual void update () = 0;
61
62 protected:
63     /**
64      * Construct a new GUI widget configured by a property tree.
65      *
66      * The configuration properties are not part of the main
67      * FlightGear property tree; the GUI manager reads them
68      * from individual configuration files.
69      *
70      * @param props A property tree describing the dialog.
71      */
72     FGDialog (SGPropertyNode * props);
73
74 private:
75
76 };
77
78 #endif // __DIALOG_HXX