//================================================================================================= void SelectableComponent::mouseDown (const MouseEvent& event) { if (event.getNumberOfClicks() == 2 && event.mods.isLeftButtonDown() && parent->subCompsVerticalArrange()) { parent->sizeToMaxOrDefault(); } else if (event.getNumberOfClicks() == 2 && event.mods.isLeftButtonDown() && !parent->subCompsVerticalArrange()) { // 如果父组件是水平排列本类,则双击宽度扩展一倍,或缩到最窄,默认宽度100。如此可有3个宽度:50,100,200 if (getWidth() == 200) setSize(int(getWidth() * 0.25), getHeight()); else setSize(getWidth() * 2, getHeight()); } else if (event.mods.isLeftButtonDown() && event.mods.isCtrlDown()) { parent->selectByCtrl(this); } else if (!selected && event.mods.isLeftButtonDown() && event.mods.isShiftDown()) { parent->selectByShift(this); } else if (!selected && event.mods.isLeftButtonDown()) { parent->onlySelect(this); } }
void CodeEditorComponent::mouseDoubleClick (const MouseEvent& e) { CodeDocument::Position tokenStart (getPositionAt (e.x, e.y)); CodeDocument::Position tokenEnd (tokenStart); if (e.getNumberOfClicks() > 2) { tokenStart.setLineAndIndex (tokenStart.getLineNumber(), 0); tokenEnd.setLineAndIndex (tokenStart.getLineNumber() + 1, 0); } else { while (CharacterFunctions::isLetterOrDigit (tokenEnd.getCharacter())) tokenEnd.moveBy (1); tokenStart = tokenEnd; while (tokenStart.getIndexInLine() > 0 && CharacterFunctions::isLetterOrDigit (tokenStart.movedBy (-1).getCharacter())) tokenStart.moveBy (-1); } moveCaretTo (tokenEnd, false); moveCaretTo (tokenStart, true); }
void mouseUp (const MouseEvent& e) override { if (e.getMouseDownX() < titleHeight && e.x < titleHeight && e.getNumberOfClicks() != 2) mouseDoubleClick (e); }
void NodeComponent::mouseUp (const MouseEvent& e) { if (e.mouseWasClicked() && e.getNumberOfClicks() == 2) { if (const AudioProcessorGraph::Node::Ptr f = audioEngine.getDoc().getNodeForId (nodeID)) { AudioProcessor* const processor = f->getProcessor(); if(!InternalPluginFormat::isInternalFormat(processor->getName())) { if (PluginWindow* const w = PluginWindow::getWindowFor (f, PluginWindow::Generic/*Normal*/)) w->toFront (true); } } } else if (! e.mouseWasClicked()) { audioEngine.getDoc().setChangedFlag (true); if (moving) { moving = false; audioEngine.getDoc().beginTransaction(); audioEngine.getDoc().perform(new MoveNodeAction(audioEngine, *getGraphEditor(), nodeID, startPos, endPos), "move node"); } } }
//------------------------------------------------------------------------------ void PluginField::mouseDown(const MouseEvent& e) { if(e.getNumberOfClicks() == 2) { int result = 0; PopupMenu menu; pluginList->addToMenu(menu, KnownPluginList::sortAlphabetically); //result = menu.showAt(Rectangle<int>(e.x, e.y, 0, 0)); result = menu.show(); if(result > 0) { int pluginIndex = signalPath->getNumFilters()-1; signalPath->addFilter(pluginList->getType(pluginList->getIndexChosenByMenu(result)), (double)e.x, (double)e.y); //Make sure the plugin got created before we add a component for it. if((signalPath->getNumFilters()-1) > pluginIndex) { pluginIndex = signalPath->getNumFilters()-1; addFilter(pluginIndex); sendChangeMessage(); clearDoubleClickMessage(); } } } }
void mouseUp (const MouseEvent& e) { if (e.getMouseDownX() < titleHeight && e.x < titleHeight && e.y < titleHeight && e.getNumberOfClicks() != 2) { setOpen (! isOpen()); } }
void AudioOutConnector::mouseUp(const MouseEvent& e) { if (e.mouseWasClicked() && e.getNumberOfClicks() == 2) { showGainPanel(); } owner.getSelectedObjects().addToSelectionOnMouseUp (this, e.mods, false, mouseDownSelectStatus); update(); }
void mouseDoubleClick (const MouseEvent& e) { if (e.getNumberOfClicks() != 3) // ignore triple clicks { Rectangle<int> pos; TreeViewItem* const item = findItemAt (e.y, pos); if (item != 0 && (e.x >= pos.getX() || ! owner.openCloseButtonsVisible)) item->itemDoubleClicked (e.withNewPosition (e.getPosition() - pos.getPosition())); } }
void BaseConnector::mouseUp(const MouseEvent& e) { if (e.mouseWasClicked() && e.getNumberOfClicks() == 2) { propertiesWindow->makeVisible(true); } owner.getSelectedObjects().addToSelectionOnMouseUp (this, e.mods, false, mouseDownSelectStatus); update(); }
void SampleStripControl::mouseDown(const MouseEvent &e) { // Save modifers of the initial press mouseDownMods = e.mods; // right click displays hit zones for sample popup menus if (e.mods == ModifierKeys::rightButtonModifier && e.y > controlbarSize) { rightMouseDown = true; selectedHitZone = e.x / (componentWidth / 4); repaint(); } // middle click-drag to move the selection else if (e.mods == ModifierKeys::middleButtonModifier) { selectionStartBeforeDrag = visualSelectionStart; } // double click to select whole waveform else if (e.mods == ModifierKeys::leftButtonModifier && e.getNumberOfClicks() == 2) { // select whole sample by default visualSelectionStart = 0; visualSelectionEnd = componentWidth; visualSelectionLength = (visualSelectionEnd - visualSelectionStart); visualChunkSize = (visualSelectionLength / (float) numChunks); // update the selection dataStrip->setSampleStripParam(SampleStrip::pVisualStart, &visualSelectionStart); dataStrip->setSampleStripParam(SampleStrip::pVisualEnd, &visualSelectionEnd); processor->calcInitialPlaySpeed(sampleStripID); // repaint when we next get a timed update stripChanged = true; } // Determine which point we are moving based on proximity to either // start or end points. The use of pointers here means we don't need // to worry about which end of the selection is actually moving. if ( abs(e.x - visualSelectionStart) > abs(e.x - visualSelectionEnd) ) { selectionPointToChange = &visualSelectionEnd; selectionPointFixed = &visualSelectionStart; } else { selectionPointToChange = &visualSelectionStart; selectionPointFixed = &visualSelectionEnd; } }
void CodeEditorComponent::mouseDoubleClick (const MouseEvent& e) { CodeDocument::Position tokenStart (getPositionAt (e.x, e.y)); CodeDocument::Position tokenEnd (tokenStart); if (e.getNumberOfClicks() > 2) document.findLineContaining (tokenStart, tokenStart, tokenEnd); else document.findTokenContaining (tokenStart, tokenStart, tokenEnd); selectRegion (tokenStart, tokenEnd); dragType = notDragging; }
void ObjectComponent::mouseUp (const MouseEvent& e) { if (dragging) owner.endDragging(); if (e.mouseWasClicked() && e.getNumberOfClicks() == 2) { propertiesWindow->makeVisible(true); } owner.getSelectedObjects().addToSelectionOnMouseUp (this, e.mods, dragging, mouseDownSelectStatus); update(); }
void LinkComponent::mouseUp(const MouseEvent& e) { if (e.mouseWasClicked() && e.getNumberOfClicks() == 2) { getObjectsHolder()->editObjectProperties(this); } else if (e.mods.isPopupMenu()) { showContextMenu(); return; // this may be deleted now.. } owner.getSelectedObjects().addToSelectionOnMouseUp (this, e.mods, false, mouseDownSelectStatus); update(); }
void mouseUp (const MouseEvent& e) { if (e.mouseWasClicked() && e.getNumberOfClicks() == 2) { const AudioProcessorGraph::Node::Ptr f (graph.getNodeForId (filterID)); if (f != nullptr) { PluginWindow* const w = PluginWindow::getWindowFor (f, false); if (w != nullptr) w->toFront (true); } } else if (! e.mouseWasClicked()) { graph.setChangedFlag (true); } }
void pspSystemEditorGUI::listBoxItemClicked(int row, const MouseEvent &mevent){ int nclick = mevent.getNumberOfClicks(); if(nclick == 1){ if(systemsList.getLastRowSelected() == lastSelectedPSystem){ systemsList.deselectAllRows(); psManager->getSystem(row)->setFocus(false);//FIXME: set all in focus } else{ psManager->getSystem(row)->setFocus(true); lastSelectedPSystem = row; } } else if(nclick == 2){ psManager->showPsystemGui(row); } }