// 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>
//----------------------------------------------------------------------------
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);
//----------------------------------------------------------------------------
Window::~Window()
{
- BOOST_FOREACH(osg::Group* parent, getGroup()->getParents())
- {
- parent->removeChild(getGroup());
- }
+
}
//----------------------------------------------------------------------------
}
//----------------------------------------------------------------------------
- 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);