00001
00002
00003 #ifndef DIALOG_H
00004 #define DIALOG_H
00005
00006 #include <kdialog.h>
00007 #include <qvbox.h>
00008 #include <kpushbutton.h>
00009 #include <qgroupbox.h>
00010 #include <qcheckbox.h>
00011 #include <qtabwidget.h>
00012 #include <qvalidator.h>
00013 #include <klineedit.h>
00014 #include <klistbox.h>
00015 #include <kcolorbutton.h>
00016 #include <kcombobox.h>
00017 #include <knuminput.h>
00018 #include "Worksheet.h"
00019
00020 #include "inputfilter.h"
00021
00022 #ifdef HAVE_GL
00023 #include "qwt3d_surfaceplot.h"
00024 #endif
00025
00026 class Dialog: public KDialog
00027 {
00028 Q_OBJECT
00029 public:
00030 Dialog(class MainWin *mw, const char *name);
00031 QVBox* surfaceStyle(QTabWidget *tw, bool fresh);
00032 QVBox* simpleStyle(QTabWidget *tw, Style *style, Symbol *symbol);
00033 void saveSimpleStyle();
00034 void saveSurfaceStyle();
00035 public slots:
00036 void setDestination(int d) {sheetcb->setCurrentItem(d); }
00037 void setFilename(QString f) { filele->setText(f); }
00038 void setFilter(int f) { filtercb->setCurrentItem(f); }
00039 void setSimplify(bool b=true) { simplifycb->setChecked(b); }
00040 void setEmpty(bool b=true) { emptycb->setChecked(b); }
00041 void setImportHeader(bool b=true) { headercb->setChecked(b); }
00042 void setSameXColumn(bool b=true) { samexcb->setChecked(b); }
00043 void setSeparator(int v) { sccb->setCurrentItem(v); }
00044 void setSeparator(QChar v) { sccb->setCurrentText(v); }
00045 void setComment(int v) { commcb->setCurrentItem(v); }
00046 void setComment(QChar v) { commcb->setCurrentText(v); }
00047 void setDataRange(int v, int e) { startle->setText(QString::number(v)); endle->setText(QString::number(e)); }
00049 void setStart(int v) {startle->setText(QString::number(v));}
00050 void setEnd(int e) {endle->setText(QString::number(e));}
00051
00052
00053 void setVars(int v) { varle->setText(QString::number(v)); }
00054 void setBinaryType(int t) { binarytypecb->setCurrentItem(t); }
00055
00056 void setStyle(Style *s);
00057 void setSymbol(Symbol *s);
00058 protected:
00059 void resizeEvent(QResizeEvent *e);
00060 QVBox* annotateValuesTab(QTabWidget *tw, Graph *graph);
00061 void importWidget(QVBox *vb,QString filename,InputFilter filter);
00062 void saveImportSettings();
00063 double getBinaryValue(QDataStream *d, int type);
00064 bool openColorMap(QString fn);
00065 QGroupBox *vbox, *gbox;
00066 class MainWin *mw;
00067 class Worksheet *p;
00068 class Spreadsheet *s;
00069 #ifdef HAVE_GL
00070 Qwt3D::ColorVector cv;
00071 #endif
00072 KPushButton *ok, *apply, *save, *cancel;
00073 KLineEdit *filele;
00074 KComboBox *cb2, *pencb, *brushcb, *sbrushcb;
00075 KComboBox *symbolcb, *symbolfillcb;
00076 KColorButton *color, *fcolor, *scolor, *sfcolor;
00077 QCheckBox *filled, *sortpointscb;
00078 KIntNumInput *boxwidth, *width, *ssize;
00079 QCheckBox *autobox, *ccb, *dcb, *coloredcb, *meshcb, *relativecb;
00080 KLineEdit *numberle, *thresholdle;
00081 KComboBox *dbrushcb;
00082 KColorButton *contourcolor;
00083 KComboBox *typecb, *positioncb;
00084 KIntNumInput *distance;
00085 QCheckBox *simplifycb, *emptycb, *headercb, *samexcb;
00086 QLabel *seplabel, *commlabel, *startlabel, *endlabel;
00087 KLineEdit *startle, *endle;
00088 KComboBox *filtercb, *sccb, *commcb;
00089 QLabel *varlabel, *binarytypelabel;
00090 KLineEdit *varle;
00091 KComboBox *binarytypecb;
00092 KComboBox *sheetcb;
00093 protected slots:
00094 void selectFile();
00095 void fileInfo();
00096 void selectColormap();
00097 void adaptDataColors(const QString&);
00098 void updateFilter(int item);
00099 QStringList splitLine(QString line,QString sep, bool empty);
00100 private:
00101 void fillBrushBox(KComboBox *cb,SType t, QColor c,FType f, QColor s);
00102 void fillSymbolBox(QColor c, FType f, QColor s, int b);
00103 void fillSymbolFillBox(SType t, QColor c, QColor s, int b);
00104 private slots:
00105 void styleChanged();
00106 void symbolChanged();
00107 };
00108
00109 #endif //DIALOG_H