diff options
Diffstat (limited to 'kmplot/kmplot/View.cpp')
-rw-r--r-- | kmplot/kmplot/View.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/kmplot/kmplot/View.cpp b/kmplot/kmplot/View.cpp index 0d45fd2c..288a9de6 100644 --- a/kmplot/kmplot/View.cpp +++ b/kmplot/kmplot/View.cpp @@ -23,7 +23,7 @@ * */ -// Qt includes +// TQt includes #include <tqbitmap.h> #include <tqcursor.h> #include <tqdatastream.h> @@ -56,7 +56,7 @@ double View::xmin = 0; double View::xmax = 0; -View::View(bool const r, bool &mo, KPopupMenu *p, TQWidget* parent, const char* name ) : DCOPObject("View"), TQWidget( parent, name , WStaticContents ), buffer( width(), height() ), m_popupmenu(p), m_modified(mo), m_readonly(r), m_dcop_client(KApplication::kApplication()->dcopClient()) +View::View(bool const r, bool &mo, KPopupMenu *p, TQWidget* tqparent, const char* name ) : DCOPObject("View"), TQWidget( tqparent, name , WStaticContents ), buffer( width(), height() ), m_popupmenu(p), m_modified(mo), m_readonly(r), m_dcop_client(KApplication::kApplication()->dcopClient()) { csmode = csparam = -1; cstype = 0; @@ -140,7 +140,7 @@ void View::draw(TQPaintDevice *dev, int form) DC.resetXForm(); DC.scale((float)w/(float)(lx+2*ref.x()), (float)w/(float)(lx+2*ref.x())); } - wm=DC.worldMatrix(); + wm=DC.tqworldMatrix(); s=DC.xForm(TQPoint(1000, 0)).x()/1000.; dgr.Create( ref, lx, ly, xmin, xmax, ymin, ymax ); } @@ -211,7 +211,7 @@ void View::draw(TQPaintDevice *dev, int form) stepWidth=Settings::stepWidth(); isDrawing=true; - setCursor(Qt::WaitCursor ); + setCursor(TQt::WaitCursor ); stop_calculating = false; for(TQValueVector<Ufkt>::iterator ufkt=m_parser->ufkt.begin(); ufkt!=m_parser->ufkt.end() && !stop_calculating; ++ufkt) if ( !ufkt->fname.isEmpty() ) @@ -531,7 +531,7 @@ void View::setpi(TQString *s) int i; TQChar c(960); - while((i=s->find('p')) != -1) s->replace(i, 2, &c, 1); + while((i=s->tqfind('p')) != -1) s->tqreplace(i, 2, &c, 1); } @@ -594,7 +594,7 @@ void View::drawPlot() if( m_minmax->isShown() ) m_minmax->updateFunctions(); buffer.fill(backgroundcolor); - draw(&buffer, 0); + draw(TQT_TQPAINTDEVICE(&buffer), 0); TQPainter p; p.begin(this); bitBlt( this, 0, 0, &buffer, 0, 0, width(), height() ); @@ -613,11 +613,11 @@ void View::mouseMoveEvent(TQMouseEvent *e) p.end(); TQPainter painter(this); - TQPen pen(Qt::white, 1, Qt::DotLine); - painter.setRasterOp (Qt::XorROP); + TQPen pen(TQt::white, 1, TQt::DotLine); + painter.setRasterOp (TQt::XorROP); painter.setPen(pen); - painter.setBackgroundMode (TQPainter::OpaqueMode); - painter.setBackgroundColor (Qt::blue); + painter.setBackgroundMode (Qt::OpaqueMode); + painter.setBackgroundColor (TQt::blue); painter.drawRect(rectangle_point.x(), rectangle_point.y(), e->pos().x()-rectangle_point.x(), e->pos().y()-rectangle_point.y()); return; @@ -639,7 +639,7 @@ void View::mouseMoveEvent(TQMouseEvent *e) csflg=0; } - if(area.contains(e->pos()) || (e->button()==Qt::LeftButton && e->state()==Qt::LeftButton && csxpos>xmin && csxpos<xmax)) + if(area.tqcontains(e->pos()) || (e->button()==Qt::LeftButton && e->state()==Qt::LeftButton && csxpos>xmin && csxpos<xmax)) { TQPoint ptd, ptl; TQPainter DC; @@ -752,7 +752,7 @@ void View::mouseMoveEvent(TQMouseEvent *e) DC.end(); } csflg=1; - setCursor(Qt::blankCursor); + setCursor(TQt::blankCursor); setStatusBar(sx, 1); setStatusBar(sy, 2); } @@ -862,7 +862,7 @@ void View::mousePressEvent(TQMouseEvent *e) } double const g=tlgy*double(xmax-xmin)/(2*double(ymax-ymin)); - if( !m_readonly && e->button()==RightButton) //clicking with the right mouse button + if( !m_readonly && e->button()==Qt::RightButton) //clicking with the right mouse button { char function_type; for( TQValueVector<Ufkt>::iterator it = m_parser->ufkt.begin(); it != m_parser->ufkt.end(); ++it) @@ -887,10 +887,10 @@ void View::mousePressEvent(TQMouseEvent *e) it->setParameter( sw->slider->value() ); } - if ( function_type=='x' && fabs(csxpos-m_parser->fkt(it, csxpos))< g && it->fstr.contains('t')==1) //parametric plot + if ( function_type=='x' && fabs(csxpos-m_parser->fkt(it, csxpos))< g && it->fstr.tqcontains('t')==1) //parametric plot { TQValueVector<Ufkt>::iterator ufkt_y = it+1; - if ( fabs(csypos-m_parser->fkt(ufkt_y, csxpos)<g) && ufkt_y->fstr.contains('t')==1) + if ( fabs(csypos-m_parser->fkt(ufkt_y, csxpos)<g) && ufkt_y->fstr.tqcontains('t')==1) { if ( csmode == -1) { @@ -942,7 +942,7 @@ void View::mousePressEvent(TQMouseEvent *e) else m_popupmenushown = 2; TQString function = it->fstr; - function = function.left(function.find('(')) + '\''; + function = function.left(function.tqfind('(')) + '\''; m_popupmenu->changeTitle(10, function); m_popupmenu->exec(TQCursor::pos()); return; @@ -959,7 +959,7 @@ void View::mousePressEvent(TQMouseEvent *e) else m_popupmenushown = 2; TQString function = it->fstr; - function = function.left(function.find('(')) + "\'\'"; + function = function.left(function.tqfind('(')) + "\'\'"; m_popupmenu->changeTitle(10, function); m_popupmenu->exec(TQCursor::pos()); return; @@ -969,7 +969,7 @@ void View::mousePressEvent(TQMouseEvent *e) } return; } - if(e->button()!=LeftButton) return ; + if(e->button()!=Qt::LeftButton) return ; if(csmode>=0) //disable trace mode if trace mode is enable { csmode=-1; @@ -1019,7 +1019,7 @@ void View::mousePressEvent(TQMouseEvent *e) csparam = k; m_minmax->selectItem(); TQString function = it->fstr; - function = function.left(function.find('(')) + '\''; + function = function.left(function.tqfind('(')) + '\''; setStatusBar(function,4); mouseMoveEvent(e); return; @@ -1031,7 +1031,7 @@ void View::mousePressEvent(TQMouseEvent *e) csparam = k; m_minmax->selectItem(); TQString function = it->fstr; - function = function.left(function.find('(')) + "\'\'"; + function = function.left(function.tqfind('(')) + "\'\'"; setStatusBar(function,4); mouseMoveEvent(e); return; @@ -1221,7 +1221,7 @@ void View::findMinMaxValue(Ufkt *ufkt, char p_mode, bool minimum, double &dmin, } isDrawing=true; - setCursor(Qt::WaitCursor ); + setCursor(TQt::WaitCursor ); double dx; if ( p_mode == 3) @@ -1404,7 +1404,7 @@ void View::getYValue(Ufkt *ufkt, char p_mode, double x, double &y, const TQStri stop_calculating = false; isDrawing=true; - setCursor(Qt::WaitCursor ); + setCursor(TQt::WaitCursor ); bool target_found=false; startProgressBar((int) double((dmax-dmin)/dx)/2); x = ufkt->oldx = ufkt->startx; //the initial x-point @@ -1449,7 +1449,7 @@ void View::getYValue(Ufkt *ufkt, char p_mode, double x, double &y, const TQStri void View::keyPressEvent( TQKeyEvent * e) { - if ( zoom_mode != Z_Normal && e->key() == Qt::Key_Escape ) + if ( zoom_mode != Z_Normal && e->key() == TQt::Key_Escape ) { resetZoom(); return; @@ -1470,11 +1470,11 @@ void View::keyPressEvent( TQKeyEvent * e) if (csmode==-1 ) return; TQMouseEvent *event; - if (e->key() == Qt::Key_Left ) + if (e->key() == TQt::Key_Left ) event = new TQMouseEvent(TQEvent::MouseMove,TQPoint(fcx-1,fcy-1),Qt::LeftButton,Qt::LeftButton); - else if (e->key() == Qt::Key_Right ) + else if (e->key() == TQt::Key_Right ) event = new TQMouseEvent(TQEvent::MouseMove,TQPoint(fcx+1,fcy+1),Qt::LeftButton,Qt::LeftButton); - else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Down) //switch graph in trace mode + else if (e->key() == TQt::Key_Up || e->key() == TQt::Key_Down) //switch graph in trace mode { TQValueVector<Ufkt>::iterator it = &m_parser->ufkt[m_parser->ixValue(csmode)]; int const ke=it->parameters.count(); @@ -1561,21 +1561,21 @@ void View::keyPressEvent( TQKeyEvent * e) case 1: { TQString function = it->fstr; - function = function.left(function.find('(')) + '\''; + function = function.left(function.tqfind('(')) + '\''; setStatusBar(function,4); break; } case 2: { TQString function = it->fstr; - function = function.left(function.find('(')) + "\'\'"; + function = function.left(function.tqfind('(')) + "\'\'"; setStatusBar(function,4); break; } } event = new TQMouseEvent(TQEvent::MouseMove,TQPoint(fcx,fcy),Qt::LeftButton,Qt::LeftButton); } - else if ( e->key() == Qt::Key_Space ) + else if ( e->key() == TQt::Key_Space ) { event = new TQMouseEvent(TQEvent::MouseButtonPress,TQCursor::pos(),Qt::RightButton,Qt::RightButton); mousePressEvent(event); @@ -1672,7 +1672,7 @@ void View::areaUnderGraph( Ufkt *ufkt, char const p_mode, double &dmin, double int const origoy = dgr.Transy(0.0); int const rectwidth = dgr.Transx(dx)- dgr.Transx(0.0)+1; - setCursor(Qt::WaitCursor ); + setCursor(TQt::WaitCursor ); isDrawing=true; bool forward_direction; @@ -1681,7 +1681,7 @@ void View::areaUnderGraph( Ufkt *ufkt, char const p_mode, double &dmin, double else forward_direction = true; - int intervals = qRound((dmax-dmin)/dx); + int intervals = tqRound((dmax-dmin)/dx); int at = 0; while ((at<=intervals) || (p_mode == 3 && x>=dmin && !forward_direction) || (p_mode == 3 && x<=dmax && forward_direction)) @@ -1801,7 +1801,7 @@ void View::areaUnderGraph( Ufkt *ufkt, char const p_mode, double &dmin, double DC->end(); setFocus(); update(); - draw(&buffer,0); + draw(TQT_TQPAINTDEVICE(&buffer),0); } if ( calculated_area>0) @@ -1883,7 +1883,7 @@ void View::mnuHide_clicked() } else { - TQKeyEvent *event = new TQKeyEvent(TQKeyEvent::KeyPress,Qt::Key_Up ,Qt::Key_Up ,0); + TQKeyEvent *event = new TQKeyEvent(TQKeyEvent::KeyPress,TQt::Key_Up ,TQt::Key_Up ,0); keyPressEvent(event); //change selected graph delete event; return; @@ -1894,7 +1894,7 @@ void View::mnuRemove_clicked() if ( csmode == -1 ) return; - if ( KMessageBox::warningContinueCancel(this,i18n("Are you sure you want to remove this function?"), TQString::null, KStdGuiItem::del()) == KMessageBox::Continue ) + if ( KMessageBox::warningContinueCancel(this,i18n("Are you sure you want to remove this function?"), TQString(), KStdGuiItem::del()) == KMessageBox::Continue ) { Ufkt *ufkt = &m_parser->ufkt[m_parser->ixValue(csmode)]; char const function_type = ufkt->fstr[0].latin1(); @@ -1973,7 +1973,7 @@ void View::mnuMove_clicked() void View::mnuNoZoom_clicked() { - setCursor(Qt::ArrowCursor); + setCursor(TQt::ArrowCursor); zoom_mode = Z_Normal; } @@ -1983,7 +1983,7 @@ void View::mnuRectangular_clicked() resetZoom(); else { - setCursor(Qt::CrossCursor); + setCursor(TQt::CrossCursor); zoom_mode = Z_Rectangular; } } @@ -2014,7 +2014,7 @@ void View::mnuCenter_clicked() resetZoom(); else { - setCursor(Qt::PointingHandCursor); + setCursor(TQt::PointingHandCursor); zoom_mode = Z_Center; } } @@ -2053,10 +2053,10 @@ void View::restoreCursor() switch (zoom_mode) { case Z_Normal: //no zoom - setCursor(Qt::ArrowCursor); + setCursor(TQt::ArrowCursor); break; case Z_Rectangular: //rectangle zoom - setCursor(Qt::CrossCursor); + setCursor(TQt::CrossCursor); break; case Z_ZoomIn: //zoom in setCursor( TQCursor( SmallIcon( "magnify", 32), 10, 10 ) ); @@ -2065,7 +2065,7 @@ void View::restoreCursor() setCursor( TQCursor( SmallIcon( "lessen", 32), 10, 10 ) ); break; case Z_Center: //center a point - setCursor(Qt::PointingHandCursor); + setCursor(TQt::PointingHandCursor); break; } } |