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