void SelectionPlugin::onMouseButtonRelease( const MouseButtonEvent& event ) { if( event.button != MouseButton::Left ) return; SceneDocument* sceneDocument = (SceneDocument*) editor->getDocument(); sceneDocument->getRenderWindow()->setCursorCapture(false); editor->getDocument()->getWindow()->flagRedraw(); SelectionOperation* selection = nullptr; if(selections->dragRectangle) selection = processDragSelection(event); else selection = processSelection(event); if( !selection ) return; const SelectionCollection& selected = selections->getSelections(); // Prevent duplication of selection events. if( selected.isSame(selection->selections) ) { LogDebug("Ignoring duplicated selection"); Deallocate(selection); return; } selection->redo(); UndoManager* undoManager = sceneDocument->getUndoManager(); undoManager->registerOperation(selection); }
XPathInspector::XPathInspector(PhpWebView *webview, QWidget *parent) : QWidget(parent, Qt::WindowStaysOnTopHint | Qt::Window) { this->webview = webview; setAttribute(Qt::WA_DeleteOnClose); setWindowTitle("XPathInspector"); resize(600, 350); layout_w = new QBoxLayout(QBoxLayout::TopToBottom, this); layout2 = new QBoxLayout(QBoxLayout::LeftToRight); layout_w->addLayout(layout2); label = new QLabel("xpath: ", this); edit = new QLineEdit("", this); layout2->addWidget(label); layout2->addWidget(edit); edit2 = new QTextEdit(this); edit2->resize(edit2->width(), 100); edit2->sizePolicy().setVerticalPolicy(QSizePolicy::Fixed); edit2->setMaximumHeight(120); edit2->setMinimumHeight(120); tree = new QTreeWidget(this); layout_w->addWidget(tree); layout_w->addWidget(edit2); QWebElement root = this->webview->page()->mainFrame()->documentElement(); tree->addTopLevelItem(createTree(root)); tree->setSelectionMode(QAbstractItemView::ExtendedSelection); //connect(tree, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(itemActivated(QTreeWidgetItem*, int))); connect(edit, SIGNAL(returnPressed()), this, SLOT(processXPath())); connect(tree, SIGNAL(itemSelectionChanged()), this, SLOT(processSelection())); }
void CControlsettings::processSpecific() { if(!m_suspended) { if(m_waiting_for_input) // This part only happens, when waiting for an input processWaitInput(); else processSelection(); } else { mp_SubMenu->processCommon(); mp_SubMenu->processSpecific(); mp_SubMenu->postProcess(); if(mp_SubMenu->mustClose()) { SAFE_DELETE(mp_SubMenu); m_suspended = false; if(m_chosenPlayer == 0) { m_mustclose = true; m_suspended = true; } else setControlsText(); } } }
void mouseClick(int button, int state, int x, int y){ if(TwEventMouseButtonGLUT(button,state,x,y)) return; if(button == GLUT_LEFT_BUTTON && state == GLUT_DOWN) { processSelection(x, y); } }
//! [9] void Base3DView::mousePressEvent(QMouseEvent *event) { m_lastPos = event->pos(); if(event->modifiers() == Qt::AltModifier) return; processSelection(event); }
void Application::mouse_button_callback(GLFWwindow* window, int button, int action, int mods) { double x, y; if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_PRESS) { glfwGetCursorPos(window, &x, &y); processSelection(x, y); //std::cout << "clic à x=" << x << " y=" << y << std::endl; } }
void MenuUserInterface::onKeyDown(U32 key) { if(key == '\r') { UserInterface::playBoop(); processSelection(menuItems[selectionIndex].mIndex); } else if(key == 27) { UserInterface::playBoop(); onEscape(); } }
void MenuUserInterface::onControllerButtonDown(U32 buttonIndex) { if(buttonIndex == 0) { UserInterface::playBoop(); processSelection(menuItems[selectionIndex].mIndex); } else if(buttonIndex == 1) { UserInterface::playBoop(); onEscape(); } }
ContextMenu::ContextMenu(Selection & sel, ScribusMainWindow *actionsParent, ScribusDoc* doc, QWidget * parent) : QMenu(parent), m_Sel(sel), m_ScMW(actionsParent), m_doc(doc), onAPage(false) { if (m_Sel.count()>0) { // tDebug("process Selection start"); processSelection(); // tDebug("process Selection end"); createMenuItems_Selection(); } }
void mouseButton(GLFWwindow* window, int button, int action, int mods){ if (TwEventMouseButtonGLFW(button, action)) return; double x, y; glfwGetCursorPos(gpWindow, &x, &y); float ax = x; float ay = gHeight - y; if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_PRESS){ gpCamera->setLeftButtonPress(true, x,y); processSelection(x, y); } if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_RELEASE){ gpCamera->setLeftButtonPress(false, x, y); } }