// ----------------------------------------------------------------------- // Is called when the select toolbar button is pressed. void QucsApp::slotSelect(bool on) { QWidget *w = DocumentTab->currentPage(); if(w->inherits("QTextEdit")) { ((TextDoc*)w)->viewport()->setFocus(); select->blockSignals(true); select->setOn(true); select->blockSignals(false); return; } // goto to insertWire mode if ESC pressed during wiring Schematic *Doc = (Schematic*)DocumentTab->currentPage(); if(MouseMoveAction == &MouseActions::MMoveWire2) { MouseMoveAction = &MouseActions::MMoveWire1; MousePressAction = &MouseActions::MPressWire1; Doc->viewport()->update(); view->drawn = false; select->blockSignals(true); select->setOn(false); select->blockSignals(false); return; } if(performToggleAction(on, select, 0, 0, &MouseActions::MPressSelect)) { MouseReleaseAction = &MouseActions::MReleaseSelect; MouseDoubleClickAction = &MouseActions::MDoubleClickSelect; } }
// ----------------------------------------------------------------------- // Is called, when "Zoom in" action is triggered. void QucsApp::slotZoomIn(bool on) { TextDoc *Doc = (TextDoc*)DocumentTab->currentWidget(); if(isTextDocument(Doc)) { Doc->zoomBy(1.5f); magPlus->blockSignals(true); magPlus->setChecked(false); magPlus->blockSignals(false); } else performToggleAction(on, magPlus, 0, &MouseActions::MMoveZoomIn, &MouseActions::MPressZoomIn); }
// ----------------------------------------------------------------------- // Is called, when "Zoom in" action is activated. void QucsApp::slotZoomIn(bool on) { TextDoc *Doc = (TextDoc*)DocumentTab->currentPage(); if(Doc->inherits("QTextEdit")) { Doc->zoomBy(2.0f); magPlus->blockSignals(true); magPlus->setOn(false); magPlus->blockSignals(false); } else performToggleAction(on, magPlus, 0, &MouseActions::MMoveZoomIn, &MouseActions::MPressZoomIn); }
// ------------------------------------------------------------------------ // Is called if "Delete"-Button is pressed. void QucsApp::slotEditDelete(bool on) { TextDoc *Doc = (TextDoc*)DocumentTab->currentPage(); if(Doc->inherits("QTextEdit")) { Doc->viewport()->setFocus(); Doc->del(); editDelete->blockSignals(true); editDelete->setOn(false); // release toolbar button editDelete->blockSignals(false); } else performToggleAction(on, editDelete, &Schematic::deleteElements, &MouseActions::MMoveDelete, &MouseActions::MPressDelete); }
// ----------------------------------------------------------------------- // Is called when the activate/deactivate toolbar button is pressed. void QucsApp::slotEditActivate (bool on) { TextDoc * Doc = (TextDoc *) DocumentTab->currentPage (); if (isTextDocument (Doc)) { Doc->clearParagraphBackground (Doc->tmpPosX); Doc->commentSelected (); editActivate->blockSignals (true); editActivate->setOn (false); // release toolbar button editActivate->blockSignals (false); } else performToggleAction (on, editActivate, &Schematic::activateSelectedComponents, &MouseActions::MMoveActivate, &MouseActions::MPressActivate); }
// ------------------------------------------------------------------------ // Is called if "Delete"-Button is pressed. void QucsApp::slotEditDelete(bool on) { TextDoc *Doc = (TextDoc*)DocumentTab->currentWidget(); if(isTextDocument(Doc)) { Doc->viewport()->setFocus(); //Doc->del(); Doc->textCursor().deleteChar(); editDelete->blockSignals(true); editDelete->setChecked(false); // release toolbar button editDelete->blockSignals(false); } else performToggleAction(on, editDelete, &Schematic::deleteElements, &MouseActions::MMoveDelete, &MouseActions::MPressDelete); }
// ----------------------------------------------------------------------- // Is called, when "set on grid" action is activated. void QucsApp::slotOnGrid(bool on) { performToggleAction(on, onGrid, &Schematic::elementsOnGrid, &MouseActions::MMoveOnGrid, &MouseActions::MPressOnGrid); }
// ----------------------------------------------------------------------- // Is called, when "move component text" action is activated. void QucsApp::slotMoveText(bool on) { performToggleAction(on, moveText, 0, &MouseActions::MMoveMoveTextB, &MouseActions::MPressMoveText); }
// ----------------------------------------------------------------------- void QucsApp::slotSetMarker(bool on) { performToggleAction(on, setMarker, 0, &MouseActions::MMoveMarker, &MouseActions::MPressMarker); }
// ----------------------------------------------------------------------- void QucsApp::slotInsertLabel(bool on) { performToggleAction(on, insLabel, 0, &MouseActions::MMoveLabel, &MouseActions::MPressLabel); }
// ----------------------------------------------------------------------- // Is called if "Wire"-Button is pressed. void QucsApp::slotSetWire(bool on) { performToggleAction(on, insWire, 0, &MouseActions::MMoveWire1, &MouseActions::MPressWire1); }
// ----------------------------------------------------------------------- // Is called when the mirror toolbar button is pressed. void QucsApp::slotEditMirrorY(bool on) { performToggleAction(on, editMirrorY, &Schematic::mirrorYComponents, &MouseActions::MMoveMirrorY, &MouseActions::MPressMirrorY); }
// ----------------------------------------------------------------------- // Is called when the rotate toolbar button is pressed. void QucsApp::slotEditRotate(bool on) { performToggleAction(on, editRotate, &Schematic::rotateElements, &MouseActions::MMoveRotate, &MouseActions::MPressRotate); }