kalarm/lib

#include <spinbox.h>

Inherits TQSpinBox.

Inherited by ExtraSpinBox.

Public Slots

virtual void stepUp ()
 
virtual void stepDown ()
 

Signals

void stepped (int step)
 

Public Member Functions

 SpinBox (TQWidget *parent=0, const char *name=0)
 
 SpinBox (int minValue, int maxValue, int step=1, TQWidget *parent=0, const char *name=0)
 
bool isReadOnly () const
 
virtual void setReadOnly (bool readOnly)
 
bool selectOnStep () const
 
void setSelectOnStep (bool sel)
 
void addValue (int change)
 
int minValue () const
 
int maxValue () const
 
void setMinValue (int val)
 
void setMaxValue (int val)
 
void setRange (int minValue, int maxValue)
 
int bound (int val) const
 
int lineStep () const
 
void setLineStep (int step)
 
int lineShiftStep () const
 
void setLineShiftStep (int step)
 

Protected Member Functions

virtual void valueChange ()
 
virtual int shiftStepAdjustment (int oldValue, int shiftStep)
 
virtual bool eventFilter (TQObject *, TQEvent *)
 
virtual void updateDisplay ()
 

Detailed Description

Spin box with accelerated shift key stepping and read-only option.

The SpinBox class provides a TQSpinBox with accelerated stepping using the shift key.

A separate step increment may optionally be specified for use when the shift key is held down. Typically this would be larger than the normal step. Then, when the user clicks the spin buttons, he/she can increment or decrement the value faster by holding the shift key down.

The widget may be set as read-only. This has the same effect as disabling it, except that its appearance is unchanged.

Author
David Jarvie softw.nosp@m.are@.nosp@m.astro.nosp@m.jar..nosp@m.org.u.nosp@m.k

Definition at line 42 of file spinbox.h.

Constructor & Destructor Documentation

◆ SpinBox() [1/2]

SpinBox::SpinBox ( TQWidget *  parent = 0,
const char *  name = 0 
)
explicit

Constructor.

Parameters
parentThe parent object of this widget.
nameThe name of this widget.

Definition at line 27 of file spinbox.cpp.

◆ SpinBox() [2/2]

SpinBox::SpinBox ( int  minValue,
int  maxValue,
int  step = 1,
TQWidget *  parent = 0,
const char *  name = 0 
)

Constructor.

Parameters
minValueThe minimum value which the spin box can have.
maxValueThe maximum value which the spin box can have.
stepThe (unshifted) step interval.
parentThe parent object of this widget.
nameThe name of this widget.

Definition at line 35 of file spinbox.cpp.

Member Function Documentation

◆ addValue()

void SpinBox::addValue ( int  change)
inline

Adds a value to the current value of the spin box.

Definition at line 71 of file spinbox.h.

◆ bound()

int SpinBox::bound ( int  val) const

Returns the specified value clamped to the range of the spin box.

Definition at line 83 of file spinbox.cpp.

◆ eventFilter()

bool SpinBox::eventFilter ( TQObject *  obj,
TQEvent *  e 
)
protectedvirtual

Receives events destined for the spin widget or for the edit field.

Definition at line 202 of file spinbox.cpp.

◆ isReadOnly()

bool SpinBox::isReadOnly ( ) const
inline

Returns true if the widget is read only.

Definition at line 61 of file spinbox.h.

◆ lineShiftStep()

int SpinBox::lineShiftStep ( ) const
inline

Returns the shifted step increment, i.e.

the amount by which the spin box value changes when a spin button is clicked while the shift key is pressed.

Definition at line 95 of file spinbox.h.

◆ lineStep()

int SpinBox::lineStep ( ) const
inline

Returns the unshifted step increment, i.e.

the amount by which the spin box value changes when a spin button is clicked without the shift key being pressed.

Definition at line 87 of file spinbox.h.

◆ maxValue()

int SpinBox::maxValue ( ) const
inline

Returns the maximum value of the spin box.

Definition at line 75 of file spinbox.h.

◆ minValue()

int SpinBox::minValue ( ) const
inline

Returns the minimum value of the spin box.

Definition at line 73 of file spinbox.h.

◆ selectOnStep()

bool SpinBox::selectOnStep ( ) const
inline

Returns whether the spin box value text is selected when its value is stepped.

Definition at line 67 of file spinbox.h.

◆ setLineShiftStep()

void SpinBox::setLineShiftStep ( int  step)

Sets the shifted step increment, i.e.

the amount by which the spin box value changes when a spin button is clicked while the shift key is pressed.

Definition at line 109 of file spinbox.cpp.

◆ setLineStep()

void SpinBox::setLineStep ( int  step)

Sets the unshifted step increment, i.e.

the amount by which the spin box value changes when a spin button is clicked without the shift key being pressed.

Definition at line 102 of file spinbox.cpp.

◆ setMaxValue()

void SpinBox::setMaxValue ( int  val)

Sets the maximum value of the spin box.

Definition at line 95 of file spinbox.cpp.

◆ setMinValue()

void SpinBox::setMinValue ( int  val)

Sets the minimum value of the spin box.

Definition at line 88 of file spinbox.cpp.

◆ setRange()

void SpinBox::setRange ( int  minValue,
int  maxValue 
)
inline

Sets the minimum and maximum values of the spin box.

Definition at line 81 of file spinbox.h.

◆ setReadOnly()

void SpinBox::setReadOnly ( bool  readOnly)
virtual

Sets whether the spin box can be changed by the user.

Parameters
readOnlyTrue to set the widget read-only, false to set it read-write.

Definition at line 72 of file spinbox.cpp.

◆ setSelectOnStep()

void SpinBox::setSelectOnStep ( bool  sel)
inline

Sets whether the spin box value text should be selected when its value is stepped.

Definition at line 69 of file spinbox.h.

◆ shiftStepAdjustment()

int SpinBox::shiftStepAdjustment ( int  oldValue,
int  shiftStep 
)
protectedvirtual

Returns the initial adjustment to the value for a shift step up or down.

The default is to step up or down to the nearest multiple of the shift increment, so the adjustment returned is for stepping up the decrement required to round down to a multiple of the shift increment <= current value, or for stepping down the increment required to round up to a multiple of the shift increment >= current value. This method's caller then adjusts the resultant value if necessary to cater for the widget's minimum/maximum value, and wrapping. This should really be a static method, but it needs to be virtual...

Definition at line 445 of file spinbox.cpp.

◆ stepDown

void SpinBox::stepDown ( )
virtualslot

Decrements the value of the spin box by the unshifted step increment.

Definition at line 123 of file spinbox.cpp.

◆ stepped

void SpinBox::stepped ( int  step)
signal

Signal emitted when the spin box's value is stepped (by the shifted or unshifted increment).

Parameters
stepThe requested step in the spin box's value. Note that the actual change in value may have been less than this.

◆ stepUp

void SpinBox::stepUp ( )
virtualslot

Increments the value of the spin box by the unshifted step increment.

Definition at line 116 of file spinbox.cpp.

◆ updateDisplay()

void SpinBox::updateDisplay ( )
protectedvirtual

Updates the contents of the embedded TQLineEdit to reflect the current value using mapValueToText().

Also enables/disables the up/down push buttons accordingly.

Definition at line 193 of file spinbox.cpp.

◆ valueChange()

void SpinBox::valueChange ( )
protectedvirtual

A virtual method called whenever the value of the spin box has changed.

Definition at line 158 of file spinbox.cpp.


The documentation for this class was generated from the following files: