Back to index

scribus-ng  1.3.4.dfsg+svn20071115
mspinbox.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008                           mspinbox.h  -  description
00009                              -------------------
00010     begin                : Sat Jun 16 2001
00011     copyright            : (C) 2001 by Franz Schmid
00012     email                : Franz.Schmid@altmuehlnet.de
00013  ***************************************************************************/
00014 
00015 /***************************************************************************
00016  *                                                                         *
00017  *   This program is free software; you can redistribute it and/or modify  *
00018  *   it under the terms of the GNU General Public License as published by  *
00019  *   the Free Software Foundation; either version 2 of the License, or     *
00020  *   (at your option) any later version.                                   *
00021  *                                                                         *
00022  ***************************************************************************/
00023 
00024 #ifndef MSPINBOX_H
00025 #define MSPINBOX_H
00026 
00027 #include <qmap.h>
00028 #include <qspinbox.h>
00029 #include <qstring.h>
00030 #include "scribusapi.h"
00031 
00032 class FunctionParser;
00033 
00037 class SCRIBUS_API MSpinBox : public QSpinBox  
00038 {
00039        Q_OBJECT
00040        
00041 public:
00047        MSpinBox(QWidget *pa, int s);
00055        MSpinBox(double minValue, double maxValue, QWidget *pa, int s);
00061        MSpinBox(QWidget *parent, const char * name = 0);
00062 
00063        ~MSpinBox();
00069        double value();
00075        double minValue();
00081        double maxValue();
00082        virtual QString mapValueToText(int value);
00089        virtual int mapTextToValue(bool *ok);
00097        void setNewUnit(double oldUnitRatio, double newUnitRatio, int unitIndex);
00098        void setTabAdvance(bool enable);
00099        int Decimals;
00100        int Width;
00101        QLineEdit *ed;
00102        void setDecimals( int deci );
00103        bool isReadOnly() const;
00104        void setConstants(const QMap<QString, double>&);
00105        void setLineStepM(int val);
00106 
00107 public slots:
00108        void textChanged();
00109        virtual void stepDown();
00115        void setMaxValue(double val);
00121        void setMinValue(double val);
00127        virtual void setValue(double val);
00128        void setReadOnly(bool ro);
00129        void setValues(double min, double max, int deci, double val);
00130        void getValues(double *min, double *max, int *deci, double *val);
00131 
00132 protected:
00133        bool m_tabAdvance;
00134        virtual bool eventFilter( QObject* ob, QEvent* ev );
00135        void setParameters( int s );
00136        void setFPConstants(FunctionParser &fp);
00137        bool readOnly;
00138        int oldLineStep;
00139        int currLineStep;
00140        bool edited;
00141        QMap <QString, double> functionParserConstants;
00142 };
00143 
00144 #endif