]> git.mxchange.org Git - flightgear.git/blobdiff - src/Canvas/window.cxx
toggle fullscreen: also adapt GUI plane when resizing
[flightgear.git] / src / Canvas / window.cxx
index e6db4c30adef56af61625f5102d045a8273cabb0..d79e1cb7a03573ae7772b41a35161f3fbcb095a8 100644 (file)
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 #include "window.hxx"
-#include <Canvas/canvas.hxx>
+#include <simgear/canvas/Canvas.hxx>
 
 #include <osgGA/GUIEventHandler>
 
@@ -28,8 +28,12 @@ namespace canvas
   //----------------------------------------------------------------------------
   Window::Window(SGPropertyNode* node):
     PropertyBasedElement(node),
-    _image(node)
+    _image( simgear::canvas::CanvasPtr(),
+            node,
+            simgear::canvas::Style() )
   {
+    _image.removeListener();
+
     // TODO probably better remove default position and size
     node->setFloatValue("x", 50);
     node->setFloatValue("y", 100);
@@ -44,10 +48,7 @@ namespace canvas
   //----------------------------------------------------------------------------
   Window::~Window()
   {
-    BOOST_FOREACH(osg::Group* parent, getGroup()->getParents())
-    {
-      parent->removeChild(getGroup());
-    }
+
   }
 
   //----------------------------------------------------------------------------
@@ -72,25 +73,25 @@ namespace canvas
   }
 
   //----------------------------------------------------------------------------
-  const Rect<float>& Window::getRegion() const
+  const simgear::Rect<float>& Window::getRegion() const
   {
     return _image.getRegion();
   }
 
   //----------------------------------------------------------------------------
-  void Window::setCanvas(CanvasPtr canvas)
+  void Window::setCanvas(simgear::canvas::CanvasPtr canvas)
   {
-    _image.setCanvas(canvas);
+    _image.setSrcCanvas(canvas);
   }
 
   //----------------------------------------------------------------------------
-  CanvasWeakPtr Window::getCanvas() const
+  simgear::canvas::CanvasWeakPtr Window::getCanvas() const
   {
-    return _image.getCanvas();
+    return _image.getSrcCanvas();
   }
 
   //----------------------------------------------------------------------------
-  bool Window::handleMouseEvent(const MouseEvent& event)
+  bool Window::handleMouseEvent(const simgear::canvas::MouseEvent& event)
   {
     if( !getCanvas().expired() )
       return getCanvas().lock()->handleMouseEvent(event);