/* resets the map rotation to zero degrees */ void WinMapControl::resetRotation() { /* set the rotation to zero */ m_mapHandler->setAngle(0); /* request a repaint */ doRepaint(); return; }
/* zooms the map */ void WinMapControl::zoomMap(float32 factor) { /* tell the map Handler to zoom the map */ m_mapHandler->zoom(factor); /* request a repaint */ doRepaint(); return; }
/* rotates the map */ void WinMapControl::rotateMap(int32 angle) { /* tell the map Handler to rotate the map to the left */ m_mapHandler->rotateLeftDeg(angle); /* request a repaint */ doRepaint(); return; }
/* moves the map */ void WinMapControl::moveMap(int32 dx, int32 dy) { /* tell the map Handler to move the map */ m_mapHandler->move(dx, dy); /* request a repaint */ doRepaint(); return; }
void MarkerWidget::contextMenuEvent( QContextMenuEvent *e ) { QPopupMenu m( 0, "editor_breakpointsmenu" ); int toggleBreakPoint = 0; // int editBreakpoints = 0; QTextParagraph *p = ( (Editor*)viewManager->currentView() )->document()->firstParagraph(); int yOffset = ( (Editor*)viewManager->currentView() )->contentsY(); bool supports = ( (Editor*)viewManager->currentView() )->supportsBreakPoints(); while ( p && supports ) { if ( e->y() >= p->rect().y() - yOffset && e->y() <= p->rect().y() + p->rect().height() - yOffset ) { if ( ( (ParagData*)p->extraData() )->marker == ParagData::Breakpoint ) toggleBreakPoint = m.insertItem( tr( "Clear Breakpoint\tF9" ) ); else toggleBreakPoint = m.insertItem( tr( "Set Breakpoint\tF9" ) ); // editBreakpoints = m.insertItem( tr( "Edit Breakpoints..." ) ); m.insertSeparator(); break; } p = p->next(); } const int collapseAll = m.insertItem( tr( "Collapse All" ) ); const int expandAll = m.insertItem( tr( "Expand All" ) ); const int collapseFunctions = m.insertItem( tr( "Collapse all Functions" ) ); const int expandFunctions = m.insertItem( tr( "Expand all Functions" ) ); int res = m.exec( e->globalPos() ); if ( res == -1) return; if ( res == collapseAll ) { emit collapse( TRUE ); } else if ( res == collapseFunctions ) { emit collapse( FALSE ); } else if ( res == expandAll ) { emit expand( TRUE ); } else if ( res == expandFunctions ) { emit expand( FALSE ); } else if ( res == toggleBreakPoint ) { if ( ( (ParagData*)p->extraData() )->marker == ParagData::Breakpoint ) { ( (ParagData*)p->extraData() )->marker = ParagData::NoMarker; } else { bool ok; isBreakpointPossible( ok, ( (Editor*)viewManager->currentView() )->text(), p->paragId() ); if ( ok ) ( (ParagData*)p->extraData() )->marker = ParagData::Breakpoint; else emit showMessage( tr( "<font color=red>Can't set breakpoint here!</font>" ) ); } // } else if ( res == editBreakpoints ) { // emit editBreakPoints(); } doRepaint(); emit markersChanged(); }
/* resizes the control to the specified dimensions returns true on success, false on error */ bool WinMapControl::resize(int32 nW, int32 nH) { if(m_plotter->resize(nW, nH)) { /* success, do a repaint */ doRepaint(); return( true ); } /* resize didn't work */ return( false ); }
void WinSkinVis::scopeEvent(float* bandPtr, unsigned int bands) { for (unsigned int i = 0;i < bands;i++) { float value=bandPtr[i]; // if the peak is less we prefer the higher one if (m_currentPeaks[i] < value) m_currentPeaks[i] = value; else m_currentPeaks[i] = m_currentPeaks[i]-1.3; if (m_currentPeaks[i] < 0.0) m_currentPeaks[i] = 0.0; if (m_currentPeaks[i] > __SPAHEIGHT) m_currentPeaks[i]=__SPAHEIGHT; } emit(doRepaint()); }
CharacterWidget::CharacterWidget(QWidget *parent, CharSetCharacter ch) : QWidget(parent), m_character(ch) { m_dobitshift = true; m_showgrid = true; // setMaximumSize(this->size()); // setMinimumSize(this->size()); m_pixmap = QPixmap(this->size()); setFgColor(Qt::black); setBgColor(Qt::white); setGridColor(Qt::red); QString name = QChar(ch.asciiVal()); if (ch.asciiVal() == ' ') { name = "<Space>"; } if (ch.asciiVal() == 0x7f) { name = "<Delete>"; } QString ttstring = QString("Ascii: %1\nCharacter: %2").arg(ch.asciiVal()).arg(name); setToolTip(ttstring); doRepaint(); }
void MarkerWidget::mousePressEvent( QMouseEvent *e ) { if ( e->button() != LeftButton ) return; bool supports = ( (Editor*)viewManager->currentView() )->supportsBreakPoints(); QTextParagraph *p = ( (Editor*)viewManager->currentView() )->document()->firstParagraph(); int yOffset = ( (Editor*)viewManager->currentView() )->contentsY(); while ( p ) { if ( e->y() >= p->rect().y() - yOffset && e->y() <= p->rect().y() + p->rect().height() - yOffset ) { QTextParagraphData *d = p->extraData(); if ( !d ) return; ParagData *data = (ParagData*)d; if ( supports && ( e->x() < width() - 15 ) ) { if ( data->marker == ParagData::Breakpoint ) { data->marker = ParagData::NoMarker; } else { bool ok = TRUE; isBreakpointPossible( ok, ( (Editor*)viewManager->currentView() )->text(), p->paragId() ); if ( ok ) data->marker = ParagData::Breakpoint; else emit showMessage( tr( "<font color=red>Can't set breakpoint here!</font>" ) ); } } else { if ( data->lineState == ParagData::FunctionStart ) { if ( data->functionOpen ) emit collapseFunction( p ); else emit expandFunction( p ); } } break; } p = p->next(); } doRepaint(); emit markersChanged(); }
void GuiSpectrumAnalyser::setVisualizationMode(int mode) { visualization_mode = mode; visualizationMenu->setItemChecked(MODE_ANALYSER, (mode == MODE_ANALYSER)); visualizationMenu->setItemChecked(MODE_DISABLED, (mode == MODE_DISABLED)); if (mode == MODE_ANALYSER) { if (!winSkinVis) { winSkinVis=new WinSkinVis(this,"WinSkinVis"); connect(winSkinVis,SIGNAL(doRepaint()),this,SLOT(updatePeaks())); } } else { delete winSkinVis; winSkinVis = NULL; } update(); }
void CharacterWidget::enableBitShift(bool enable) { m_dobitshift = enable; doRepaint(); }
void CharacterWidget::showGrid(bool show) { m_showgrid = show; doRepaint(); }
void CharacterWidget::setGridColor(QColor color) { m_gridcolor = color; doRepaint(); }
void CharacterWidget::setBgColor(QColor color) { m_bgcolor = color; doRepaint(); }
void CharacterWidget::resizeEvent(QResizeEvent *event) { m_pixmap = m_pixmap.scaled(event->size().width(),event->size().height()); doRepaint(); }