DoubleSpinBox.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : DoubleSpinBox.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2007 by Ion Vasilief
00006     Email (use @ for *)  : ion_vasilief*yahoo.fr
00007     Description          : A Customized Double Spin Box
00008 
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *  This program is free software; you can redistribute it and/or modify   *
00014  *  it under the terms of the GNU General Public License as published by   *
00015  *  the Free Software Foundation; either version 2 of the License, or      *
00016  *  (at your option) any later version.                                    *
00017  *                                                                         *
00018  *  This program is distributed in the hope that it will be useful,        *
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00021  *  GNU General Public License for more details.                           *
00022  *                                                                         *
00023  *   You should have received a copy of the GNU General Public License     *
00024  *   along with this program; if not, write to the Free Software           *
00025  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
00026  *   Boston, MA  02110-1301  USA                                           *
00027  *                                                                         *
00028  ***************************************************************************/
00029 #ifndef DoubleSpinBox_H
00030 #define DoubleSpinBox_H
00031 
00032 #include <QDoubleSpinBox>
00033 #include <QCheckBox>
00034 
00035 class DoubleSpinBox : public QDoubleSpinBox
00036 {
00037 public:
00038     DoubleSpinBox(const char format, QWidget * parent = 0);
00039     virtual QString textFromValue ( double value ) const {return locale().toString(value, d_format, decimals());};
00040     virtual double valueFromText ( const QString & text ) const {return locale().toDouble(text);};
00041     virtual QValidator::State validate ( QString & input, int & pos ) const;
00042 
00043 private:
00044     const char d_format;
00045 };
00046 
00047 class RangeLimitBox : public QWidget
00048 {
00049 public:
00050     enum LimitType{LeftLimit, RightLimit};
00051 
00052     RangeLimitBox(LimitType type, QWidget * parent = 0);
00053     void setDecimals(int prec){d_spin_box->setDecimals(prec);};
00054     double value();
00055     bool isChecked(){return d_checkbox->isChecked();};
00056 
00057 private:
00058     DoubleSpinBox *d_spin_box;
00059     QCheckBox *d_checkbox;
00060     LimitType d_type;
00061 };
00062 #endif // FITDIALOG_H
00063 

Generated on Thu Feb 7 13:59:26 2008 for QtiPlot by  doxygen 1.5.4