.TH "KDoubleNumInput" 3 "28 Jan 2004" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KDoubleNumInput \- KDoubleNumInput combines a \fBQSpinBox\fP and optionally a \fBQSlider\fP with a label to make an easy to use control for setting some float parameter. An input control for real numbers, consisting of a spinbox and a slider.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <knuminput.h>\fP
.PP
Inherits \fBKNumInput\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBsetValue\fP (double)"
.br
.RI "\fISets the value of the control. \fP"
.ti -1c
.RI "void \fBsetRelativeValue\fP (double)"
.br
.RI "\fISets the value in units of \fBreferencePoint\fP. \fP"
.ti -1c
.RI "void \fBsetReferencePoint\fP (double ref)"
.br
.RI "\fISets the reference Point to \fCref\fP. \fP"
.ti -1c
.RI "void \fBsetSuffix\fP (const  \fBQString\fP &suffix)"
.br
.RI "\fISets the suffix to be displayed to \fCsuffix\fP. \fP"
.ti -1c
.RI "void \fBsetPrefix\fP (const  \fBQString\fP &prefix)"
.br
.RI "\fISets the prefix to be displayed to \fCprefix\fP. \fP"
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBvalueChanged\fP (double)"
.br
.RI "\fIEmitted every time the value changes (by calling \fBsetValue\fP() or by user interaction). \fP"
.ti -1c
.RI "void \fBrelativeValueChanged\fP (double)"
.br
.RI "\fIThis is an overloaded member function, provided for convenience. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKDoubleNumInput\fP (\fBQWidget\fP *parent=0, const  char *name=0)"
.br
.RI "\fIConstructs an input control for double values with initial value 0.00. \fP"
.ti -1c
.RI "\fBKDoubleNumInput\fP (double value, \fBQWidget\fP *parent=0, const  char *name=0)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP (value is rounded to a multiple of 1/100) Constructor \fP"
.ti -1c
.RI "\fBKDoubleNumInput\fP (double \fBlower\fP, double upper, double value, double step=0.01, int precision=2, \fBQWidget\fP *parent=0, const  char *name=0)"
.br
.RI "\fIConstructor. \fP"
.ti -1c
.RI "virtual \fB~KDoubleNumInput\fP ()"
.br
.RI "\fIdestructor \fP"
.ti -1c
.RI "\fBKDoubleNumInput\fP (\fBKNumInput\fP *below, double value, \fBQWidget\fP *parent=0, const  char *name=0)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP (rounds \fCvalue\fP to a mulitple of 1/100) Constructor \fP"
.ti -1c
.RI "\fBKDoubleNumInput\fP (\fBKNumInput\fP *below, double \fBlower\fP, double upper, double value, double step=0.02, int precision=2, \fBQWidget\fP *parent=0, const  char *name=0)"
.br
.RI "\fIConstructor. \fP"
.ti -1c
.RI "double \fBvalue\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBsuffix\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBprefix\fP () const "
.br
.ti -1c
.RI "int \fBprecision\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBspecialValueText\fP () const "
.br
.ti -1c
.RI "void \fBsetRange\fP (double min, double max, double step=1, bool slider=true)"
.br
.ti -1c
.RI "void \fBsetMinValue\fP (double min)"
.br
.RI "\fISets the minimum value. \fP"
.ti -1c
.RI "double \fBminValue\fP () const "
.br
.ti -1c
.RI "void \fBsetMaxValue\fP (double max)"
.br
.RI "\fISets the maximum value. \fP"
.ti -1c
.RI "double \fBmaxValue\fP () const "
.br
.ti -1c
.RI "void \fBsetPrecision\fP (int precision)"
.br
.RI "\fISpecifies the number of digits to use. \fP"
.ti -1c
.RI "double \fBreferencePoint\fP () const "
.br
.ti -1c
.RI "double \fBrelativeValue\fP () const "
.br
.ti -1c
.RI "void \fBsetSpecialValueText\fP (const  \fBQString\fP &text)"
.br
.RI "\fISets the special value text. \fP"
.ti -1c
.RI "virtual void \fBsetLabel\fP (const  \fBQString\fP &label, int a=AlignLeft|AlignTop)"
.br
.RI "\fISets the text and alignment of the main description label. \fP"
.ti -1c
.RI "virtual \fBQSize\fP \fBminimumSizeHint\fP () const "
.br
.ti -1c
.RI "virtual bool \fBeventFilter\fP (\fBQObject\fP *, \fBQEvent\fP *)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBdoLayout\fP ()"
.br
.RI "\fIYou need to overwrite this method and implement your layout calculations there. \fP"
.ti -1c
.RI "void \fBresizeEvent\fP (\fBQResizeEvent\fP *)"
.br
.ti -1c
.RI "virtual void \fBresetEditBox\fP ()"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "KDoubleLine * \fBedit\fP"
.br
.ti -1c
.RI "bool \fBm_range\fP"
.br
.ti -1c
.RI "double \fBm_lower\fP"
.br
.ti -1c
.RI "double \fBm_upper\fP"
.br
.ti -1c
.RI "double \fBm_step\fP"
.br
.ti -1c
.RI "\fBQSize\fP \fBm_sizeEdit\fP"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKDoubleLine\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
KDoubleNumInput combines a \fBQSpinBox\fP and optionally a \fBQSlider\fP with a label to make an easy to use control for setting some float parameter. An input control for real numbers, consisting of a spinbox and a slider. 

This is especially nice for configuration dialogs, which can have many such combinated controls.
.PP
The slider is created only when the user specifies a range for the control using the setRange function with the slider parameter set to 'true'.
.PP
A special feature of KDoubleNumInput, designed specifically for the situation when there are several instances in a column, is that you can specify what portion of the control is taken by the \fBQSpinBox\fP (the remaining portion is used by the slider). This makes it very simple to have all the sliders in a column be the same size.
.PP
It uses the \fBKDoubleValidator\fP validator class. KDoubleNumInput enforces the value to be in the given range, but see the class documentation of \fBKDoubleSpinBox\fP for the tricky interrelationship of precision and values. All of what is said there applies here, too.
.PP
\fBSee also:\fP
.RS 4
\fBKIntNumInput\fP, \fBKDoubleSpinBox\fP 
.RE
.PP

.PP
Definition at line 432 of file knuminput.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KDoubleNumInput::KDoubleNumInput (\fBQWidget\fP * parent = 0, const char * name = 0)"
.PP
Constructs an input control for double values with initial value 0.00. Definition at line 527 of file knuminput.cpp.
.PP
References KStdAccel::name().
.SS "KDoubleNumInput::KDoubleNumInput (double value, \fBQWidget\fP * parent = 0, const char * name = 0)"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP (value is rounded to a multiple of 1/100) Constructor \fBParameters:\fP
.RS 4
\fIvalue\fP initial value for the control 
.br
\fIparent\fP parent \fBQWidget\fP 
.br
\fIname\fP internal name for this widget 
.RE
.PP
Definition at line 550 of file knuminput.cpp.
.PP
References KStdAccel::name().
.SS "KDoubleNumInput::KDoubleNumInput (double lower, double upper, double value, double step = 0.01, int precision = 2, \fBQWidget\fP * parent = 0, const char * name = 0)"
.PP
Constructor. \fBParameters:\fP
.RS 4
\fIlower\fP lower boundary value 
.br
\fIupper\fP upper boundary value 
.br
\fIvalue\fP initial value for the control 
.br
\fIstep\fP step size to use for up/down arrow clicks 
.br
\fIprecision\fP number of digits after the decimal point 
.br
\fIparent\fP parent \fBQWidget\fP 
.br
\fIname\fP internal name for this widget 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 533 of file knuminput.cpp.
.PP
References KStdAccel::name().
.SS "KDoubleNumInput::~\fBKDoubleNumInput\fP ()\fC [virtual]\fP"
.PP
destructor Definition at line 563 of file knuminput.cpp.
.SS "KDoubleNumInput::KDoubleNumInput (\fBKNumInput\fP * below, double value, \fBQWidget\fP * parent = 0, const char * name = 0)"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP (rounds \fCvalue\fP to a mulitple of 1/100) Constructor puts it below other \fBKNumInput\fP
.PP
\fBParameters:\fP
.RS 4
\fIbelow\fP .br
\fIvalue\fP initial value for the control 
.br
\fIparent\fP parent \fBQWidget\fP 
.br
\fIname\fP internal name for this widget 
.RE
.PP
Definition at line 556 of file knuminput.cpp.
.PP
References KStdAccel::name().
.SS "KDoubleNumInput::KDoubleNumInput (\fBKNumInput\fP * below, double lower, double upper, double value, double step = 0.02, int precision = 2, \fBQWidget\fP * parent = 0, const char * name = 0)"
.PP
Constructor. puts it below other \fBKNumInput\fP
.PP
\fBParameters:\fP
.RS 4
\fIlower\fP lower boundary value 
.br
\fIupper\fP upper boundary value 
.br
\fIvalue\fP initial value for the control 
.br
\fIstep\fP step size to use for up/down arrow clicks 
.br
\fIprecision\fP number of digits after the decimal point 
.br
\fIparent\fP parent \fBQWidget\fP 
.br
\fIname\fP internal name for this widget 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 541 of file knuminput.cpp.
.PP
References KStdAccel::name().
.SH "Member Function Documentation"
.PP 
.SS "double KDoubleNumInput::value () const"
.PP
\fBReturns:\fP
.RS 4
the current value. 
.RE
.PP
Definition at line 783 of file knuminput.cpp.
.PP
Referenced by relativeValue().
.SS "\fBQString\fP KDoubleNumInput::suffix () const"
.PP
\fBReturns:\fP
.RS 4
the suffix. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetSuffix()\fP 
.RE
.PP
Definition at line 799 of file knuminput.cpp.
.SS "\fBQString\fP KDoubleNumInput::prefix () const"
.PP
\fBReturns:\fP
.RS 4
the prefix. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetPrefix()\fP 
.RE
.PP
Definition at line 804 of file knuminput.cpp.
.SS "int KDoubleNumInput::precision () const"
.PP
\fBReturns:\fP
.RS 4
the precision. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetPrecision()\fP 
.RE
.PP
Definition at line 830 of file knuminput.cpp.
.SS "\fBQString\fP KDoubleNumInput::specialValueText () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the string displayed for a special value. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetSpecialValueText()\fP 
.RE
.PP
Definition at line 537 of file knuminput.h.
.SS "void KDoubleNumInput::setRange (double min, double max, double step = 1, bool slider = true)"
.PP
\fBParameters:\fP
.RS 4
\fImin\fP minimum value 
.br
\fImax\fP maximum value 
.br
\fIstep\fP step size for the \fBQSlider\fP 
.RE
.PP
Definition at line 716 of file knuminput.cpp.
.PP
References QWidget::layout(), QSpinBox::lineStep(), QSpinBox::maxValue(), QSpinBox::minValue(), referencePoint(), QSlider::setLineStep(), QSlider::setRange(), setReferencePoint(), QSlider::setTickInterval(), QSlider::setTickmarks(), QSlider::setValue(), setValue(), QSpinBox::value(), and valueChanged().
.PP
Referenced by setMaxValue(), and setMinValue().
.SS "void KDoubleNumInput::setMinValue (double min)"
.PP
Sets the minimum value. Definition at line 763 of file knuminput.cpp.
.PP
References maxValue(), and setRange().
.SS "double KDoubleNumInput::minValue () const"
.PP
\fBReturns:\fP
.RS 4
the minimum value. 
.RE
.PP
Definition at line 768 of file knuminput.cpp.
.PP
Referenced by setMaxValue(), and setReferencePoint().
.SS "void KDoubleNumInput::setMaxValue (double max)"
.PP
Sets the maximum value. Definition at line 773 of file knuminput.cpp.
.PP
References minValue(), and setRange().
.SS "double KDoubleNumInput::maxValue () const"
.PP
\fBReturns:\fP
.RS 4
the maximum value. 
.RE
.PP
Definition at line 778 of file knuminput.cpp.
.PP
Referenced by setMinValue(), and setReferencePoint().
.SS "void KDoubleNumInput::setPrecision (int precision)"
.PP
Specifies the number of digits to use. Definition at line 823 of file knuminput.cpp.
.PP
References QWidget::layout().
.SS "double KDoubleNumInput::referencePoint () const"
.PP
\fBReturns:\fP
.RS 4
the reference point for \fBrelativeValue\fP calculation 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 794 of file knuminput.cpp.
.PP
Referenced by setRange().
.SS "double KDoubleNumInput::relativeValue () const"
.PP
\fBReturns:\fP
.RS 4
the current value in units of \fBreferencePoint\fP. 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 788 of file knuminput.cpp.
.PP
References value().
.SS "void KDoubleNumInput::setSpecialValueText (const \fBQString\fP & text)"
.PP
Sets the special value text. If set, the spin box will display this text instead of the numeric value whenever the current value is equal to \fBminVal\fP(). Typically this is used for indicating that the choice has a special (default) meaning. Definition at line 835 of file knuminput.cpp.
.PP
References QWidget::layout().
.SS "void KDoubleNumInput::setLabel (const \fBQString\fP & label, int a = AlignLeft|AlignTop)\fC [virtual]\fP"
.PP
Sets the text and alignment of the main description label. \fBParameters:\fP
.RS 4
\fIlabel\fP The text of the label. Use QString::null to remove an existing one.
.br
\fIa\fP one of \fCAlignLeft\fP, \fCAlignHCenter\fP, YAlignRight and \fCAlignTop\fP, \fCAlignVCenter\fP, \fCAlignBottom\fP. default is \fCAlignLeft\fP | \fCAlignTop\fP.
.RE
.PP
The vertical alignment flags have special meaning with this widget:
.PP
.IP "\(bu" 2
\fCAlignTop\fP The label is placed above the edit/slider 
.IP "\(bu" 2
\fCAlignVCenter\fP The label is placed left beside the edit 
.IP "\(bu" 2
\fCAlignBottom\fP The label is placed below the edit/slider 
.PP
Reimplemented from \fBKNumInput\fP.
.PP
Definition at line 843 of file knuminput.cpp.
.PP
References KStdAccel::label(), QLabel::setBuddy(), and KNumInput::setLabel().
.SS "void KDoubleNumInput::setValue (double)\fC [slot]\fP"
.PP
Sets the value of the control. Definition at line 696 of file knuminput.cpp.
.PP
Referenced by setRange(), and setRelativeValue().
.SS "void KDoubleNumInput::setRelativeValue (double)\fC [slot]\fP"
.PP
Sets the value in units of \fBreferencePoint\fP. \fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 701 of file knuminput.cpp.
.PP
References setValue().
.SS "void KDoubleNumInput::setReferencePoint (double ref)\fC [slot]\fP"
.PP
Sets the reference Point to \fCref\fP. It \fCref\fP == 0, emitting of \fBrelativeValueChanged\fP is blocked and \fBrelativeValue\fP just returns 0. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 709 of file knuminput.cpp.
.PP
References maxValue(), and minValue().
.PP
Referenced by setRange().
.SS "void KDoubleNumInput::setSuffix (const \fBQString\fP & suffix)\fC [slot]\fP"
.PP
Sets the suffix to be displayed to \fCsuffix\fP. Use QString::null to disable this feature. Note that the suffix is attached to the value without any spacing. So if you prefer to display a space separator, set suffix to something like ' cm'. 
.PP
\fBSee also:\fP
.RS 4
\fBsetSuffix()\fP 
.RE
.PP
Definition at line 809 of file knuminput.cpp.
.PP
References QWidget::layout().
.SS "void KDoubleNumInput::setPrefix (const \fBQString\fP & prefix)\fC [slot]\fP"
.PP
Sets the prefix to be displayed to \fCprefix\fP. Use QString::null to disable this feature. Note that the prefix is attached to the value without any spacing. 
.PP
\fBSee also:\fP
.RS 4
\fBsetPrefix()\fP 
.RE
.PP
Definition at line 816 of file knuminput.cpp.
.PP
References QWidget::layout().
.SS "void KDoubleNumInput::valueChanged (double)\fC [signal]\fP"
.PP
Emitted every time the value changes (by calling \fBsetValue\fP() or by user interaction). Referenced by setRange().
.SS "void KDoubleNumInput::relativeValueChanged (double)\fC [signal]\fP"
.PP
This is an overloaded member function, provided for convenience. It essentially behaves like the above function.
.PP
Contains the value in units of \fBreferencePoint\fP. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.SS "void KDoubleNumInput::doLayout ()\fC [protected, virtual]\fP"
.PP
You need to overwrite this method and implement your layout calculations there. See \fBKIntNumInput::doLayout\fP and \fBKDoubleNumInput::doLayout\fP implementation for details. Implements \fBKNumInput\fP.
.PP
Definition at line 690 of file knuminput.cpp.
.PP
References QSize::width().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
