1 // dialog.hxx - XML-configurable dialog box.
7 # error This library requires C++
12 #include <simgear/compiler.h> // for SG_USING_STD
13 #include <simgear/misc/props.hxx>
23 * PUI userdata describing a GUI object.
27 GUIInfo (FGDialog * w);
31 vector <FGBinding *> bindings;
36 * Top-level GUI widget.
44 * Construct a new GUI widget configured by a property tree.
46 FGDialog (SGPropertyNode_ptr props);
56 * Update the values of all GUI objects with a specific name.
58 * This method copies from the property to the GUI object.
60 * @param objectName The name of the GUI object(s) to update.
61 * Use the empty name for all unnamed objects.
63 virtual void updateValue (const char * objectName);
67 * Apply the values of all GUI objects with a specific name.
69 * This method copies from the GUI object to the property.
71 * @param objectName The name of the GUI object(s) to update.
72 * Use the empty name for all unnamed objects.
74 virtual void applyValue (const char * objectName);
78 * Update the values of all GUI objects.
80 * This method copies from the properties to the GUI objects.
82 virtual void updateValues ();
86 * Apply the values of all GUI objects.
88 * This method copies from the GUI objects to the properties.
90 virtual void applyValues ();
94 FGDialog (const FGDialog &); // just for safety
96 void display (SGPropertyNode_ptr props);
97 puObject * makeObject (SGPropertyNode * props,
98 int parentWidth, int parentHeight);
99 void setupObject (puObject * object, SGPropertyNode * props);
100 void setupGroup (puGroup * group, SGPropertyNode * props,
101 int width, int height, bool makeFrame = false);
104 vector<GUIInfo *> _info;
105 struct PropertyObject {
106 PropertyObject (const char * name,
108 SGPropertyNode_ptr node);
111 SGPropertyNode_ptr node;
113 vector<PropertyObject *> _propertyObjects;
116 #endif // __DIALOG_HXX