* Initialize the menu bar from $FG_ROOT/gui/menubar.xml
*/
virtual void init ();
-
/**
* Make the menu bar visible.
virtual void fireItem (puObject * item);
+ /**
+ * create a menubar based on a PropertyList within the PropertyTree
+ */
+ void make_menubar (SGPropertyNode * props);
+
+
+ /**
+ * destroy a menubar based on a PropertyList within the PropertyTree
+ */
+ void destroy_menubar ();
+
+
+ /**
+ * Disable/enable menu titles and entries
+ */
+ bool enable_item (const SGPropertyNode * item, bool state);
+
+
private:
// Make a single menu.
// Make the top-level menubar.
void make_menubar ();
+ // Create a property-path -> puObject map for menu node
+ void make_object_map(SGPropertyNode * node);
+
+ // Add <enabled> listener that enables/disables menu entries.
+ void add_enabled_listener(SGPropertyNode * node);
+
// Is the menu visible?
bool _visible;
puCallback * make_callback_array (int size);
vector<char **> _char_arrays;
vector<puCallback *> _callback_arrays;
+
+ // A map for {menu node path}->puObject translation.
+ map<string, puObject *> _objects;
};
#endif // __MENUBAR_HXX