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
|
|
|
|
|
2017-02-26 21:59:05 +00:00
|
|
|
#include <string>
|
|
|
|
|
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
|
|
|
|
2017-05-11 07:39:48 +00:00
|
|
|
/**
|
|
|
|
* Request the menubar to be hidden if its display overlays the main window content.
|
|
|
|
* (Which essentially means the PUI menubar at the moment). This is used to prevent
|
|
|
|
* the menubar overlapping the splash-screen during startup.
|
|
|
|
*
|
|
|
|
* The state of this flag is independant of the normal menubar visibility, i.e this
|
|
|
|
* flag and the normal visibility and AND-ed together inside the code.
|
|
|
|
*/
|
|
|
|
virtual void setHideIfOverlapsWindow(bool hide) = 0;
|
|
|
|
|
|
|
|
// corresponding getter to valye able.
|
|
|
|
virtual bool getHideIfOverlapsWindow() const = 0;
|
|
|
|
|
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.
|
|
|
|
*/
|
2017-02-26 21:59:05 +00:00
|
|
|
static std::string getLocalizedLabel(SGPropertyNode* node);
|
2012-04-21 18:17:42 +00:00
|
|
|
|
2003-01-16 18:06:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __MENUBAR_HXX
|