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 "Worksheet.h"
00018
00019 #include "inputfilter.h"
00020
00021 class Dialog: public KDialog
00022 {
00023 Q_OBJECT
00024 public:
00025 Dialog(class MainWin *mw, const char *name);
00026 QVBox* surfaceStyle(QTabWidget *tw, bool fresh);
00027 QVBox* simpleStyle(QTabWidget *tw, Style *style, Symbol *symbol);
00028 void saveSimpleStyle();
00029 void saveSurfaceStyle();
00030 public slots:
00031 void setDestination(int d) {sheetcb->setCurrentItem(d); }
00032 void setFilename(QString f) { filele->setText(f); }
00033 void setFilter(int f) { filtercb->setCurrentItem(f); }
00034 void setSimplify(bool b=true) { simplifycb->setChecked(b); }
00035 void setEmpty(bool b=true) { emptycb->setChecked(b); }
00036 void setImportHeader(bool b=true) { headercb->setChecked(b); }
00037 void setSeparator(int s) { sccb->setCurrentItem(s); }
00038 void setSeparator(QChar s) { sccb->setCurrentText(s); }
00039 void setComment(int s) { commcb->setCurrentItem(s); }
00040 void setComment(QChar s) { commcb->setCurrentText(s); }
00041 void setDataRange(int s, int e) { startle->setText(QString::number(s)); endle->setText(QString::number(e)); }
00043 void setStart(int s) {startle->setText(QString::number(s));}
00044 void setEnd(int e) {endle->setText(QString::number(e));}
00045
00046
00047 void setVars(int v) { varle->setText(QString::number(v)); }
00048 void setBinaryType(int t) { binarytypecb->setCurrentItem(t); }
00049
00050 void setStyle(Style *s);
00051 void setSymbol(Symbol *s);
00052 protected:
00053 void resizeEvent(QResizeEvent *e);
00054 QVBox* annotateValuesTab(QTabWidget *tw, Graph *graph);
00055 void importWidget(QVBox *vb,QString filename,InputFilter filter);
00056 double getBinaryValue(QDataStream *d, int type);
00057 QGroupBox *vbox, *gbox;
00058 class MainWin *mw;
00059 class Worksheet *p;
00060 class Spreadsheet *s;
00061 KPushButton *ok, *apply, *cancel;
00062 KLineEdit *filele;
00063 KComboBox *cb2, *pencb, *brushcb, *sbrushcb;
00064 KComboBox *symbolcb, *symbolfillcb;
00065 KColorButton *color, *fcolor, *scolor, *sfcolor;
00066 QCheckBox *filled;
00067 KLineEdit *boxwidthle, *ssize, *widthle;
00068 QCheckBox *autobox, *ccb, *dcb, *coloredcb, *meshcb, *relativecb;
00069 KLineEdit *numberle, *thresholdle;
00070 KComboBox *pcb, *dbrushcb;
00071 KColorButton *contourcolor;
00072 KComboBox *typecb, *positioncb;
00073 KLineEdit *distancele;
00074 QCheckBox *simplifycb, *emptycb, *headercb;
00075 QLabel *seplabel, *commlabel, *startlabel, *endlabel;
00076 KLineEdit *startle, *endle;
00077 KComboBox *filtercb, *sccb, *commcb;
00078 QLabel *varlabel, *binarytypelabel;
00079 KLineEdit *varle;
00080 KComboBox *binarytypecb;
00081 KComboBox *sheetcb;
00082 protected slots:
00083 void selectFile();
00084 void fileInfo();
00085 void updateFilter(int item);
00086 QStringList splitLine(QString line,QString sep, bool empty);
00087 private:
00088 void fillBrushBox(KComboBox *cb,SType t, QColor c,FType f, QColor s);
00089 void fillSymbolBox(QColor c, FType f, QColor s, int b);
00090 void fillSymbolFillBox(SType t, QColor c, QColor s, int b);
00091 private slots:
00092 void styleChanged();
00093 void symbolChanged();
00094 };
00095
00096 #endif //DIALOG_H