Commit cc022ad6 authored by David Saxton's avatar David Saxton

More Qt4 porting (ui3->ui4, Q3ValueVector->QVector, Q3ValueList->QList).

svn path=/trunk/KDE/kdeedu/kmplot/; revision=522070
parent fb665e13
......@@ -152,7 +152,7 @@ void FktDlg::slotEdit()
int FktDlg::getId( const QString &f_str )
{
for( Q3ValueVector<Ufkt>::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it)
for( QVector<Ufkt>::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it)
{
if ( it->fstr == f_str )
return it->id;
......@@ -163,7 +163,7 @@ int FktDlg::getId( const QString &f_str )
int FktDlg::getParamId( const QString &f_str)
{
QString const fname = f_str.section( "(", 0, 0 );
for( Q3ValueVector<Ufkt>::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it)
for( QVector<Ufkt>::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it)
{
if ( it->fname == fname )
return it->id;
......@@ -281,7 +281,7 @@ void FktDlg::getPlots()
lb_fktliste->clear();
// adding all yet added functions
for( Q3ValueVector<Ufkt>::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it)
for( QVector<Ufkt>::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it)
{
if( it->fname.isEmpty() || it->fstr[0] == 'y' ) continue;
Q3CheckListItem *item;
......
......@@ -742,7 +742,7 @@ void MainDlg::loadConstants()
while (!copy_found)
{
// go through the constant list
Q3ValueVector<Constant>::iterator it = view->parser()->constant.begin();
QVector<Constant>::iterator it = view->parser()->constant.begin();
while (it!= view->parser()->constant.end() && !copy_found)
{
if (constant == it->constant )
......
......@@ -38,7 +38,7 @@
#include <QPaintEvent>
#include <QKeyEvent>
#include <QEvent>
#include <Q3ValueList>
#include <QList>
#include <QResizeEvent>
#include <QMouseEvent>
......@@ -217,7 +217,7 @@ void View::draw(QPaintDevice *dev, int form)
isDrawing=true;
setCursor(Qt::WaitCursor );
stop_calculating = false;
for(Q3ValueVector<Ufkt>::iterator ufkt=m_parser->ufkt.begin(); ufkt!=m_parser->ufkt.end() && !stop_calculating; ++ufkt)
for(QVector<Ufkt>::iterator ufkt=m_parser->ufkt.begin(); ufkt!=m_parser->ufkt.end() && !stop_calculating; ++ufkt)
if ( !ufkt->fname.isEmpty() )
plotfkt(ufkt, &DC);
......@@ -504,7 +504,7 @@ void View::drawHeaderTable(QPainter *pDC)
pDC->Lineh(0, 320, 700);
int ypos = 380;
//for(uint ix=0; ix<m_parser->countFunctions() && !stop_calculating; ++ix)
for(Q3ValueVector<Ufkt>::iterator it=m_parser->ufkt.begin(); it!=m_parser->ufkt.end() && !stop_calculating; ++it)
for(QVector<Ufkt>::iterator it=m_parser->ufkt.begin(); it!=m_parser->ufkt.end() && !stop_calculating; ++it)
{
pDC->drawText(100, ypos, it->fstr);
ypos+=60;
......@@ -908,7 +908,7 @@ void View::mousePressEvent(QMouseEvent *e)
if( !m_readonly && e->button()==Qt::RightButton) //clicking with the right mouse button
{
char function_type;
for( Q3ValueVector<Ufkt>::iterator it = m_parser->ufkt.begin(); it != m_parser->ufkt.end(); ++it)
for( QVector<Ufkt>::iterator it = m_parser->ufkt.begin(); it != m_parser->ufkt.end(); ++it)
{
function_type = it->fstr[0].latin1();
if ( function_type=='y' || function_type=='r' || it->fname.isEmpty()) continue;
......@@ -932,7 +932,7 @@ void View::mousePressEvent(QMouseEvent *e)
if ( function_type=='x' && fabs(csxpos-m_parser->fkt(it, csxpos))< g && it->fstr.contains('t')==1) //parametric plot
{
Q3ValueVector<Ufkt>::iterator ufkt_y = it+1;
QVector<Ufkt>::iterator ufkt_y = it+1;
if ( fabs(csypos-m_parser->fkt(ufkt_y, csxpos)<g) && ufkt_y->fstr.contains('t')==1)
{
if ( csmode == -1)
......@@ -1021,7 +1021,7 @@ void View::mousePressEvent(QMouseEvent *e)
mouseMoveEvent(e);
return ;
}
for( Q3ValueVector<Ufkt>::iterator it = m_parser->ufkt.begin(); it != m_parser->ufkt.end(); ++it)
for( QVector<Ufkt>::iterator it = m_parser->ufkt.begin(); it != m_parser->ufkt.end(); ++it)
{
if (it->fname.isEmpty() )
continue;
......@@ -1236,7 +1236,7 @@ void View::getSettings()
void View::init()
{
getSettings();
Q3ValueVector<Ufkt>::iterator it = m_parser->ufkt.begin();
QVector<Ufkt>::iterator it = m_parser->ufkt.begin();
it->fname="";
while ( m_parser->ufkt.count() > 1)
m_parser->Parser::delfkt( &m_parser->ufkt.last() );
......@@ -1259,7 +1259,7 @@ void View::findMinMaxValue(Ufkt *ufkt, char p_mode, bool minimum, double &dmin,
// TODO: parameter sliders
if ( !ufkt->parameters.isEmpty() )
{
for ( Q3ValueList<ParameterValueItem>::Iterator it = ufkt->parameters.begin(); it != ufkt->parameters.end(); ++it )
for ( QList<ParameterValueItem>::Iterator it = ufkt->parameters.begin(); it != ufkt->parameters.end(); ++it )
{
if ( (*it).expression == str_parameter)
{
......@@ -1408,7 +1408,7 @@ void View::getYValue(Ufkt *ufkt, char p_mode, double x, double &y, const QStrin
// TODO: parameter sliders
if ( !ufkt->parameters.isEmpty() )
{
for ( Q3ValueList<ParameterValueItem>::Iterator it = ufkt->parameters.begin(); it != ufkt->parameters.end(); ++it )
for ( QList<ParameterValueItem>::Iterator it = ufkt->parameters.begin(); it != ufkt->parameters.end(); ++it )
{
if ( (*it).expression == str_parameter)
{
......@@ -1520,7 +1520,7 @@ void View::keyPressEvent( QKeyEvent * e)
event = new QMouseEvent(QEvent::MouseMove,QPoint(int(fcx+1),int(fcy+1)),Qt::LeftButton,Qt::LeftButton);
else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Down) //switch graph in trace mode
{
Q3ValueVector<Ufkt>::iterator it = &m_parser->ufkt[m_parser->ixValue(csmode)];
QVector<Ufkt>::iterator it = &m_parser->ufkt[m_parser->ixValue(csmode)];
int const ke=it->parameters.count();
if (ke>0)
{
......@@ -1678,7 +1678,7 @@ void View::areaUnderGraph( Ufkt *ufkt, char const p_mode, double &dmin, double
// TODO: parameter sliders
if ( !ufkt->parameters.isEmpty() )
{
for ( Q3ValueList<ParameterValueItem>::Iterator it = ufkt->parameters.begin(); it != ufkt->parameters.end(); ++it )
for ( QList<ParameterValueItem>::Iterator it = ufkt->parameters.begin(); it != ufkt->parameters.end(); ++it )
{
if ( (*it).expression == str_parameter)
{
......@@ -1868,7 +1868,7 @@ void View::updateSliders()
}
}
for(Q3ValueVector<Ufkt>::iterator it=m_parser->ufkt.begin(); it!=m_parser->ufkt.end(); ++it)
for(QVector<Ufkt>::iterator it=m_parser->ufkt.begin(); it!=m_parser->ufkt.end(); ++it)
{
if (it->fname.isEmpty() ) continue;
if( it->use_slider > -1 && (it->f_mode || it->f1_mode || it->f2_mode || it->integral_mode))
......
......@@ -230,7 +230,9 @@ void CDiagr::drawAxes( QPainter* pDC ) // draw axes
if( Settings::showAxes() )
{
pDC->setPen( QPen( QColor(axesColor), axesLineWidth ) );
pDC->Lineh(PlotArea.left(), b=TransyToPixel(0.), a=PlotArea.right()); // x-Achse
a=PlotArea.right();
b=TransyToPixel(0.);
pDC->Lineh(PlotArea.left(), b, a); // x-Achse
if( Settings::showArrows()) // ARROWS
{ int const dx=40;
int const dy=15;
......@@ -238,7 +240,9 @@ void CDiagr::drawAxes( QPainter* pDC ) // draw axes
pDC->Line( QPointF( a, b ), QPointF( a-dx, b-dy) );
}
pDC->Linev(a=TransxToPixel(0.), PlotArea.bottom(), b=PlotArea.top()); // y-Achse
a=TransxToPixel(0.);
b=PlotArea.top();
pDC->Linev(a, PlotArea.bottom(), b); // y-Achse
if( Settings::showArrows() ) // ARROWS
{ int const dx=15;
int const dy=40;
......
......@@ -71,9 +71,6 @@ EditFunction::EditFunction( XParser* parser, QWidget* parent, const char* name )
editfunctionpage->listOfSliders->insertItem( i18n( "Slider No. %1" ).arg( number +1) );
}
connect( editfunctionpage->cmdParameter, SIGNAL ( clicked() ), this, SLOT( cmdParameter_clicked() ) );
connect( editfunctionpage->useNoParameter, SIGNAL ( toggled(bool) ), this, SLOT( noParameter_toggled(bool) ) );
connect( editfunctionpage->customMinRange, SIGNAL ( toggled(bool) ), this, SLOT( customMinRange_toggled(bool) ) );
connect( editfunctionpage->customMaxRange, SIGNAL ( toggled(bool) ), this, SLOT( customMaxRange_toggled(bool) ) );
m_updatedfunction = 0;
}
......@@ -178,7 +175,7 @@ void EditFunction::accept()
m_parser->fixFunctionName(f_str, XParser::Function);
if ( f_str.at(0)== 'x' || f_str.at(0)== 'y' || f_str.at(0)== 'r')
{
KMessageBox::error( this, i18n("You can only define plot functions in this dialog"));
KMessageBox::sorry( this, i18n("You can only define plot functions in this dialog"));
return;
}
......@@ -218,7 +215,7 @@ void EditFunction::accept()
{
if ( tmp_ufkt.dmin >= tmp_ufkt.dmax)
{
KMessageBox::error(this,i18n("The minimum range value must be lower than the maximum range value"));
KMessageBox::sorry(this,i18n("The minimum range value must be lower than the maximum range value"));
showPage(0);
editfunctionpage->min->setFocus();
editfunctionpage->min->selectAll();
......@@ -227,7 +224,7 @@ void EditFunction::accept()
if ( tmp_ufkt.dmin<View::xmin || tmp_ufkt.dmax>View::xmax )
{
KMessageBox::error(this,i18n("Please insert a minimum and maximum range between %1 and %2").arg(View::xmin).arg(View::xmax) );
KMessageBox::sorry(this,i18n("Please insert a minimum and maximum range between %1 and %2").arg(View::xmin).arg(View::xmax) );
showPage(0);
editfunctionpage->min->setFocus();
editfunctionpage->min->selectAll();
......@@ -245,7 +242,7 @@ void EditFunction::accept()
tmp_ufkt.str_startx = editintegralpage->txtInitX->text();
if (m_parser->parserError(false) != 0)
{
KMessageBox::error(this,i18n("Please insert a valid x-value"));
KMessageBox::sorry(this,i18n("Please insert a valid x-value"));
showPage(2);
editintegralpage->txtInitX->setFocus();
editintegralpage->txtInitX->selectAll();
......@@ -257,7 +254,7 @@ void EditFunction::accept()
tmp_ufkt.str_starty = editintegralpage->txtInitY->text();
if (m_parser->parserError(false) != 0)
{
KMessageBox::error(this,i18n("Please insert a valid y-value"));
KMessageBox::sorry(this,i18n("Please insert a valid y-value"));
showPage(2);
editintegralpage->txtInitY->setFocus();
editintegralpage->txtInitY->selectAll();
......@@ -299,17 +296,17 @@ void EditFunction::accept()
if ( f_str.contains('y') != 0 && ( tmp_ufkt.f_mode || tmp_ufkt.f1_mode || tmp_ufkt.f2_mode) )
{
KMessageBox::error( this, i18n( "Recursive function is only allowed when drawing integral graphs") );
KMessageBox::sorry( this, i18n( "Recursive function is only allowed when drawing integral graphs") );
return;
}
}
Ufkt *added_ufkt;
if( m_id != -1 ) //when editing a function:
{
int const ix = m_parser->ixValue(m_id);
if ( ix == -1) //The function could have been deleted
{
KMessageBox::error(this,i18n("Function could not be found"));
{
KMessageBox::sorry(this,i18n("Function could not be found"));
return;
}
added_ufkt = &m_parser->ufkt[ix];
......@@ -402,30 +399,6 @@ void EditFunction::cmdParameter_clicked()
KParameterEditor *dlg = new KParameterEditor(m_parser,&m_parameter);
dlg->show();
}
void EditFunction::noParameter_toggled(bool status)
{
if (status)
{
editfunctionpage->cmdParameter->setEnabled(false);
editfunctionpage->listOfSliders->setEnabled(false);
}
}
void EditFunction::customMinRange_toggled(bool status)
{
if (status)
editfunctionpage->min->setEnabled(true);
else
editfunctionpage->min->setEnabled(false);
}
void EditFunction::customMaxRange_toggled(bool status)
{
if (status)
editfunctionpage->max->setEnabled(true);
else
editfunctionpage->max->setEnabled(false);
}
void EditFunction::fixFunctionArguments(QString &f_str)
{
......
......@@ -30,7 +30,7 @@
#include "xparser.h"
//Added by qt3to4:
#include <Q3ValueList>
#include <QList>
#include "editderivativespage.h"
#include "editfunctionpage.h"
......@@ -85,12 +85,6 @@ class EditFunction : public KDialogBase
void slotHelp();
/// Called when the "Change parameter values" is clicked
void cmdParameter_clicked();
/// Called when the no_parameter-radiobutton is toggled.
void noParameter_toggled(bool);
/// Called when customMinRange is toggled.
void customMinRange_toggled(bool);
/// Called when customMaxRange is toggled.
void customMaxRange_toggled(bool);
private:
/// Clear alls widgets values
......@@ -106,7 +100,7 @@ class EditFunction : public KDialogBase
XParser* m_parser;
/// Current function index
int m_id;
Q3ValueList<ParameterValueItem> m_parameter;
QList<ParameterValueItem> m_parameter;
EditFunctionPage* editfunctionpage;
EditDerivativesPage* editderivativespage;
......
......@@ -365,29 +365,40 @@ Example: f(x)=x^2</string>
<pixmap></pixmap>
</customwidget>
<customwidget>
<class>KPushButton</class>
<class>KLineEdit</class>
<extends></extends>
<header>kpushbutton.h</header>
<header>klineedit.h</header>
<container>0</container>
<pixmap></pixmap>
</customwidget>
<customwidget>
<class>KLineEdit</class>
<class>KIntNumInput</class>
<extends></extends>
<header>klineedit.h</header>
<header>knuminput.h</header>
<container>0</container>
<pixmap></pixmap>
</customwidget>
<customwidget>
<class>KIntNumInput</class>
<class>KPushButton</class>
<extends></extends>
<header>knuminput.h</header>
<header>kpushbutton.h</header>
<container>0</container>
<pixmap></pixmap>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>equation</tabstop>
<tabstop>hideCheck</tabstop>
<tabstop>useNoParameter</tabstop>
<tabstop>useList</tabstop>
<tabstop>cmdParameter</tabstop>
<tabstop>useSlider</tabstop>
<tabstop>listOfSliders</tabstop>
<tabstop>customMinRange</tabstop>
<tabstop>min</tabstop>
<tabstop>customMaxRange</tabstop>
<tabstop>max</tabstop>
<tabstop>color</tabstop>
</tabstops>
<resources/>
<connections>
......
......@@ -251,8 +251,6 @@
<tabstop>txtInitX</tabstop>
<tabstop>txtInitY</tabstop>
<tabstop>customPrecision</tabstop>
<tabstop>precision</tabstop>
<tabstop>lineWidth</tabstop>
<tabstop>color</tabstop>
</tabstops>
<resources/>
......
......@@ -33,7 +33,7 @@
#include <kstandarddirs.h>
#include <qpushbutton.h>
#include <qstringlist.h>
#include <q3valuevector.h>
#include <QVector>
#include <qdom.h>
#include "kmplotio.h"
......@@ -44,7 +44,7 @@ KConstantEditor::KConstantEditor(View *v, QWidget *parent, const char *name)
: QConstantEditor(parent,name), m_view(v)
{
QString str_value;
Q3ValueVector<Constant>::iterator it;
QVector<Constant>::iterator it;
for(it = m_view->parser()->constant.begin(); it!= m_view->parser()->constant.end() ;++it)
{
str_value.setNum(it->value);
......@@ -86,7 +86,7 @@ void KConstantEditor::cmdDelete_clicked()
value = varlist->currentItem()->text(1);
QString str;
for( Q3ValueVector<Ufkt>::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it)
for( QVector<Ufkt>::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it)
{
str = it->fstr;
for (int i=str.find(')'); i<str.length();i++)
......@@ -96,7 +96,7 @@ void KConstantEditor::cmdDelete_clicked()
return;
}
}
Q3ValueVector<Constant>::iterator it;
QVector<Constant>::iterator it;
for(it = m_view->parser()->constant.begin(); it!= m_view->parser()->constant.end(); ++it)
{
if ( it->constant == constant)
......@@ -148,7 +148,7 @@ void KConstantEditor::cmdDuplicate_clicked()
continue;
found = false;
Q3ValueVector<Constant>::iterator it;
QVector<Constant>::iterator it;
for(it = m_view->parser()->constant.begin(); it!= m_view->parser()->constant.end() && !found;++it)
{
if ( it->constant == i || i == constant)
......@@ -180,7 +180,7 @@ void KConstantEditor::editConstantSlot()
{
double dvalue = m_view->parser()->eval(value);
bool found = false;
Q3ValueVector<Constant>::iterator it;
QVector<Constant>::iterator it;
for(it = m_view->parser()->constant.begin(); it!= m_view->parser()->constant.end() && !found;++it)
{
if ( it->constant == constant)
......@@ -201,7 +201,7 @@ void KConstantEditor::editConstantSlot()
int index = 0;
for( Q3ValueVector<Ufkt>::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it)
for( QVector<Ufkt>::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it)
{
if( it->fstr.contains(constant)!=0 )
m_view->parser()->reparse(index); //reparsing the function
......
......@@ -67,7 +67,7 @@ void KEditConstant::cmdOK_clicked()
if ( txtConstant->isEnabled() ) //creating, not edit a constant
{
bool found= false;
Q3ValueVector<Constant>::iterator it;
QVector<Constant>::iterator it;
for(it = m_parser->constant.begin(); it!= m_parser->constant.end() && !found;++it)
{
if ( it->constant == constant)
......
This diff is collapsed.
......@@ -29,18 +29,21 @@
#include "qeditparametric.h"
#include "xparser.h"
#include <kdialog.h>
class QEditParametric;
class View;
class XParser;
/** @short Dialog window editing a parametric plot and its properties. */
class KEditParametric : public QEditParametric
class KEditParametric : public KDialog
{
Q_OBJECT
public:
/// @param parser points to the parser instance.
/// @param parent points to the parent widget.
/// @param name of this instance.
KEditParametric( XParser* parser, QWidget* parent = NULL, const char* name = NULL );
KEditParametric( XParser* parser, QWidget* parent = NULL);
/// Nothing special to do.
virtual ~KEditParametric() {};
......@@ -66,15 +69,23 @@ class KEditParametric : public QEditParametric
/// Current function indices.
int m_x_id, m_y_id;
//@}
Ufkt *m_updatedfunction;
Ufkt *m_updatedfunction;
/// Main widget
QEditParametric * m_editParametric;
protected slots:
/// Overwrites the dialog's accept() method to make sure, that the user's input is valid.
virtual void accept();
/// Invokes the HelpCenter.
void slotHelp();
void customMaxRange_toggled(bool);
void customMinRange_toggled(bool);
};
class QEditParametric : public QWidget, public Ui::QEditParametric
{
public:
QEditParametric( QWidget * parent = 0 )
: QWidget( parent )
{ setupUi(this); }
};
#endif
......@@ -36,6 +36,7 @@
#include <kdebug.h>
#include <ktoolinvocation.h>
#include <kvbox.h>
// local includes
#include "keditpolar.h"
......@@ -43,11 +44,13 @@
#include "xparser.h"
#include "View.h"
KEditPolar::KEditPolar( XParser* parser, QWidget* parent, const char* name ) :
QEditPolar( parent, name ),m_parser(parser)
KEditPolar::KEditPolar( XParser* parser, QWidget* parent )
: KDialog( parent, i18n("Edit Polar Plot"), Ok|Cancel|Help ),
m_parser(parser)
{
connect( customMinRange, SIGNAL ( toggled(bool) ), this, SLOT( customMinRange_toggled(bool) ) );
connect( customMaxRange, SIGNAL ( toggled(bool) ), this, SLOT( customMaxRange_toggled(bool) ) );
// KVBox *page = makeVBoxMainWidget();
m_editPolar = new QEditPolar( this );
setMainWidget( m_editPolar );
m_updatedfunction = 0;
}
......@@ -60,14 +63,14 @@ void KEditPolar::initDialog( int id )
void KEditPolar::clearWidgets()
{
kLineEditYFunction->clear();
checkBoxHide->setChecked( false );
customMinRange->setChecked( false );
customMaxRange->setChecked(false);
min->clear();
max->clear();
kIntNumInputLineWidth->setValue( m_parser->linewidth0 );
kColorButtonColor->setColor( m_parser->defaultColor(m_parser->getNextIndex() ) );
m_editPolar->kLineEditYFunction->clear();
m_editPolar->checkBoxHide->setChecked( false );
m_editPolar->customMinRange->setChecked( false );
m_editPolar->customMaxRange->setChecked(false);
m_editPolar->min->clear();
m_editPolar->max->clear();
m_editPolar->kIntNumInputLineWidth->setValue( m_parser->linewidth0 );
m_editPolar->kColorButtonColor->setColor( m_parser->defaultColor(m_parser->getNextIndex() ) );
}
void KEditPolar::setWidgets()
......@@ -75,31 +78,31 @@ void KEditPolar::setWidgets()
Ufkt *ufkt = &m_parser->ufkt[ m_parser->ixValue(m_id) ];
QString function = ufkt->fstr;
function = function.right( function.length()-1 );
kLineEditYFunction->setText( function );
checkBoxHide->setChecked( !ufkt->f_mode);
m_editPolar->kLineEditYFunction->setText( function );
m_editPolar->checkBoxHide->setChecked( !ufkt->f_mode);
if (ufkt->usecustomxmin)
{
customMinRange->setChecked(true);
min->setText( ufkt->str_dmin );
m_editPolar->customMinRange->setChecked(true);
m_editPolar->min->setText( ufkt->str_dmin );
}
else
customMinRange->setChecked(false);
m_editPolar->customMinRange->setChecked(false);
if (ufkt->usecustomxmin)
{
customMaxRange->setChecked(true);
max->setText( ufkt->str_dmax );
m_editPolar->customMaxRange->setChecked(true);
m_editPolar->max->setText( ufkt->str_dmax );
}
else
customMaxRange->setChecked(false);
m_editPolar->customMaxRange->setChecked(false);
kIntNumInputLineWidth->setValue( ufkt->linewidth );
kColorButtonColor->setColor( ufkt->color );
m_editPolar->kIntNumInputLineWidth->setValue( ufkt->linewidth );
m_editPolar->kColorButtonColor->setColor( ufkt->color );
}
void KEditPolar::accept()
{
QString f_str = /*"r" + */kLineEditYFunction->text();
QString f_str = /*"r" + */m_editPolar->kLineEditYFunction->text();
if ( m_id!=-1 )
m_parser->fixFunctionName(f_str, XParser::Polar, m_id);
......@@ -107,38 +110,38 @@ void KEditPolar::accept()
m_parser->fixFunctionName(f_str, XParser::Polar);
Ufkt tmp_ufkt; //all settings are saved here until we know that no errors have appeared
tmp_ufkt.f_mode = !checkBoxHide->isChecked();
tmp_ufkt.f_mode = !m_editPolar->checkBoxHide->isChecked();
if( customMinRange->isChecked() )
if( m_editPolar->customMinRange->isChecked() )
{
tmp_ufkt.usecustomxmin = true;
tmp_ufkt.str_dmin = min->text();
tmp_ufkt.dmin = m_parser->eval( min->text() );
tmp_ufkt.str_dmin = m_editPolar->min->text();
tmp_ufkt.dmin = m_parser->eval( m_editPolar->min->text() );
if ( m_parser->parserError() )
{
min->setFocus();
min->selectAll();
m_editPolar->min->setFocus();
m_editPolar->min->selectAll();
return;
}
}
else
tmp_ufkt.usecustomxmin = false;
if( customMaxRange->isChecked() )
if( m_editPolar->customMaxRange->isChecked() )
{
tmp_ufkt.usecustomxmax = true;
tmp_ufkt.str_dmax = max->text();
tmp_ufkt.dmax = m_parser->eval( max->text() );
tmp_ufkt.str_dmax = m_editPolar->max->text();
tmp_ufkt.dmax = m_parser->eval( m_editPolar->max->text() );
if ( m_parser->parserError())
{
max->setFocus();
max->selectAll();
m_editPolar->max->setFocus();
m_editPolar->max->selectAll();
return;
}
if ( tmp_ufkt.usecustomxmin && tmp_ufkt.dmin >= tmp_ufkt.dmax)
{
KMessageBox::error(this,i18n("The minimum range value must be lower than the maximum range value"));
min->setFocus();
min->selectAll();
KMessageBox::sorry(this,i18n("The minimum range value must be lower than the maximum range value"));
m_editPolar->min->setFocus();
m_editPolar->min->selectAll();
return;
}
}
......@@ -148,8 +151,8 @@ void KEditPolar::accept()
tmp_ufkt.f1_mode = 0;
tmp_ufkt.f2_mode = 0;
tmp_ufkt.integral_mode = 0;
tmp_ufkt.linewidth = kIntNumInputLineWidth->value();
tmp_ufkt.color = kColorButtonColor->color().rgb();
tmp_ufkt.linewidth = m_editPolar->kIntNumInputLineWidth->value();
tmp_ufkt.color = m_editPolar->kColorButtonColor->color().rgb();