00001 //LabPlot : WorksheetDialog.h 00002 00003 #ifndef WORKSHEETDIALOG_H 00004 #define WORKSHEETDIALOG_H 00005 00006 #include <qtoolbutton.h> 00007 #include <qcolor.h> 00008 #include <qcheckbox.h> 00009 #include "Worksheet.h" 00010 #include "Dialog.h" 00011 #include "RichTextWidget.h" 00012 00013 class WorksheetDialog: public Dialog 00014 { 00015 Q_OBJECT 00016 public: 00017 WorksheetDialog(MainWin *mw, const char *name); 00018 void updateDialog(); 00019 public slots: 00020 void enableTitle(bool e=true) { enabletcb->setChecked(e); } 00021 bool TitleEnabled() { return enabletcb->isChecked(); } 00022 void setTitle(QString t) { titlele->setText(t); } 00023 QString Title() { return titlele->text(); } 00024 void setColor(QColor c) { bgcolor->setColor(c); } 00025 void setWorksheetColor(QColor c) { setColor(c); } 00026 QColor Color() { return bgcolor->color(); } 00027 QColor BackgroundColor() { return Color(); } 00028 QColor WorksheetColor() { return Color(); } 00029 void enableTimeStamp(bool e=true) { enablecb->setChecked(e); } 00030 bool TimeStampEnabled() { return enablecb->isChecked(); } 00031 void setTimeStamp(QString t) { timestample->setText(t); } 00032 QString TimeStamp() { return timestample->text(); } 00033 void setSize(int x, int y) { xni->setValue(x); yni->setValue(y); } 00034 void setWidth(int x) { xni->setValue(x); } 00035 void setHeight(int y) { yni->setValue(y); } 00036 Point Size() { return Point(xni->value(),yni->value()); } 00037 int Width() { return xni->value(); } 00038 int Heigth() { return yni->value(); } 00039 00040 int Apply() { return apply_clicked(); } 00041 void updateTimeStamp(); 00042 private: 00043 KColorButton *bgcolor; 00044 KComboBox *wbrushcb; 00045 QCheckBox *enabletcb, *enablecb, *objectscb; 00046 KLineEdit *titlele, *timestample; 00047 KIntNumInput *xni, *yni; 00048 KPushButton *update; 00049 private slots: 00050 void ok_clicked() {apply_clicked(); accept(); } 00051 void colorChanged(); 00052 void saveSettings(); 00053 int apply_clicked(); 00054 }; 00055 00056 #endif //WORKSHEETDIALOG_H