Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

scrspinbox.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  *   Craig Bradney, cbradney@zip.com.au                                    *
00009  ***************************************************************************/
00010 
00011 #ifndef SCRSPINBOX
00012 #define SCRSPINBOX
00013 
00014 #include <QDoubleSpinBox>
00015 #include <QLineEdit>
00016 #include <QWidget>
00017 
00018 #include "scribusapi.h"
00019 
00021 class SCRIBUS_API ScrSpinBox : public QDoubleSpinBox
00022 {
00023     Q_OBJECT
00024     public:
00025         ScrSpinBox(QWidget *parent, int unitIndex=0);
00026         ScrSpinBox(double minValue, double maxValue, QWidget *pa, int unitIndex=0);
00027         ~ScrSpinBox();
00028         
00029         //overridden members
00030         double valueFromText ( const QString & text ) const;
00031         QString textFromValue ( double value ) const;
00032         QValidator::State validate ( QString & input, int & pos ) const;
00033         void fixup ( QString & input ) const;
00034         
00035         //custom
00036         void init(int unitIndex);
00037         void setConstants(const QMap<QString, double>* constants);
00038         void setNewUnit(int unitIndex);
00039         double getValue(int unitIndex=0);
00040         //implemented for backwards compatibility, perhaps we can remove these?
00041 //      void setSingleStepM(int val);
00042         void setTabAdvance(bool enable);
00043         
00044     public slots:
00045         void setValues(double min, double max, int deci, double val);
00046         void getValues(double *min, double *max, int *deci, double *val);
00047     
00048     protected:
00049         void setParameters( int s );
00050         uint m_unitIndex;
00051         bool m_tabAdvance;
00052         const QMap<QString, double>* m_constants;
00053         bool eventFilter ( QObject * watched, QEvent * event );
00054         
00055     protected slots:
00056         void textChanged();
00057 
00058 };
00059 #endif
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.