Scribus
Open source desktop publishing at your fingertips
mspinbox.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 /***************************************************************************
8  mspinbox.h - description
9  -------------------
10  begin : Sat Jun 16 2001
11  copyright : (C) 2001 by Franz Schmid
12  email : Franz.Schmid@altmuehlnet.de
13  ***************************************************************************/
14 
15 /***************************************************************************
16  * *
17  * This program is free software; you can redistribute it and/or modify *
18  * it under the terms of the GNU General Public License as published by *
19  * the Free Software Foundation; either version 2 of the License, or *
20  * (at your option) any later version. *
21  * *
22  ***************************************************************************/
23 
24 #ifndef MSPINBOX_H
25 #define MSPINBOX_H
26 
27 #include <QMap>
28 #include <QSpinBox>
29 #include <QString>
30 //Added by qt3to4:
31 #include <QEvent>
32 #include "scribusapi.h"
33 
34 class FunctionParser;
35 
39 class SCRIBUS_API MSpinBox : public QSpinBox
40 {
41  Q_OBJECT
42 
43 public:
49  MSpinBox(QWidget *pa, int s);
57  MSpinBox(double minValue, double maxValue, QWidget *pa, int s);
63  MSpinBox(QWidget *parent, const char * name = 0);
64 
65  ~MSpinBox();
71  double value();
77  double minValue();
83  double maxValue();
84  virtual QString mapValueToText(int value);
91  virtual int mapTextToValue(bool *ok);
99  void setNewUnit(double oldUnitRatio, double newUnitRatio, int unitIndex);
100  void setTabAdvance(bool enable);
101  int Decimals;
102  int Width;
103  QLineEdit *ed;
104  void setDecimals( int deci );
105  bool isReadOnly() const;
106  void setConstants(const QMap<QString, double>&);
107  void setLineStepM(int val);
108 
109 public slots:
110  void textChanged();
111  void stepDown();
117  void setMaxValue(double val);
123  void setMinValue(double val);
129  virtual void setValue(double val);
130  void setReadOnly(bool ro);
131  void setValues(double min, double max, int deci, double val);
132  void getValues(double *min, double *max, int *deci, double *val);
133 
134 protected:
135  bool m_tabAdvance;
136  bool eventFilter( QObject* ob, QEvent* ev );
137  void setParameters( int s );
138  void setFPConstants(FunctionParser &fp);
139  bool readOnly;
140  int oldLineStep;
141  int currLineStep;
142  bool edited;
143  QMap <QString, double> functionParserConstants;
144 };
145 
146 #endif
Enthanced QSpinBox.
Definition: mspinbox.h:39
Definition: fparser.hh:21