2015-02-25 17:42:08 +00:00
|
|
|
//
|
|
|
|
// Copyright 2008 Jim Bublitz <jbublitz@nwinternet.com>
|
|
|
|
// Earlier copyrights 1998 - 2007 Jim Bublitz also apply
|
|
|
|
|
|
|
|
// Generated by twine
|
|
|
|
|
|
|
|
// This file is part of PyKDE4.
|
|
|
|
|
|
|
|
// PyKDE4 is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU Lesser General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2.1 of
|
|
|
|
// the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
// PyKDE4 is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
class KNumInput : QWidget
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <knuminput.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit KNumInput (QWidget* parent /TransferThis/ = 0);
|
2015-02-25 19:52:20 +00:00
|
|
|
|
2015-02-25 17:42:08 +00:00
|
|
|
virtual void setLabel (const QString& label, Qt::Alignment a = Qt::AlignLeft|Qt::AlignTop);
|
|
|
|
QString label () const;
|
|
|
|
bool showSlider () const;
|
|
|
|
void setSteps (int minor, int major);
|
|
|
|
virtual QSize sizeHint () const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
QSlider* slider () const;
|
|
|
|
void layout (bool deep);
|
|
|
|
virtual void doLayout ()=0;
|
|
|
|
|
|
|
|
private:
|
|
|
|
//force
|
|
|
|
KNumInput (const KNumInput&);
|
|
|
|
//end
|
|
|
|
public:
|
|
|
|
~KNumInput ();
|
|
|
|
};
|
|
|
|
// KNumInput
|
|
|
|
|
|
|
|
|
|
|
|
class KIntNumInput : KNumInput
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <knuminput.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit KIntNumInput (QWidget* parent /TransferThis/ = 0);
|
|
|
|
explicit KIntNumInput (int value, QWidget* parent /TransferThis/ = 0, int base = 10);
|
|
|
|
int value () const;
|
|
|
|
double relativeValue () const;
|
|
|
|
int referencePoint () const;
|
|
|
|
QString suffix () const;
|
|
|
|
QString prefix () const;
|
|
|
|
QString specialValueText () const;
|
|
|
|
void setSliderEnabled (bool enabled = 1);
|
|
|
|
void setMinimum (int min);
|
|
|
|
int minimum () const;
|
|
|
|
void setMaximum (int max);
|
|
|
|
int maximum () const;
|
|
|
|
int singleStep () const;
|
|
|
|
void setSingleStep (int step);
|
|
|
|
void setSpecialValueText (const QString& text);
|
|
|
|
virtual void setLabel (const QString& label, Qt::Alignment a = Qt::AlignLeft|Qt::AlignTop);
|
|
|
|
virtual QSize minimumSizeHint () const;
|
|
|
|
void setValue (int);
|
|
|
|
void setRelativeValue (double);
|
|
|
|
void setReferencePoint (int);
|
|
|
|
void setSuffix (const QString& suffix);
|
|
|
|
void setSuffix (const KLocalizedString& suffix);
|
|
|
|
void setPrefix (const QString& prefix);
|
|
|
|
void setEditFocus (bool mark = 1);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void valueChanged (int);
|
|
|
|
void relativeValueChanged (double);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
QSpinBox* spinBox () const;
|
|
|
|
virtual void doLayout ();
|
|
|
|
void resizeEvent (QResizeEvent*);
|
|
|
|
|
|
|
|
private:
|
|
|
|
//force
|
|
|
|
KIntNumInput (const KIntNumInput&);
|
|
|
|
//end
|
|
|
|
public:
|
|
|
|
~KIntNumInput ();
|
|
|
|
};
|
|
|
|
// KIntNumInput
|
|
|
|
|
|
|
|
|
|
|
|
class KDoubleNumInput : KNumInput
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <knuminput.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit KDoubleNumInput (QWidget* parent /TransferThis/ = 0);
|
|
|
|
KDoubleNumInput (double lower, double upper, double value, QWidget* parent /TransferThis/ = 0, double singleStep = 0.01, int precision = 2);
|
|
|
|
double value () const;
|
|
|
|
QString suffix () const;
|
|
|
|
QString prefix () const;
|
|
|
|
int decimals () const;
|
|
|
|
QString specialValueText () const;
|
|
|
|
void setRange (double min, double max, double singleStep = 1, bool slider = 1);
|
|
|
|
void setSliderEnabled (bool enabled);
|
|
|
|
void setMinimum (double min);
|
|
|
|
double minimum () const;
|
|
|
|
void setMaximum (double max);
|
|
|
|
double maximum () const;
|
|
|
|
double singleStep () const;
|
|
|
|
void setSingleStep (double singleStep);
|
|
|
|
void setDecimals (int decimals);
|
|
|
|
double referencePoint () const;
|
|
|
|
double relativeValue () const;
|
|
|
|
void setSpecialValueText (const QString& text);
|
|
|
|
virtual void setLabel (const QString& label, Qt::Alignment a = Qt::AlignLeft|Qt::AlignTop);
|
|
|
|
virtual QSize minimumSizeHint () const;
|
|
|
|
double exponentRatio () const;
|
|
|
|
void setExponentRatio (double dbl);
|
|
|
|
void setValue (double);
|
|
|
|
void setRelativeValue (double);
|
|
|
|
void setReferencePoint (double ref);
|
|
|
|
void setSuffix (const QString& suffix);
|
|
|
|
void setPrefix (const QString& prefix);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void valueChanged (double);
|
|
|
|
void relativeValueChanged (double);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void doLayout ();
|
|
|
|
void resizeEvent (QResizeEvent*);
|
|
|
|
|
|
|
|
private:
|
|
|
|
//force
|
|
|
|
KDoubleNumInput (const KDoubleNumInput&);
|
|
|
|
//end
|
|
|
|
public:
|
|
|
|
~KDoubleNumInput ();
|
|
|
|
};
|
|
|
|
// KDoubleNumInput
|
|
|
|
|
|
|
|
|
|
|
|
class KIntSpinBox : QSpinBox
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <knuminput.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit KIntSpinBox (QWidget* parent /TransferThis/ = 0);
|
|
|
|
KIntSpinBox (int lower, int upper, int singleStep, int value, QWidget* parent /TransferThis/, int base = 10);
|
|
|
|
void setBase (int base);
|
|
|
|
int base () const;
|
|
|
|
void setEditFocus (bool mark);
|
|
|
|
void setSuffix (const KLocalizedString& suffix);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual QString textFromValue (int) const;
|
|
|
|
virtual int valueFromText (const QString& text) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
//force
|
|
|
|
KIntSpinBox (const KIntSpinBox&);
|
|
|
|
//end
|
|
|
|
public:
|
|
|
|
~KIntSpinBox ();
|
|
|
|
};
|
|
|
|
// KIntSpinBox
|
|
|
|
|
|
|
|
|