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 #include "binarytype.h"
00022
00023 #ifdef HAVE_GL
00024 #include "qwt3d_surfaceplot.h"
00025 #endif
00026
00027 class Dialog: public KDialog
00028 {
00029 Q_OBJECT
00030 public:
00031 Dialog(class MainWin *mw, const char *name);
00032 QVBox* surfaceStyle(QTabWidget *tw, bool fresh);
00033 QVBox* simpleStyle(QTabWidget *tw, Style *style, Symbol *symbol);
00034 void saveSimpleStyle();
00035 void saveSurfaceStyle();
00036 void saveErrorbarSettings();
00037 public slots:
00038 void setDestination(int v) {sheetcb->setCurrentItem(v); }
00039 void setFilename(QString v) { filele->setText(v); }
00040 void setFilter(int v) { filtercb->setCurrentItem(v); }
00041 void setSimplify(bool b=true) { simplifycb->setChecked(b); }
00042 void setEmpty(bool b=true) { emptycb->setChecked(b); }
00043 void setImportHeader(bool b=true) { headercb->setChecked(b); }
00044 void setSameXColumn(bool b=true) { samexcb->setChecked(b); }
00045 void setSeparator(int v) { sccb->setCurrentItem(v); }
00046 void setSeparator(QChar v) { sccb->setCurrentText(v); }
00047 void setComment(int v) { commcb->setCurrentItem(v); }
00048 void setComment(QChar v) { commcb->setCurrentText(v); }
00049 void setDataRange(int v, int e) { startle->setText(QString::number(v)); endle->setText(QString::number(e)); }
00051 void setStart(int v) {startle->setText(QString::number(v));}
00052 void setEnd(int v) {endle->setText(QString::number(v));}
00053
00054
00055 void setVars(int v) { varle->setText(QString::number(v)); }
00056 void setBinaryType(int t) { binarytypecb->setCurrentItem(t); }
00057 void setByteOrder(int b) { byteordercb->setCurrentItem(b); }
00058
00059 void setStyle(Style *s);
00060 void setSymbol(Symbol *s);
00061 protected:
00062 void resizeEvent(QResizeEvent *e);
00063 QVBox* annotateValuesTab(QTabWidget *tw, Graph *graph);
00064 QVBox* errorbarTab(QTabWidget *tw, Symbol *symbol);
00065 void importWidget(QVBox *vb,QString filename, InputFilter filter);
00066 void saveImportSettings();
00067 double getBinaryValue(QDataStream *d, BinaryType type);
00068 bool openColorMap(QString fn);
00069 void fillBrushBox(KComboBox *cb,SType t, QColor c,FType f, QColor s);
00070 QGroupBox *vbox, *gbox;
00071 class MainWin *mw;
00072 class Worksheet *p;
00073 class Spreadsheet *s;
00074 #ifdef HAVE_GL
00075 Qwt3D::ColorVector cv;
00076 #endif
00077 KPushButton *ok, *apply, *save, *cancel;
00078 KLineEdit *filele;
00079 QLabel *fileinfo;
00080 KComboBox *cb2, *pencb, *brushcb, *sbrushcb;
00081 KComboBox *symbolcb, *symbolfillcb;
00082 KColorButton *color, *fcolor, *scolor, *sfcolor;
00083 QCheckBox *filled, *sortpointscb;
00084 KIntNumInput *boxwidth, *width, *ssize;
00085 QCheckBox *autobox, *ccb, *dcb, *coloredcb, *meshcb, *relativecb;
00086 KLineEdit *numberle, *thresholdle;
00087 KComboBox *dbrushcb;
00088 KColorButton *contourcolor;
00089 KLineEdit *contourwidthle;
00090 KComboBox *typecb, *positioncb;
00091 KIntNumInput *distance;
00092 KColorButton *ebarcolor, *ebarbcolor;
00093 KIntNumInput *ebarxsize, *ebarysize, *ebarwidth, *ebarbwidth;
00094 KComboBox *ebarstylecb, *ebarbstylecb, *ebarxtypecb, *ebarytypecb;
00095 QCheckBox *simplifycb, *emptycb, *headercb, *samexcb;
00096 QLabel *seplabel, *commlabel, *startlabel, *endlabel;
00097 KLineEdit *startle, *endle;
00098 KComboBox *filtercb, *sccb, *commcb;
00099 QLabel *varlabel, *binarytypelabel, *byteorderlabel;
00100 KComboBox *binarytypecb, *byteordercb;
00101 KLineEdit *varle;
00102 KComboBox *sheetcb;
00103 protected slots:
00104 void updateFileInfo();
00105 void selectFile();
00106 void fileInfo();
00107 void selectColormap();
00108 void adaptDataColors(const QString&);
00109 void updateFilter(int item);
00110 QStringList splitLine(QString line,QString sep, bool empty);
00111 private:
00112 void fillSymbolBox(QColor c, FType f, QColor s, int b);
00113 void fillSymbolFillBox(SType t, QColor c, QColor s, int b);
00114 private slots:
00115 void styleChanged();
00116 void symbolChanged();
00117 };
00118
00119 #endif //DIALOG_H