1
0
Fork 0

Tie the bool property /sim/menubar/visibility to hide and reveal the

menubar.
This commit is contained in:
david 2003-01-18 21:11:51 +00:00
parent 7ae491dc2e
commit 64aa833087
2 changed files with 35 additions and 0 deletions

View file

@ -42,6 +42,19 @@ NewGUI::init ()
#endif
}
void
NewGUI::bind ()
{
fgTie("/sim/menubar/visibility", this,
&NewGUI::getMenuBarVisible, &NewGUI::setMenuBarVisible);
}
void
NewGUI::unbind ()
{
fgUntie("/sim/menubar/visibility");
}
void
NewGUI::update (double delta_time_sec)
{
@ -75,6 +88,21 @@ NewGUI::getMenuBar ()
return _menubar;
}
bool
NewGUI::getMenuBarVisible () const
{
return _menubar->isVisible();
}
void
NewGUI::setMenuBarVisible (bool visible)
{
if (visible)
_menubar->show();
else
_menubar->hide();
}
void
NewGUI::readDir (const char * path)
{

View file

@ -33,6 +33,8 @@ public:
NewGUI ();
virtual ~NewGUI ();
virtual void init ();
virtual void bind ();
virtual void unbind ();
virtual void update (double delta_time_sec);
virtual void display (const string &name);
@ -41,6 +43,11 @@ public:
virtual FGMenuBar * getMenuBar ();
protected:
virtual bool getMenuBarVisible () const;
virtual void setMenuBarVisible (bool visible);
private: