Gui: add method NavigationStyle::processClickEvent() to reduce code duplication in sub-classes
This commit is contained in:
@@ -146,30 +146,8 @@ SbBool OpenSCADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
else if (viewer->isEditing() && (curmode == NavigationStyle::SPINNING)) {
|
||||
processed = true;
|
||||
}
|
||||
// issue #0002433: avoid to swallow the UP event if down the
|
||||
// scene graph somewhere a dialog gets opened
|
||||
else if (press) {
|
||||
SbTime tmp = (ev->getTime() - mouseDownConsumedEvent.getTime());
|
||||
float dci = (float)QApplication::doubleClickInterval()/1000.0f;
|
||||
// a double-click?
|
||||
if (tmp.getValue() < dci) {
|
||||
mouseDownConsumedEvent = *event;
|
||||
mouseDownConsumedEvent.setTime(ev->getTime());
|
||||
processed = true;
|
||||
}
|
||||
else {
|
||||
mouseDownConsumedEvent.setTime(ev->getTime());
|
||||
// 'ANY' is used to mark that we don't know yet if it will
|
||||
// be a double-click event.
|
||||
mouseDownConsumedEvent.setButton(SoMouseButtonEvent::ANY);
|
||||
}
|
||||
}
|
||||
else if (!press) {
|
||||
if (mouseDownConsumedEvent.getButton() == SoMouseButtonEvent::BUTTON1) {
|
||||
// now handle the postponed event
|
||||
inherited::processSoEvent(&mouseDownConsumedEvent);
|
||||
mouseDownConsumedEvent.setButton(SoMouseButtonEvent::ANY);
|
||||
}
|
||||
else {
|
||||
processed = processClickEvent(event);
|
||||
}
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON2:
|
||||
|
||||
Reference in New Issue
Block a user