void GLWidget::mouseMoveEvent ( QMouseEvent * event ) { event->setAccepted ( false ); pixelloc loc=zoom.invZoom ( event->pos().x(),event->pos().y(),true ); if ( stack!=0 ) stack->mouseMoveEvent ( event,loc ); if ( event->isAccepted() ==true ) return; mouseAction ( event,loc ); }
//--------- SharedViewServer::SharedViewServer() { this->onUpdate += [this](ofxCvGui::UpdateArguments &) { auto newFocus = this->focusThisFrame.lock(); if (newFocus) { this->focus = newFocus; newFocus->getHostedView()->setBounds(this->getLocalBounds()); this->focusThisFrame.reset(); } auto focus = this->focus.lock(); if (focus) { auto view = focus->getHostedView(); if (view) { view->update(); } } }; this->onDraw += [this](ofxCvGui::DrawArguments & args) { auto focus = this->focus.lock(); if (focus) { auto view = focus->getHostedView(); if (view) { view->draw(args); } } }; this->onMouse += [this](ofxCvGui::MouseArguments & args) { auto focus = this->focus.lock(); if (focus) { auto view = focus->getHostedView(); if (view) { view->mouseAction(args); } } }; this->onKeyboard += [this](ofxCvGui::KeyboardArguments & args) { auto focus = this->focus.lock(); if (focus) { auto view = focus->getHostedView(); if (view) { view->keyboardAction(args); } } }; this->onBoundsChange += [this](ofxCvGui::BoundsChangeArguments & args) { auto focus = this->focus.lock(); if (focus) { auto view = focus->getHostedView(); if (view) { view->setBounds(this->getLocalBounds()); } } }; }
//---------- void Controller::mouseAction(MouseArguments & action) { if (this->activeDialog) { this->activeDialog->mouseAction(action); } else { auto currentPanel = this->currentPanel.lock(); if (this->maximised) { currentPanel->mouseAction(action); } else { rootGroup->mouseAction(action); } } }
JNIEXPORT void JNICALL Java_sun_awt_X11_XRobotPeer_mouseReleaseImpl (JNIEnv *env, jclass cls, jint buttonMask) { mouseAction(env, cls, buttonMask, False); }
JNIEXPORT void JNICALL Java_sun_awt_X11_XRobotPeer_mousePressImpl (JNIEnv *env, jclass cls, jint buttonMask) { mouseAction(env, cls, buttonMask, True); }
void MenuBarItem::mouseOver(Coordinate position) { mouseAction(position, false); }
bool MenuBarItem::click(Coordinate position) { return mouseAction(position, true); }
void Animation::motionFunc(int x, int y) { mouseAction(x, y); }