1 // new_gui.hxx - XML-configurable GUI subsystem.
4 #define __NEW_GUI_HXX 1
7 # error This library requires C++
12 #include <simgear/compiler.h> // for SG_USING_STD
13 #include <simgear/misc/props.hxx>
21 #include <Main/fgfs.hxx>
28 * User data attached to a GUI object.
32 GUIData (GUIWidget * w, const char * a);
39 * Top-level GUI widget.
44 GUIWidget (SGPropertyNode_ptr props);
45 virtual ~GUIWidget ();
47 virtual void action (const string &command);
50 GUIWidget (const GUIWidget &); // just for safety
51 void display (SGPropertyNode_ptr props);
52 virtual void updateProperties ();
53 virtual void applyProperties ();
54 puObject * makeObject (SGPropertyNode * props,
55 int parentWidth, int parentHeight);
56 void setupObject (puObject * object, SGPropertyNode * props);
57 void setupGroup (puGroup * group, SGPropertyNode * props,
58 int width, int height, bool makeFrame = false);
61 vector<GUIData> _actions;
62 struct PropertyObject {
63 PropertyObject (puObject * object, SGPropertyNode_ptr node);
65 SGPropertyNode_ptr node;
67 vector<PropertyObject> _propertyObjects;
71 class NewGUI : public FGSubsystem
78 virtual void update (double delta_time_sec);
79 virtual void display (const string &name);
83 void readDir (const char * path);
85 map<string,SGPropertyNode_ptr> _widgets;
89 #endif // __NEW_GUI_HXX