Fixed handling of traverse
This commit is contained in:
@@ -32,20 +32,24 @@ PushButton::PushButton(const osgUI::PushButton& pb, const osg::CopyOp& copyop):
|
||||
|
||||
bool PushButton::handleImplementation(osgGA::EventVisitor* ev, osgGA::Event* event)
|
||||
{
|
||||
OSG_NOTICE<<"PushButton::handleImplementation"<<std::endl;
|
||||
|
||||
osgGA::GUIEventAdapter* ea = event->asGUIEventAdapter();
|
||||
if (!ea) return false;
|
||||
|
||||
switch(ea->getEventType())
|
||||
{
|
||||
case(osgGA::GUIEventAdapter::PUSH):
|
||||
OSG_NOTICE<<"Button pressed "<<std::endl;
|
||||
if (_buttonSwitch.valid()) _buttonSwitch->setSingleChildOn(2);
|
||||
if (_buttonSwitch.valid())
|
||||
{
|
||||
_buttonSwitch->setSingleChildOn(2);
|
||||
runCallbacks("pressed");
|
||||
}
|
||||
break;
|
||||
case(osgGA::GUIEventAdapter::RELEASE):
|
||||
OSG_NOTICE<<"Button release "<<std::endl;
|
||||
if (_buttonSwitch.valid()) _buttonSwitch->setSingleChildOn(1);
|
||||
if (_buttonSwitch.valid())
|
||||
{
|
||||
_buttonSwitch->setSingleChildOn(1);
|
||||
runCallbacks("released");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -69,7 +73,6 @@ void PushButton::leaveImplementation()
|
||||
|
||||
void PushButton::createGraphicsImplementation()
|
||||
{
|
||||
|
||||
if (_textDrawable.valid())
|
||||
{
|
||||
OSG_NOTICE<<"PushButton::createGraphicsImplementation() updating existing TextDrawable"<<std::endl;
|
||||
|
||||
@@ -180,8 +180,7 @@ void Widget::traverse(osg::NodeVisitor& nv)
|
||||
{
|
||||
osg::Parameters inputParameters, outputParameters;
|
||||
inputParameters.push_back(&nv);
|
||||
runCallbacks("traverse",inputParameters, outputParameters);
|
||||
return;
|
||||
if (runCallbacks("traverse",inputParameters, outputParameters)) return;
|
||||
}
|
||||
|
||||
traverseImplementation(nv);
|
||||
|
||||
Reference in New Issue
Block a user