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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user