2003-01-20 16:02:26 +00:00
|
|
|
// menubar.hxx - XML-configured menu bar.
|
|
|
|
|
2003-01-16 18:06:27 +00:00
|
|
|
#ifndef __MENUBAR_HXX
|
|
|
|
#define __MENUBAR_HXX 1
|
|
|
|
|
2012-04-21 18:17:42 +00:00
|
|
|
class SGPropertyNode;
|
2003-01-16 18:06:27 +00:00
|
|
|
|
|
|
|
/**
|
2011-11-19 22:04:35 +00:00
|
|
|
* XML-configured menu bar interface
|
2003-01-20 16:02:26 +00:00
|
|
|
*
|
|
|
|
* This class creates a menu bar from a tree of XML properties. These
|
|
|
|
* properties are not part of the main FlightGear property tree, but
|
|
|
|
* are read from a separate file ($FG_ROOT/gui/menubar.xml).
|
2011-11-19 22:04:35 +00:00
|
|
|
|
2003-01-16 18:06:27 +00:00
|
|
|
*/
|
|
|
|
class FGMenuBar
|
|
|
|
{
|
|
|
|
public:
|
2012-04-21 18:17:42 +00:00
|
|
|
FGMenuBar();
|
2003-01-16 18:06:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Destructor.
|
|
|
|
*/
|
|
|
|
virtual ~FGMenuBar ();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize the menu bar from $FG_ROOT/gui/menubar.xml
|
|
|
|
*/
|
2011-11-19 22:04:35 +00:00
|
|
|
virtual void init () = 0;
|
2003-01-16 18:06:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Make the menu bar visible.
|
|
|
|
*/
|
2011-11-19 22:04:35 +00:00
|
|
|
virtual void show () = 0;
|
2003-01-16 18:06:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Make the menu bar invisible.
|
|
|
|
*/
|
2011-11-19 22:04:35 +00:00
|
|
|
virtual void hide () = 0;
|
2003-01-16 18:06:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test whether the menu bar is visible.
|
|
|
|
*/
|
2011-11-19 22:04:35 +00:00
|
|
|
virtual bool isVisible () const = 0;
|
2005-12-06 17:56:17 +00:00
|
|
|
|
2012-04-21 18:17:42 +00:00
|
|
|
/**
|
|
|
|
* Read a menu label from the menu's property tree.
|
|
|
|
* Take care of mapping it to the appropriate translation, if available.
|
|
|
|
* Returns an UTF-8 encoded string.
|
|
|
|
*/
|
2012-05-05 07:41:23 +00:00
|
|
|
static const char* getLocalizedLabel(SGPropertyNode* node);
|
2012-04-21 18:17:42 +00:00
|
|
|
|
2003-01-16 18:06:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __MENUBAR_HXX
|