Commit 79b39932 authored by Fredrik Edemar's avatar Fredrik Edemar

* Make it possible to limit a function by one "side" (feature requested by pinotree).

* Generate correct function names for parametric functions.

svn path=/trunk/kdeedu/kmplot/; revision=393361
parent c11814e4
......@@ -46,9 +46,7 @@
#include <kdebug.h>
#define Inherited FktDlgData
FktDlg::FktDlg( QWidget* parent, View *view ) : Inherited( parent, "editPlots" ), m_view(view)
FktDlg::FktDlg( QWidget* parent, View *view ) : FktDlgData( parent, "editPlots" ), m_view(view)
{
connect( cmdCopyFunction, SIGNAL( clicked() ), this, SLOT( slotCopyFunction()) );
connect( cmdMoveFunction, SIGNAL( clicked() ), this, SLOT( slotMoveFunction()) );
......
......@@ -224,18 +224,19 @@ void View::plotfkt(Ufkt *ufkt, QPainter *pDC)
dmin=ufkt->dmin;
dmax=ufkt->dmax;
if(dmin==dmax) //no special plot range is specified. Use the screen border instead.
if(!ufkt->usecustomxmin)
{
if(fktmode=='r')
{
dmin=0.;
dmax=2*M_PI;
}
else
{
dmin=xmin;
dmax=xmax;
}
if(fktmode=='r')
dmin=0.;
else
dmin = xmin;
}
if(!ufkt->usecustomxmax)
{
if(fktmode=='r')
dmax=2*M_PI;
else
dmax = xmax;
}
double dx;
if(fktmode=='r')
......@@ -628,7 +629,7 @@ void View::mouseMoveEvent(QMouseEvent *e)
if( csmode >= 0 && csmode <= (int)m_parser->countFunctions() )
{
int const ix = m_parser->ixValue(csmode);
if (ix!=-1 && ( (m_parser->ufkt[ix].dmin== m_parser->ufkt[ix].dmax)|| (csxpos>m_parser->ufkt[ix].dmin && csxpos<m_parser->ufkt[ix].dmax) ) )
if (ix!=-1 && ((!m_parser->ufkt[ix].usecustomxmin) || (m_parser->ufkt[ix].usecustomxmin && csxpos>m_parser->ufkt[ix].dmin)) && ((!m_parser->ufkt[ix].usecustomxmax)||(m_parser->ufkt[ix].usecustomxmax && csxpos<m_parser->ufkt[ix].dmax)) )
{
it = &m_parser->ufkt[ix];
if( it->use_slider == -1 )
......@@ -856,6 +857,8 @@ void View::mousePressEvent(QMouseEvent *e)
{
function_type = it->fstr[0].latin1();
if ( function_type=='y' || function_type=='r' || it->fname.isEmpty()) continue;
if (!(((!it->usecustomxmin) || (it->usecustomxmin && csxpos>it->dmin)) && ((!it->usecustomxmax)||(it->usecustomxmax && csxpos<it->dmax)) ))
continue;
kdDebug() << "it:" << it->fstr << endl;
int k=0;
int const ke=it->parameters.count();
......@@ -968,6 +971,8 @@ void View::mousePressEvent(QMouseEvent *e)
{
case 'x': case 'y': case 'r': continue; // Not possible to catch
}
if (!(((!it->usecustomxmin) || (it->usecustomxmin && csxpos>it->dmin)) && ((!it->usecustomxmax)||(it->usecustomxmax && csxpos<it->dmax)) ))
continue;
int k=0;
int const ke=it->parameters.count();
do
......
......@@ -59,7 +59,7 @@ class View : public QWidget, virtual public ViewIface
Q_OBJECT
public:
/// Contructor sets up the parser, too.
View(bool, bool &, KPopupMenu *, QWidget* parent=NULL, const char* name=NULL );
View(bool, bool &, KPopupMenu *, QWidget* parent=NULL, const char* name=NULL );
void setMinMaxDlg(KMinMax *);
virtual ~View();
......
......@@ -70,7 +70,9 @@ 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_clicked(bool) ) );
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) ) );
}
void EditFunction::initDialog( int id )
......@@ -86,7 +88,8 @@ void EditFunction::clearWidgets()
// Clear the Function page
editfunctionpage->equation->clear();
editfunctionpage->hide->setChecked( false );
editfunctionpage->customRange->setChecked( false );
editfunctionpage->customMinRange->setChecked( false );
editfunctionpage->customMaxRange->setChecked( false );
editfunctionpage->min->clear();
editfunctionpage->max->clear();
editfunctionpage->lineWidth->setValue( m_parser->linewidth0 );
......@@ -114,14 +117,21 @@ void EditFunction::setWidgets()
editfunctionpage->hide->setChecked( !ufkt->f_mode);
editfunctionpage->lineWidth->setValue( ufkt->linewidth );
editfunctionpage->color->setColor( ufkt->color );
if ( ufkt->dmin != ufkt->dmax )
if (ufkt->usecustomxmin)
{
editfunctionpage->customMinRange->setChecked(true);
editfunctionpage->min->setText( ufkt->str_dmin );
}
else
editfunctionpage->customMinRange->setChecked(false);
if (ufkt->usecustomxmax)
{
editfunctionpage->customRange->setChecked(true);
editfunctionpage->min->setText( ufkt->str_dmin );
editfunctionpage->max->setText( ufkt->str_dmax );
editfunctionpage->customMaxRange->setChecked(true);
editfunctionpage->max->setText( ufkt->str_dmax );
}
else
editfunctionpage->customRange->setChecked(false);
editfunctionpage->customMaxRange->setChecked(false);
m_parameter = ufkt->parameters;
if( ufkt->use_slider == -1 )
......@@ -171,27 +181,39 @@ void EditFunction::accept()
}
Ufkt tmp_ufkt; //all settings are saved here until we know that no errors have appeared
if( editfunctionpage->customRange->isChecked() )
if( editfunctionpage->customMinRange->isChecked() )
{
tmp_ufkt.usecustomxmin = true;
tmp_ufkt.str_dmin = editfunctionpage->min->text();
tmp_ufkt.dmin = m_parser->eval( editfunctionpage->min->text() );
if (m_parser->parserError() != 0)
{
showPage(0);
editfunctionpage->min->setFocus();
editfunctionpage->min->selectAll();
return;
}
}
else
tmp_ufkt.usecustomxmin = false;
if( editfunctionpage->customMaxRange->isChecked() )
{
tmp_ufkt.usecustomxmax = true;
tmp_ufkt.str_dmax= editfunctionpage->max->text();
tmp_ufkt.dmax = m_parser->eval( editfunctionpage->max->text() );
if (m_parser->parserError() != 0)
{
showPage(0);
editfunctionpage->max->setFocus();
editfunctionpage->max->selectAll();
return;
}
}
else
tmp_ufkt.usecustomxmax = false;
if( tmp_ufkt.usecustomxmin && tmp_ufkt.usecustomxmax )
{
tmp_ufkt.str_dmin = editfunctionpage->min->text();
tmp_ufkt.dmin = m_parser->eval( editfunctionpage->min->text() );
if (m_parser->parserError() != 0)
{
showPage(0);
editfunctionpage->min->setFocus();
editfunctionpage->min->selectAll();
return;
}
tmp_ufkt.str_dmax= editfunctionpage->max->text();
tmp_ufkt.dmax = m_parser->eval( editfunctionpage->max->text() );
if (m_parser->parserError() != 0)
{
showPage(0);
editfunctionpage->max->setFocus();
editfunctionpage->max->selectAll();
return;
}
if ( tmp_ufkt.dmin >= tmp_ufkt.dmax)
{
KMessageBox::error(this,i18n("The minimum range value must be lower than the maximum range value"));
......@@ -210,14 +232,6 @@ void EditFunction::accept()
return;
}
}
else
{
//the min and max values must be equal so that plotfkt in View uses xmin and xmax instead
tmp_ufkt.str_dmin ="0";
tmp_ufkt.dmin = 0;
tmp_ufkt.str_dmax = "0";
tmp_ufkt.dmax = 0;
}
tmp_ufkt.linewidth = editfunctionpage->lineWidth->value();
tmp_ufkt.color = editfunctionpage->color->color().rgb();
......@@ -269,19 +283,15 @@ void EditFunction::accept()
else
{
tmp_ufkt.parameters = m_parameter;
/*for( QStringList::Iterator it = m_parameter.begin(); it != m_parameter.end(); ++it )
{
(*it).value = m_parser->eval(( *it ) ) );
}*/
}
}
tmp_ufkt.f1_mode = editderivativespage->showDerivative1->isChecked();
tmp_ufkt.f1_mode = editderivativespage->showDerivative1->isChecked();
tmp_ufkt.f1_linewidth = editderivativespage->lineWidthDerivative1->value();
tmp_ufkt.f1_color = editderivativespage->colorDerivative1->color().rgb();
tmp_ufkt.f2_mode = editderivativespage->showDerivative2->isChecked();
tmp_ufkt.f2_mode = editderivativespage->showDerivative2->isChecked();
tmp_ufkt.f2_linewidth = editderivativespage->lineWidthDerivative2->value();
tmp_ufkt.f2_color = editderivativespage->colorDerivative2->color().rgb();
......@@ -334,31 +344,33 @@ void EditFunction::accept()
added_ufkt = &m_parser->ufkt.last();
}
//save all settings in the function now when we know no errors have appeared
added_ufkt->f_mode = tmp_ufkt.f_mode;
added_ufkt->f1_mode = tmp_ufkt.f1_mode;
added_ufkt->f2_mode = tmp_ufkt.f2_mode;
added_ufkt->integral_mode = tmp_ufkt.integral_mode;
added_ufkt->integral_use_precision = tmp_ufkt.integral_use_precision;
added_ufkt->linewidth = tmp_ufkt.linewidth;
added_ufkt->f1_linewidth = tmp_ufkt.f1_linewidth;
added_ufkt->f2_linewidth = tmp_ufkt.f2_linewidth;
added_ufkt->integral_linewidth = tmp_ufkt.integral_linewidth;
added_ufkt->str_dmin = tmp_ufkt.str_dmin;
added_ufkt->str_dmax = tmp_ufkt.str_dmax;
added_ufkt->dmin = tmp_ufkt.dmin;
added_ufkt->dmax = tmp_ufkt.dmax;
added_ufkt->str_startx = tmp_ufkt.str_startx;
added_ufkt->str_starty = tmp_ufkt.str_starty;
added_ufkt->oldx = tmp_ufkt.oldx;
added_ufkt->starty = tmp_ufkt.starty;
added_ufkt->startx = tmp_ufkt.startx;
added_ufkt->integral_precision = tmp_ufkt.integral_precision;
added_ufkt->color = tmp_ufkt.color;
added_ufkt->f1_color = tmp_ufkt.f1_color;
added_ufkt->f2_color = tmp_ufkt.f2_color;
added_ufkt->integral_color = tmp_ufkt.integral_color;
added_ufkt->parameters = tmp_ufkt.parameters;
added_ufkt->use_slider = tmp_ufkt.use_slider;
added_ufkt->f_mode = tmp_ufkt.f_mode;
added_ufkt->f1_mode = tmp_ufkt.f1_mode;
added_ufkt->f2_mode = tmp_ufkt.f2_mode;
added_ufkt->integral_mode = tmp_ufkt.integral_mode;
added_ufkt->integral_use_precision = tmp_ufkt.integral_use_precision;
added_ufkt->linewidth = tmp_ufkt.linewidth;
added_ufkt->f1_linewidth = tmp_ufkt.f1_linewidth;
added_ufkt->f2_linewidth = tmp_ufkt.f2_linewidth;
added_ufkt->integral_linewidth = tmp_ufkt.integral_linewidth;
added_ufkt->str_dmin = tmp_ufkt.str_dmin;
added_ufkt->str_dmax = tmp_ufkt.str_dmax;
added_ufkt->dmin = tmp_ufkt.dmin;
added_ufkt->dmax = tmp_ufkt.dmax;
added_ufkt->str_startx = tmp_ufkt.str_startx;
added_ufkt->str_starty = tmp_ufkt.str_starty;
added_ufkt->oldx = tmp_ufkt.oldx;
added_ufkt->starty = tmp_ufkt.starty;
added_ufkt->startx = tmp_ufkt.startx;
added_ufkt->integral_precision = tmp_ufkt.integral_precision;
added_ufkt->color = tmp_ufkt.color;
added_ufkt->f1_color = tmp_ufkt.f1_color;
added_ufkt->f2_color = tmp_ufkt.f2_color;
added_ufkt->integral_color = tmp_ufkt.integral_color;
added_ufkt->parameters = tmp_ufkt.parameters;
added_ufkt->use_slider = tmp_ufkt.use_slider;
added_ufkt->usecustomxmin = tmp_ufkt.usecustomxmin;
added_ufkt->usecustomxmax = tmp_ufkt.usecustomxmax;
editfunctionpage->equation->setText(f_str); //update the function name in FktDlg
......@@ -388,7 +400,7 @@ void EditFunction::cmdParameter_clicked()
KParameterEditor *dlg = new KParameterEditor(m_parser,&m_parameter);
dlg->show();
}
void EditFunction::noParameter_clicked(bool status)
void EditFunction::noParameter_toggled(bool status)
{
if (status)
{
......@@ -396,6 +408,23 @@ void EditFunction::noParameter_clicked(bool status)
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)
{
int const openBracket = f_str.find( "(" );
......
......@@ -59,7 +59,11 @@ class EditFunction : public KDialogBase
/// Called when the "Change parameter values" is clicked
void cmdParameter_clicked();
/// Called when the no_parameter-radiobutton is toggled.
void noParameter_clicked(bool);
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
......
This diff is collapsed.
......@@ -44,6 +44,8 @@
KEditParametric::KEditParametric( XParser* parser, QWidget* parent, const char* name ) :
QEditParametric( parent, name ), m_parser(parser)
{
connect( customMinRange, SIGNAL ( toggled(bool) ), this, SLOT( customMinRange_toggled(bool) ) );
connect( customMaxRange, SIGNAL ( toggled(bool) ), this, SLOT( customMaxRange_toggled(bool) ) );
}
void KEditParametric::initDialog( int x_id, int y_id)
......@@ -60,7 +62,8 @@ void KEditParametric::clearWidgets()
kLineEditXFunction->clear();
kLineEditYFunction->clear();
checkBoxHide->setChecked( false );
checkBoxRange->setChecked( false );
customMinRange->setChecked( false );
customMinRange->setChecked( false );
min->clear();
max->clear();
kIntNumInputLineWidth->setValue( m_parser->linewidth0 );
......@@ -70,21 +73,29 @@ void KEditParametric::clearWidgets()
void KEditParametric::setWidgets()
{
Ufkt *ufkt = &m_parser->ufkt[ m_parser->ixValue(m_x_id) ];
QString name, expression;
QString name, expression;
splitEquation( ufkt->fstr, name, expression );
kLineEditName->setText( name );
kLineEditXFunction->setText( expression );
splitEquation( m_parser->ufkt[ m_y_id ].fstr, name, expression );
kLineEditYFunction->setText( expression );
checkBoxHide->setChecked( !ufkt->f_mode );
if ( ufkt->dmin != ufkt->dmax )
if (ufkt->usecustomxmin)
{
checkBoxRange->setChecked(true);
customMinRange->setChecked(true);
min->setText( ufkt->str_dmin );
}
else
customMinRange->setChecked(false);
if (ufkt->usecustomxmax)
{
customMaxRange->setChecked(true);
max->setText( ufkt->str_dmax );
}
else
checkBoxRange->setChecked(false);
customMaxRange->setChecked(false);
kIntNumInputLineWidth->setValue( ufkt->linewidth );
kColorButtonColor->setColor( ufkt->color );
}
......@@ -103,16 +114,17 @@ void KEditParametric::accept()
if( kLineEditName->text().isEmpty() )
{
QString fname;
m_parser->fixFunctionName(fname, XParser::ParametricX);
m_parser->fixFunctionName(fname, XParser::ParametricX, m_x_id);
int const pos = fname.find('(');
kLineEditName->setText(fname.mid(1,pos-1));
}
Ufkt tmp_ufkt;
Ufkt tmp_ufkt;
tmp_ufkt.f_mode = !checkBoxHide->isChecked();
if( checkBoxRange->isChecked() )
if( customMinRange->isChecked() )
{
tmp_ufkt.usecustomxmin = true;
tmp_ufkt.str_dmin = min->text();
tmp_ufkt.dmin = m_parser->eval( min->text() );
if ( m_parser->parserError())
......@@ -121,6 +133,13 @@ void KEditParametric::accept()
min->selectAll();
return;
}
}
else
tmp_ufkt.usecustomxmin = false;
if( customMaxRange->isChecked() )
{
tmp_ufkt.usecustomxmax = true;
tmp_ufkt.str_dmax = max->text();
tmp_ufkt.dmax = m_parser->eval( max->text() );
if ( m_parser->parserError())
......@@ -129,7 +148,7 @@ void KEditParametric::accept()
max->selectAll();
return;
}
if ( tmp_ufkt.dmin >= tmp_ufkt.dmax)
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();
......@@ -138,12 +157,7 @@ void KEditParametric::accept()
}
}
else
{
tmp_ufkt.str_dmin ="0";
tmp_ufkt.dmin = 0;
tmp_ufkt.str_dmax = "0";
tmp_ufkt.dmax = 0;
}
tmp_ufkt.usecustomxmax = false;
tmp_ufkt.linewidth = kIntNumInputLineWidth->value();
tmp_ufkt.color = kColorButtonColor->color().rgb();
......@@ -216,6 +230,8 @@ void KEditParametric::accept()
added_ufkt->f2_color = tmp_ufkt.f2_color;
added_ufkt->integral_color = tmp_ufkt.integral_color;
added_ufkt->use_slider = tmp_ufkt.use_slider;
added_ufkt->usecustomxmin = tmp_ufkt.usecustomxmin;
added_ufkt->usecustomxmax = tmp_ufkt.usecustomxmax;
added_ufkt = 0;
if( m_y_id != -1 ) //when editing a function:
......@@ -273,8 +289,10 @@ void KEditParametric::accept()
added_ufkt->f1_color = tmp_ufkt.f1_color;
added_ufkt->f2_color = tmp_ufkt.f2_color;
added_ufkt->integral_color = tmp_ufkt.integral_color;
added_ufkt->parameters = tmp_ufkt.parameters;
added_ufkt->parameters = tmp_ufkt.parameters;
added_ufkt->use_slider = tmp_ufkt.use_slider;
added_ufkt->usecustomxmin = tmp_ufkt.usecustomxmin;
added_ufkt->usecustomxmax = tmp_ufkt.usecustomxmax;
// call inherited method
......@@ -310,3 +328,18 @@ void KEditParametric::slotHelp()
{
kapp->invokeHelp( "", "kmplot" );
}
void KEditParametric::customMinRange_toggled(bool status)
{
if (status)
min->setEnabled(true);
else
min->setEnabled(false);
}
void KEditParametric::customMaxRange_toggled(bool status)
{
if (status)
max->setEnabled(true);
else
max->setEnabled(false);
}
......@@ -71,6 +71,8 @@ class KEditParametric : public QEditParametric
virtual void accept();
/// Invokes the HelpCenter.
void slotHelp();
void customMaxRange_toggled(bool);
void customMinRange_toggled(bool);
};
#endif
......@@ -45,6 +45,8 @@
KEditPolar::KEditPolar( XParser* parser, QWidget* parent, const char* name ) :
QEditPolar( parent, name ),m_parser(parser)
{
connect( customMinRange, SIGNAL ( toggled(bool) ), this, SLOT( customMinRange_toggled(bool) ) );
connect( customMaxRange, SIGNAL ( toggled(bool) ), this, SLOT( customMaxRange_toggled(bool) ) );
}
void KEditPolar::initDialog( int id )
......@@ -58,7 +60,8 @@ void KEditPolar::clearWidgets()
{
kLineEditYFunction->clear();
checkBoxHide->setChecked( false );
checkBoxRange->setChecked( false );
customMinRange->setChecked( false );
customMaxRange->setChecked(false);
min->clear();
max->clear();
kIntNumInputLineWidth->setValue( m_parser->linewidth0 );
......@@ -72,31 +75,41 @@ void KEditPolar::setWidgets()
function = function.right( function.length()-1 );
kLineEditYFunction->setText( function );
checkBoxHide->setChecked( !ufkt->f_mode);
if ( ufkt->dmin != ufkt->dmax )
if (ufkt->usecustomxmin)
{
checkBoxRange->setChecked( true );
customMinRange->setChecked(true);
min->setText( ufkt->str_dmin );
}
else
customMinRange->setChecked(false);
if (ufkt->usecustomxmin)
{
customMaxRange->setChecked(true);
max->setText( ufkt->str_dmax );
}
else
checkBoxRange->setChecked( false );
customMaxRange->setChecked(false);
kIntNumInputLineWidth->setValue( ufkt->linewidth );
kColorButtonColor->setColor( ufkt->color );
}
void KEditPolar::accept()
{
QString f_str = "r" + kLineEditYFunction->text();
QString f_str = /*"r" + */kLineEditYFunction->text();
if ( m_id!=-1 )
m_parser->fixFunctionName(f_str, XParser::Polar, m_id);
else
m_parser->fixFunctionName(f_str, XParser::Polar);
Ufkt tmp_ufkt; //all settings are saved here until we know that no errors have appeared
if ( m_id!=-1 )
m_parser->fixFunctionName(f_str, XParser::Polar, m_id);
else
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 = !checkBoxHide->isChecked();
if( checkBoxRange->isChecked() )
if( customMinRange->isChecked() )
{
tmp_ufkt.usecustomxmin = true;
tmp_ufkt.str_dmin = min->text();
tmp_ufkt.dmin = m_parser->eval( min->text() );
if ( m_parser->parserError() )
......@@ -105,6 +118,12 @@ void KEditPolar::accept()
min->selectAll();
return;
}
}
else
tmp_ufkt.usecustomxmin = false;
if( customMaxRange->isChecked() )
{
tmp_ufkt.usecustomxmax = true;
tmp_ufkt.str_dmax = max->text();
tmp_ufkt.dmax = m_parser->eval( max->text() );
if ( m_parser->parserError())
......@@ -113,7 +132,7 @@ void KEditPolar::accept()
max->selectAll();
return;
}
if ( tmp_ufkt.dmin >= tmp_ufkt.dmax)
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();
......@@ -122,21 +141,17 @@ void KEditPolar::accept()
}
}
else
{
tmp_ufkt.str_dmin ="0";
tmp_ufkt.dmin = 0;
tmp_ufkt.str_dmax = "0";
tmp_ufkt.dmax = 0;
}
tmp_ufkt.usecustomxmax = false;
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.color = kColorButtonColor->color().rgb();
tmp_ufkt.use_slider = -1;
Ufkt *added_ufkt;
if( m_id != -1 ) //when editing a function:
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
......@@ -173,33 +188,35 @@ void KEditPolar::accept()
added_ufkt = &m_parser->ufkt.last();
}
//save all settings in the function now when we know no errors have appeared
added_ufkt->f_mode = tmp_ufkt.f_mode;