Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

PlotSettingsDialog.h

Go to the documentation of this file.
00001 //LabPlot : PlotSettingsDialog.h
00002 
00003 #ifndef PLOTSETTINGSDIALOG_H
00004 #define PLOTSETTINGSDIALOG_H
00005 
00006 #include <qtoolbutton.h>
00007 #include <qcolor.h>
00008 #include <qcheckbox.h>
00009 #include <qhbuttongroup.h>
00010 #include "Worksheet.h"
00011 #include "Dialog.h"
00012 
00013 class PlotSettingsDialog: public Dialog
00014 {
00015         Q_OBJECT
00016 public:
00017         PlotSettingsDialog(MainWin *mw, const char *name);
00018         void updateDialog();
00019 public slots:
00020         void autoScaleX();
00021         void autoScaleY();
00022         void autoScaleZ();
00023         void enableAspectRatio(bool a=true) { aspect->setChecked(a); }
00024         bool AspectRatioEnabled() { return aspect->isChecked(); }
00025         void setPlotPosition(double x, double y) { 
00026                 posx->setText(QString::number(x)); posy->setText(QString::number(y)); 
00027         }
00028         void setPlotPosition(Point v) { 
00029                 posx->setText(QString::number(v.X())); posy->setText(QString::number(v.Y())); 
00030         }
00031         Point PlotPosition() { return Point(posx->text().toDouble(),posy->text().toDouble()); }
00032         void setPlotSize(double x, double y) { 
00033                 sizex->setText(QString::number(x)); sizey->setText(QString::number(y)); 
00034         }
00035         void setPlotSize(Point v) { 
00036                 sizex->setText(QString::number(v.X())); sizey->setText(QString::number(v.Y())); 
00037         }
00038         Point PlotSize() { return Point(sizex->text().toDouble(), sizey->text().toDouble()); }
00039         void enableLeftPanel(bool e=true) { leftpanel->setChecked(e); }
00040         void enableRightPanel(bool e=true) { rightpanel->setChecked(e); }
00041         void enableTopPanel(bool e=true) { toppanel->setChecked(e); }
00042         void enableBottomPanel(bool e=true) { bottompanel->setChecked(e); }
00043         
00044         void setXRange(LRange *r) { 
00045                 xmin->setText(QString::number(r->rMin())); xmax->setText(QString::number(r->rMax()));
00046         }
00047         LRange *XRange() { return new LRange(xmin->text().toDouble(),xmax->text().toDouble()); }
00048         void setYRange(LRange *r) { 
00049                 ymin->setText(QString::number(r->rMin())); ymax->setText(QString::number(r->rMax()));
00050         }
00051         LRange *YRange() { return new LRange(ymin->text().toDouble(),ymax->text().toDouble()); }
00052         void setClippingOffset(int c) { clipni->setValue(c); }
00053         int ClippingOffset() { return clipni->value(); }
00054         
00055         void setTransparent(bool e=true) { transparentcb->setChecked(e); }
00056         bool Transparent() { return transparentcb->isChecked(); }
00057         void setBackground(QColor c) { bgcolor->setColor(c); }
00058         void setBackground(QString c) { bgcolor->setColor(QColor(c)); }
00059         QColor Background() { return bgcolor->color(); }
00060         void setGraphBackground(QColor c) { gbgcolor->setColor(c); }
00061         void setGraphBackground(QString c) { gbgcolor->setColor(QColor(c)); }
00062         QColor GraphBackground() { return gbgcolor->color(); }
00063         
00064         void setBaseline(double v) { baselinele->setText(QString::number(v)); }
00065         double Baseline() { return baselinele->text().toDouble(); }
00066         void setXBaseline(double v) { xbaselinele->setText(QString::number(v)); }
00067         double XBaseline() { return xbaselinele->text().toDouble(); }
00068         void enableBaseline(bool e=true) { baselinecb->setChecked(e); }
00069         bool BaselineEnabled() { return baselinecb->isChecked(); }
00070         void enableXBaseline(bool e=true) { xbaselinecb->setChecked(e); }
00071         bool XBaselineEnabled() { return xbaselinecb->isChecked(); }
00072         void enableRegion(bool e=true) { regioncb->setChecked(e); }     
00073         bool RegionEnabled() { return regioncb->isChecked(); }
00074         void setRegion(double min, double max) { 
00075                 regionminle->setText(QString::number(min)); 
00076                 regionmaxle->setText(QString::number(max)); 
00077         }
00078 
00079         void EnableMarker(bool e=true) { markercb->setChecked(e); }
00080         bool MarkerEnabled() { return markercb->isChecked(); }
00081         void setXMarker(double min, double max) {
00082                 markxminle->setText(QString::number(min));
00083                 markxmaxle->setText(QString::number(max));      
00084         }
00085         LRange *XMarker() { return new LRange(markxminle->text().toDouble(),markxmaxle->text().toDouble()); }
00086         void setYMarker(double min, double max) {
00087                 markyminle->setText(QString::number(min));
00088                 markymaxle->setText(QString::number(max));      
00089         }
00090         LRange *YMarker() { return new LRange(markyminle->text().toDouble(),markymaxle->text().toDouble()); }
00091         
00092         // TODO : surface style ?       -> in Dialog.h  // setStyle() ???
00093 
00094         // QWT 3D
00095         void disableMouse(bool e=false) { disablemousecb->setChecked(e); }
00096         bool MouseDisabled() { return disablemousecb->isChecked(); }
00097         void setResolution(int r) { resolutionle->setText(QString::number(r)); }
00098         int Resolution() { return resolutionle->text().toInt(); }
00099         void setAspectRatio(int v) { aspectcb->setCurrentItem(v); }
00100         int AspectRatio() { return aspectcb->currentItem(); }
00101         void setPlotStyle(int v) { plotstyle->setCurrentItem(v); }
00102         int PlotStyle() { return plotstyle->currentItem(); }
00103         void setCoordinateStyle(int v) { coordinatestyle->setCurrentItem(v); }
00104         int CoordinateStyle() { return coordinatestyle->currentItem(); }
00105         void setFloorStyle(int v) { floorstyle->setCurrentItem(v); }
00106         int FloorStyle() { return floorstyle->currentItem(); }
00107         void setIsoline(int i) { isolines->setText(QString::number(i)); }
00108         int Isolines() { return isolines->text().toInt(); }
00109         // selectColormap() ?
00110         
00111         void fillColorChanged();
00112         void bgColorChanged();
00113         void gbgColorChanged();
00114         void enableFill(bool e=true) { fillcb->setChecked(e); }
00115         bool fillEnabled() { return fillcb->isChecked(); }
00116         int fillG1() { return fillg1le->text().toInt(); }
00117         void setFillG1(int g) { fillg1le->setText(QString::number(g)); }
00118         int fillG2() { return fillg2le->text().toInt(); }
00119         void setFillG2(int g) { fillg2le->setText(QString::number(g)); }
00120         QBrush fillBrush() { return QBrush(fillcolorcb->color(),(Qt::BrushStyle)fillbrushcb->currentItem()); }
00121         void setFillBrush(QBrush b) { fillcolorcb->setColor(b.color()); fillbrushcb->setCurrentItem(b.style()); }
00122         QColor fillColor() { return fillcolorcb->color(); }
00123         void setFillColor(QColor c) { fillcolorcb->setColor(c); }
00124         int fillBrushStyle() { return fillbrushcb->currentItem(); }
00125         void setFillBrushStyle(int v) { fillbrushcb->setCurrentItem(v); }
00126         int Apply() { return apply_clicked(); }
00127 private:
00128         Plot *plot;
00129         int type;
00130         KLineEdit *posx, *posy, *sizex, *sizey;
00131         QCheckBox *aspect, *render, *leftpanel, *rightpanel, *toppanel, *bottompanel;
00132         KLineEdit *borderwidth, *baselinele, *xbaselinele;
00133         KColorButton *bgcolor, *gbgcolor;
00134         KComboBox *bgbrushcb, *gbgbrushcb;
00135         KLineEdit *xmin, *xmax, *ymin, *ymax, *zmin, *zmax;
00136         KIntNumInput *clipni;
00137         QCheckBox *baselinecb, *xbaselinecb, *regioncb, *transparentcb;
00138         KLineEdit *regionminle, *regionmaxle;
00139         QCheckBox *markercb;
00140         KLineEdit *markxminle, *markxmaxle, *markyminle, *markymaxle;
00141         KComboBox *aspectcb;
00142         KComboBox *plotstyle, *coordinatestyle, *floorstyle;
00143         KLineEdit *isolines, *resolutionle;
00144         QCheckBox *disablemousecb;
00145         QCheckBox *fillcb;                                              // fill
00146         QHButtonGroup *hbg;
00147         KLineEdit *fillg1le, *fillg2le;
00148         KColorButton *fillcolorcb;
00149         KComboBox *fillbrushcb;
00150         KComboBox *datamodegraphcb;
00151         KColorButton *datamodecolorcb;
00152 private slots:
00153         void ok_clicked() {apply_clicked(); accept(); }
00154         void saveSettings();
00155         int apply_clicked();
00156 };
00157 
00158 #endif //PLOTSETTINGSDIALOG_H

Generated on Sat Oct 13 21:55:01 2007 for LabPlot by  doxygen 1.4.4