]> git.mxchange.org Git - flightgear.git/blobdiff - src/Model/panelnode.cxx
Namespace fixes for std::string
[flightgear.git] / src / Model / panelnode.cxx
index a58de344d1b680ba3f77569e024d025215ff22b7..9e6c81cde878221e3f3adf746bcf766f24629ea1 100644 (file)
@@ -26,6 +26,7 @@
 #include <Cockpit/panel.hxx>
 #include <Cockpit/panel_io.hxx>
 #include "Viewer/viewer.hxx"
+#include "Viewer/viewmgr.hxx"
 
 using std::vector;
 
@@ -60,7 +61,9 @@ public:
     panel(p)
   {}
   
-  virtual bool buttonPressed(int b, const Info& info)
+  virtual bool buttonPressed( int b,
+                              const osgGA::GUIEventAdapter&,
+                              const Info& info )
   {    
     button = b;
   // convert to panel coordinates
@@ -73,12 +76,14 @@ public:
                                           picked.x(), picked.y());
   }
   
-  virtual void update(double dt)
+  virtual void update(double dt, int keyModState)
   {
     panel->getPanel()->updateMouseDelay(dt);
   }
   
-  virtual void buttonReleased(void)
+  virtual void buttonReleased( int,
+                               const osgGA::GUIEventAdapter&,
+                               const Info* )
   {
     panel->getPanel()->doLocalMouseAction(button, MOUSE_BUTTON_UP, 
                                           picked.x(), picked.y());
@@ -174,7 +179,7 @@ void FGPanelNode::lazyLoad()
     _panel = fgReadPanel(_panelPath);
     if (!_panel) {
       SG_LOG(SG_COCKPIT, SG_WARN, "failed to read panel from:" << _panelPath);
-      _panelPath = string(); // don't keep trying to read
+      _panelPath = std::string(); // don't keep trying to read
       return;
     }
     
@@ -304,7 +309,21 @@ bool FGPanelNode::isVisible2d() const
     return false;
   }
   
-  if (_panel->getAutohide()) {
+  if (!_hideNonDefaultViews) {
+    _hideNonDefaultViews = fgGetNode("/sim/panel/hide-nonzero-view", true);
+  }
+  
+  if (_hideNonDefaultViews->getBoolValue()) {
+    if (globals->get_viewmgr()->get_current() != 0) {
+      return false;
+    }
+  }
+  
+  if (!_autoHide2d) {
+    _autoHide2d = fgGetNode("/sim/panel/hide-nonzero-heading-offset", true);
+  }
+  
+  if (_panel->getAutohide() && _autoHide2d->getBoolValue()) {
     if (!globals->get_current_view()) {
       return false;
     }