author | mickeyl <mickeyl> | 2004-08-24 11:53:43 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-08-24 11:53:43 (UTC) |
commit | b06390cb17114692a9fd5233d77620b385252480 (patch) (side-by-side diff) | |
tree | 91de2ed5b0eb6ed739eb6bd0126e2ad004d6a9bd /noncore/net/wellenreiter/gui/graphwindow.cpp | |
parent | 94611edc1942717faa15861adef25418e40ea626 (diff) | |
download | opie-b06390cb17114692a9fd5233d77620b385252480.zip opie-b06390cb17114692a9fd5233d77620b385252480.tar.gz opie-b06390cb17114692a9fd5233d77620b385252480.tar.bz2 |
apply megapatch courtesy Holger 'Zecke' Freyther:
- bump version to 1.0.3-cvs
- fix compile warnings
- fix PacketViewer not to scroll, when watching in "real time"
- fix appending text to log view
- update statistics when tab is getting activated
Diffstat (limited to 'noncore/net/wellenreiter/gui/graphwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/graphwindow.cpp | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/noncore/net/wellenreiter/gui/graphwindow.cpp b/noncore/net/wellenreiter/gui/graphwindow.cpp index b4174d3..d53421c 100644 --- a/noncore/net/wellenreiter/gui/graphwindow.cpp +++ b/noncore/net/wellenreiter/gui/graphwindow.cpp @@ -16,12 +16,39 @@ #include "graphwindow.h" #include <qpainter.h> #include <qpixmap.h> #include <qtimer.h> +/* XPM */ +static char * background[] = { +"16 16 6 1", +" c None", +". c #52676E", +"+ c #3F545B", +"@ c #394E56", +"# c #2F454C", +"$ c #364B52", +".+++++++++++++++", +"@###############", +"+$$$$$$$$$$$$$$$", +"@###############", +"+$$$$$$$$$$$$$$$", +"@###############", +"+$$$$$$$$$$$$$$$", +"@###############", +"+$$$$$$$$$$$$$$$", +"@###############", +"+$$$$$$$$$$$$$$$", +"@###############", +"+$$$$$$$$$$$$$$$", +"@###############", +"+$$$$$$$$$$$$$$$", +"@###############"}; + + MFrequencySpectrum::MFrequencySpectrum( int channels, QWidget* parent, const char* name, WFlags f) :QWidget( parent, name,f ), _channels( channels ) { _values = new int[_channels]; _dirty = new bool[_channels]; for ( int i = 0; i < channels; ++i ) @@ -82,13 +109,13 @@ void MFrequencySpectrum::drawBar( QPainter* p, int x, int y, int width, int heig else drawLine( p, x, y-i, width, QColor( h,s,v, QColor::Hsv ) ); } } -void MFrequencySpectrum::paintEvent( QPaintEvent* e ) +void MFrequencySpectrum::paintEvent( QPaintEvent* ) { QPixmap pm( size() ); QPainter p; p.begin( &pm ); p.drawTiledPixmap( 0, 0, size().width(), size().height(), QPixmap( (const char**) &background ) ); @@ -115,13 +142,12 @@ void MFrequencySpectrum::paintEvent( QPaintEvent* e ) void MFrequencySpectrum::mousePressEvent( QMouseEvent* e ) { int xmargin = 5; int ymargin = 2; int y = size().height() - 2 * ymargin; - int x = 0; int width = ( size().width() - 2 * xmargin ) / _channels; QPoint pos = e->pos(); int channel = ( pos.x()-xmargin ) / width; int height = 100 - ( pos.y()-ymargin )*100/y; if ( channel < 15 ) _values[channel] = height; @@ -139,14 +165,12 @@ Legende::Legende( int channels, QWidget* parent, const char* name, WFlags f ) } void Legende::drawContents( QPainter* p ) { int xmargin = 5; - int ymargin = 2; - int x = 0; int width = ( contentsRect().width() - 2 * xmargin ) / _channels; for ( int i = 0; i < _channels; ++i ) p->drawText( xmargin + (width*i), 12, QString().sprintf( "%02d", i+1 ) ); } @@ -167,13 +191,13 @@ void MGraphWindow::testGraph() if ( i == 14 ) i = 0; QTimer::singleShot( 2000, this, SLOT( testGraph() ) ); } -void MGraphWindow::timerEvent( QTimerEvent* e ) +void MGraphWindow::timerEvent( QTimerEvent* ) { for ( int i = 0; i < 14; i++ ) { spectrum->decrease( i, 1 ); } spectrum->repaint(); |