2003-01-20 16:01:54 +00:00
|
|
|
// dialog.hxx - XML-configured dialog box.
|
2003-01-18 15:16:34 +00:00
|
|
|
|
|
|
|
#ifndef __DIALOG_HXX
|
|
|
|
#define __DIALOG_HXX 1
|
|
|
|
|
|
|
|
#ifndef __cplusplus
|
|
|
|
# error This library requires C++
|
|
|
|
#endif
|
|
|
|
|
2011-11-19 20:46:17 +00:00
|
|
|
// forward decls
|
|
|
|
class SGPropertyNode;
|
2003-01-18 15:16:34 +00:00
|
|
|
|
|
|
|
/**
|
2003-01-20 16:01:54 +00:00
|
|
|
* An XML-configured dialog box.
|
|
|
|
*
|
|
|
|
* The GUI manager stores only the property tree for the dialog
|
|
|
|
* boxes. This class creates a PUI dialog box on demand from
|
|
|
|
* the properties in that tree. The manager recreates the dialog
|
|
|
|
* every time it needs to show it.
|
2003-01-18 15:16:34 +00:00
|
|
|
*/
|
|
|
|
class FGDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destructor.
|
|
|
|
*/
|
|
|
|
virtual ~FGDialog ();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2006-04-28 11:49:11 +00:00
|
|
|
* Update the values of all GUI objects with a specific name,
|
|
|
|
* or all if name is 0 (default).
|
2003-01-18 15:16:34 +00:00
|
|
|
*
|
2003-01-20 16:01:54 +00:00
|
|
|
* This method copies values from the FlightGear property tree to
|
|
|
|
* the GUI object(s).
|
2003-01-18 15:16:34 +00:00
|
|
|
*
|
|
|
|
* @param objectName The name of the GUI object(s) to update.
|
|
|
|
* Use the empty name for all unnamed objects.
|
|
|
|
*/
|
2011-11-19 20:46:17 +00:00
|
|
|
virtual void updateValues (const char * objectName = 0) = 0;
|
2003-01-18 15:16:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2006-04-28 11:49:11 +00:00
|
|
|
* Apply the values of all GUI objects with a specific name,
|
|
|
|
* or all if name is 0 (default)
|
2003-01-18 15:16:34 +00:00
|
|
|
*
|
2003-01-20 16:01:54 +00:00
|
|
|
* This method copies values from the GUI object(s) to the
|
|
|
|
* FlightGear property tree.
|
2003-01-18 15:16:34 +00:00
|
|
|
*
|
|
|
|
* @param objectName The name of the GUI object(s) to update.
|
|
|
|
* Use the empty name for all unnamed objects.
|
|
|
|
*/
|
2011-11-19 20:46:17 +00:00
|
|
|
virtual void applyValues (const char * objectName = 0) = 0;
|
2003-01-18 15:16:34 +00:00
|
|
|
|
|
|
|
|
2004-05-14 17:16:35 +00:00
|
|
|
/**
|
|
|
|
* Update state. Called on active dialogs before rendering.
|
|
|
|
*/
|
2011-11-19 20:46:17 +00:00
|
|
|
virtual void update () = 0;
|
2005-11-05 18:41:43 +00:00
|
|
|
|
2011-11-19 20:46:17 +00:00
|
|
|
protected:
|
2009-10-03 22:12:22 +00:00
|
|
|
/**
|
2011-11-19 20:46:17 +00:00
|
|
|
* Construct a new GUI widget configured by a property tree.
|
|
|
|
*
|
|
|
|
* The configuration properties are not part of the main
|
|
|
|
* FlightGear property tree; the GUI manager reads them
|
|
|
|
* from individual configuration files.
|
|
|
|
*
|
|
|
|
* @param props A property tree describing the dialog.
|
2009-10-03 22:12:22 +00:00
|
|
|
*/
|
2011-11-19 20:46:17 +00:00
|
|
|
FGDialog (SGPropertyNode * props);
|
2006-05-16 12:45:38 +00:00
|
|
|
|
2009-10-11 11:37:13 +00:00
|
|
|
private:
|
2006-05-16 12:45:38 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2003-01-18 15:16:34 +00:00
|
|
|
#endif // __DIALOG_HXX
|