Commit 51e5eacb authored by Fredrik Edemar's avatar Fredrik Edemar

* Fixed some small bugs in KMinMax.

* Added some more comments.
* Updated the TODO-file.

CCMAIL:kdmoeller@foni.net
CCMAIL:bmlmessmer@web.de

svn path=/trunk/kdeedu/kmplot/; revision=334292
parent 7ac1a3f5
......@@ -2,12 +2,10 @@ Last modified: 2004-06-16
TODO
=========================
* KOptDlg* obsolete
* Polish the UI
* Find bugs
* More functions?
* DCOP
* KPart
* KParts
* In tool menu:
* find "nollställen" ( eng: where the function's value is 0)
* get slope for a x-point
......@@ -15,21 +13,15 @@ TODO
* #52887, need to calculate with complex numbers.
* Replace QFile with KIO in KmplotIO
* Popupmenu and tracemode for parametric- and polar functions
TODO for KDE 3.3
=========================
* Draw tangents in trace mode (pipesmoker)
* Printing (pipesmoker)
- different paper sizes
* What-is-this for the new stuff
IN PROGRESS
=========================
* Configure Dialog for global Settings / save as default Checkboxes (Started)
* Import parameter values from different file format(.csv, KSpread, OpenOffice) via Koffice (see kde-edu/kig)
DONE
=========================
......@@ -71,4 +63,5 @@ DONE
* Change icon when zooming
* Ability to print background color
* Four modes for zooming.
* Basic popup menu for single parametric points.
\ No newline at end of file
* Basic popup menu for single parametric points.
* Configure Dialog for global Settings / save as default Checkboxes (Started)
\ No newline at end of file
......@@ -33,6 +33,7 @@
/**
@author Fredrik Edemar
*/
/// Handles all the constants.
class KConstantEditor : public QConstantEditor
{
Q_OBJECT
......
......@@ -32,12 +32,12 @@
/**
@author Fredrik Edemar
*/
/// A small dialog for creating an editing constants
class KEditConstant : public QEditConstant
{
Q_OBJECT
public:
KEditConstant(XParser *p, char &, QString &,QWidget *parent = 0, const char *name = 0);
~KEditConstant();
public slots:
......
......@@ -51,6 +51,7 @@ KMinMax::KMinMax(View *v, QWidget *parent, const char *name)
connect( cmdParameter, SIGNAL( clicked() ), this, SLOT( cmdParameter_clicked() ));
connect( list, SIGNAL( highlighted(QListBoxItem*) ), this, SLOT( list_highlighted(QListBoxItem*) ));
connect( list, SIGNAL( doubleClicked( QListBoxItem * ) ), this, SLOT( list_doubleClicked(QListBoxItem *) ));
parameter="";
}
......@@ -140,6 +141,8 @@ void KMinMax::init(char m)
void KMinMax::updateFunctions()
{
QString const selected_item(list->currentText() );
list->clear();
int index;
QString fname, fstr;
......@@ -177,12 +180,16 @@ void KMinMax::updateFunctions()
}
}
selectItem();
QListBoxItem *found_item = list->findItem(selected_item,Qt::ExactMatch);
if ( found_item && m_view->csmode < 0)
{
list->setSelected(found_item,true);
}
}
void KMinMax::selectItem()
{
cmdParameter->hide();
parameter="kmplot";
if ( m_view->csmode < 0)
return;
//kdDebug() << "cstype: " << (int)m_view->cstype << endl;
......@@ -286,7 +293,7 @@ void KMinMax::cmdFind_clicked()
index--;
if ( m_view->parser()->fktext[ index ].k_anz == 0)
parameter = "0";
else if ( parameter =="kmplot")
else if ( parameter.isEmpty())
{
KMessageBox::error(this,i18n("You must choose a parameter for that function"));
list_highlighted(list->selectedItem() );
......@@ -373,10 +380,12 @@ void KMinMax::list_highlighted(QListBoxItem* item)
stop=true;
}
ix--;
if ( m_view->parser()->fktext[ ix ].str_parameter.count() ==0)
if ( m_view->parser()->fktext[ ix ].str_parameter.count() ==0)
cmdParameter->hide();
else
cmdParameter->show();
if (parameter.isEmpty() )
parameter = m_view->parser()->fktext[ ix ].str_parameter.first();
}
void KMinMax::cmdParameter_clicked()
{
......
......@@ -32,22 +32,30 @@
/**
@author Fredrik Edemar
*/
/// KMinMax handles all the dialogs for the items in the tool-menu.
class KMinMax : public QMinMax
{
Q_OBJECT
public:
KMinMax(QWidget *parent = 0, const char *name = 0);
KMinMax(View *, QWidget *parent = 0, const char *name = 0);
/// called every time the dialog is opened
void init(char);
/// update the list with functions
void updateFunctions();
/// select the right function when using the popup menu to show the dialog
void selectItem();
~KMinMax();
public slots:
/// the user has pressen the find/caluclate/draw button
void cmdFind_clicked();
/// the selecting a function that uses parameter function from a list the user can choose which paramater value he/she wants to use
void cmdParameter_clicked();
/// the button for changing the selected parameter value
void list_highlighted(QListBoxItem*);
/// call cmdParameter_clicked() if parameter values is enabled for that function
void list_doubleClicked(QListBoxItem *);
private:
......
......@@ -33,6 +33,7 @@
/**
@author Fredrik Edemar
*/
/// This class handles the parameter values: it can create, remove, edit and import values.
class KParameterEditor : public QParameterEditor
{
Q_OBJECT
......
......@@ -272,9 +272,7 @@ int Parser::addfkt(QString str)
for(int i=p1+3; i < (int) str.length();i++)
{
if( (str.at(i).isNumber() || str.at(i).category()==QChar::Letter_Uppercase )&& ( str.at(i-1).isLetter() || str.at(i-1) == ')' ) )
{
str.insert(i,'*');
}
else if( (str.at(i).isNumber() || str.at(i) == ')' || str.at(i).category()==QChar::Letter_Uppercase) && ( str.at(i+1).isLetter() || str.at(i+1) == '(' ) )
{
str.insert(i+1,'*');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment