Moved responsiblity for checking current event focus onto Widget::handleImplementations().

Added support for closing CombinBox popup when the mouse is clicked outside the popup or combobox widget.


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14396 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-08-01 10:57:24 +00:00
parent e979f76156
commit ff78d30cee
4 changed files with 28 additions and 12 deletions

View File

@@ -212,20 +212,17 @@ void Widget::traverseImplementation(osg::NodeVisitor& nv)
// OSG_NOTICE<<"EventTraversal getHasEventFocus()="<<getHasEventFocus()<<std::endl;
if (getHasEventFocus())
{
// signify that event has been taken by widget with focus
ev->setEventHandled(true);
// signify that event has been taken by widget with focus
osgGA::EventQueue::Events& events = ev->getEvents();
for(osgGA::EventQueue::Events::iterator itr = events.begin();
itr != events.end();
++itr)
osgGA::EventQueue::Events& events = ev->getEvents();
for(osgGA::EventQueue::Events::iterator itr = events.begin();
itr != events.end();
++itr)
{
if (handle(ev, itr->get()))
{
if (handle(ev, itr->get()))
{
(*itr)->setHandled(true);
}
(*itr)->setHandled(true);
ev->setEventHandled(true);
}
}