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

AxesDialog.h

Go to the documentation of this file.
00001 //LabPlot : AxesDialog.h
00002 
00003 #ifndef AXESDIALOG_H
00004 #define AXESDIALOG_H
00005 
00006 #include <qfont.h>
00007 #include <qcheckbox.h>
00008 #include <qtoolbutton.h>
00009 #include <klistbox.h>
00010 #include "MainWin.h"
00011 #include "Dialog.h"
00012 #include "RichTextWidget.h"
00013 
00014 class AxesDialog: public Dialog
00015 {
00016         Q_OBJECT
00017 public:
00018         AxesDialog(MainWin *mw, const char *name, int axesnr);
00019         void updateDialog(int i=-1);
00020 public slots:
00021         void selectTickFont();
00022         void updateAxis(int i=-1);
00023         void updateTickType(int tt);
00024         void update_timeformat();
00025         void updateScale(int i);
00026         void axisEnabled(bool on);
00027         void centerEnabled(bool on);
00028         
00029         void Enable(bool e=true) { axiscb->setChecked(e); }
00030         void enableAxis(bool e=true) { Enable(e); }
00031         void setPosition(int p) { positioncb->setCurrentItem(p); }
00032         int Position() { return positioncb->currentItem(); }
00033         void setScale(int s) { ascb->setCurrentItem(s); }
00034         int Scale() { return ascb->currentItem(); }
00035         void setScaling(double s) { scalingle->setText(QString::number(s)); }
00036         double Scaling() { return scalingle->text().toDouble(); }
00037         void setShift(double s) { shiftle->setText(QString::number(s)); }
00038         double Shift() { return shiftle->text().toDouble(); }
00039         void setRange(double a, double b) 
00040                 { minle->setText(QString::number(a)); maxle->setText(QString::number(b)); }
00041         LRange *Range() { return new LRange(minle->text().toDouble(),maxle->text().toDouble()); }
00042         void setMin(double a) { minle->setText(QString::number(a)); }
00043         double getMin() { return minle->text().toDouble(); }
00044         void setMax(double b) { maxle->setText(QString::number(b)); }
00045         double getMax() { return maxle->text().toDouble(); }
00046         void enableCenter(bool e=true) { centercb->setChecked(e); }
00047         bool Center() { return centercb->isChecked(); }
00048         void setLabel(Label *l) { rtw->setLabel(l); }
00049         Label *getLabel() { return rtw->getLabel(); }
00050         void setTickPosition(int i) { tickposcb->setCurrentItem(i); }
00051         int TickPosition() { return tickposcb->currentItem(); }
00052         void setTickStyle(int i) { ticktypecb->setCurrentItem(i); }
00053         int TickStyle() { return ticktypecb->currentItem(); }
00054 
00055         void enableMajorTicks(bool e=true) { majortickscb->setChecked(e); }
00056         bool MajorTicksEnabled() { return majortickscb->isChecked(); }
00057         void setMajorTicks(int n) { majorle->setText(QString::number(n)); }
00058         int MajorTicks() { return majorle->text().toInt(); }
00059         void setMajorTickLength(int n) { majorticklengthle->setText(QString::number(n)); }
00060         int MajorTickLength() { return majorticklengthle->text().toInt(); }
00061         void enableMinorTicks(bool e=true) { minortickscb->setChecked(e); }
00062         bool MinorTicksEnabled() { return minortickscb->isChecked(); }
00063         void setMinorTicks(int n) { minorle->setText(QString::number(n)); }
00064         int MinorTicks() { return minorle->text().toInt(); }
00065         void setMinorTickLength(int n) { minorticklengthle->setText(QString::number(n)); }
00066         int MinorTickLength() { return minorticklengthle->text().toInt(); }
00067         void setTickColor(QColor c) { tcb->setColor(c); }
00068         QColor TickColor() { return tcb->color(); }
00069         
00070         void enableTickLabel(bool e=true) { ticklabelcb->setChecked(e); }       
00071         bool TickLabelEnabled() { return ticklabelcb->isChecked(); }
00072         void setTickLabelFont(QFont f) { tf=f; }
00073         QFont TickLabelFont() { return tf; }
00074         void setTickLabelColor(QColor c) { tlcb->setColor(c); }
00075         QColor TickLabelColor() { return tlcb->color(); }
00076         void setTickLabelFormat(int i) { atlfcb->setCurrentItem(i); }
00077         int TickLabelFormat() { return atlfcb->currentItem(); }
00078         void setTimeFormat(QString t) { timeformat->setText(t); }
00079         QString TimeFormat() { return timeformat->text(); }
00080         void setTickLabelPrecision(int p) { tlpni->setValue(p); }
00081         int TickLabelPrecision() { return tlpni->value(); }
00082         void setTickLabelPosition(int p) { tlgni->setValue(p); }
00083         int TickLabelPosition() { return tlgni->value(); }
00084         void setTickLabelPrefix(QString s) { tlprefix->setText(s); }
00085         QString TickLabelPrefix() { return tlprefix->text(); }
00086         void setTickLabelSuffix(QString s) { tlsuffix->setText(s); }
00087         QString TickLabelSuffix() { return tlsuffix->text(); }
00088         void setTickLabelRotation(int r) { tlrotation->setText(QString::number(r)); }
00089         int TickLabelRotation() { return tlrotation->text().toInt(); }
00090 
00091         void enableMajorGrid(bool e=true) { majorgridcb->setChecked(e); }
00092         bool MajorGrid() { return majorgridcb->isChecked(); }
00093         void setMajorGridWidth(int w) { majorgridwidth->setValue(w); }
00094         int MajorGridWidth() { return majorgridwidth->value(); }
00095         void setMajorGridStyle(int s) { majorgridstylecb->setCurrentItem(s); }
00096         int MajorGridStyle() { return majorgridstylecb->currentItem(); }
00097         void setMajorGridColor(QColor c) { majorgridcolorcb->setColor(c); }
00098         QColor MajorGridColor() { return majorgridcolorcb->color(); }
00099         void enableMinorGrid(bool e=true) { minorgridcb->setChecked(e); }
00100         bool MinorGrid() { return minorgridcb->isChecked(); }
00101         void setMinorGridWidth(int w) { minorgridwidth->setValue(w); }
00102         int MinorGridWidth() { return minorgridwidth->value(); }
00103         void setMinorGridStyle(int s) { minorgridstylecb->setCurrentItem(s); }
00104         int MinorGridStyle() { return minorgridstylecb->currentItem(); }
00105         void setMinorGridColor(QColor c) { minorgridcolorcb->setColor(c); }
00106         QColor MinorGridColor() { return majorgridcolorcb->color(); }
00107 
00108         void enableBorder(bool e=true) { bordercb->setChecked(e); }
00109         bool BorderEnabled() { return bordercb->isChecked(); }
00110         void setBorderColor(QColor c) { bcb->setColor(c); }
00111         QColor BorderColor() { return bcb->color(); }
00112         void setBorderWidth(int w=1) { borderwidth->setValue(w); }
00113         void setBorderWidth(QString w) { borderwidth->setValue(w.toInt()); }
00114         int BorderWidth() { return borderwidth->value(); }
00115 
00116         void ok_clicked() { apply_clicked(); accept(); }
00117         void saveSettings();
00118         int apply_clicked();
00119         int Apply() { return apply_clicked(); }
00120 private:
00121         Plot *plot;
00122         Axis *axis[12];
00123         int type;
00124         RichTextWidget *rtw;
00125         QLabel *majorlabel;
00126         KComboBox *ticktypecb, *positioncb;
00127         KLineEdit *scalingle, *shiftle, *tickfont, *minle, *maxle, *majorle, *minorle;
00128         KIntNumInput *tlpni, *tlgni;
00129         KLineEdit *tlprefix, *tlsuffix, *timeformat, *tlrotation;
00130         KComboBox *axescb;
00131         QCheckBox *axiscb, *centercb, *majortickscb, *minortickscb, *majorgridcb, *minorgridcb, *bordercb, *ticklabelcb;
00132         KIntNumInput *majortickwidth, *minortickwidth, *majorgridwidth, *minorgridwidth, *borderwidth;
00133         KLineEdit *majorticklengthle, *minorticklengthle;
00134         KColorButton *tcb, *tlcb, *gcb, *bcb;
00135         KComboBox *atlfcb, *ascb, *tickposcb;
00136         QFont tf;
00137         KComboBox *majorgridstylecb, *minorgridstylecb;
00138         KColorButton *majorgridcolorcb, *minorgridcolorcb;
00139 };
00140 #endif //AXESDIALOG_H

Generated on Sun Apr 2 02:05:09 2006 for LabPlot by  doxygen 1.4.4