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

@@ -40,6 +40,17 @@ bool ComboBox::handleImplementation(osgGA::EventVisitor* ev, osgGA::Event* event
osgGA::GUIEventAdapter* ea = event->asGUIEventAdapter();
if (!ea) return false;
if (!getHasEventFocus())
{
if (ea->getEventType()==osgGA::GUIEventAdapter::PUSH && _popup->getVisible())
{
_popup->setVisible(false);
}
return false;
}
switch(ea->getEventType())
{
case(osgGA::GUIEventAdapter::SCROLL):
@@ -126,6 +137,10 @@ bool ComboBox::handleImplementation(osgGA::EventVisitor* ev, osgGA::Event* event
_popup->setVisible(false);
}
}
else
{
_popup->setVisible(false);
}
break;
}
case(osgGA::GUIEventAdapter::RELEASE):