Name

SpinButton —

A spin button provides the possiblity to enter a numeric value without using the keyboard.

Synopsis

spinButtonNew:: Adjustment -> Double -> Int -> IO SpinButton
spinButtonConfigure:: SpinButtonClass sb => sb -> Adjustment -> Double -> Int -> IO ()
spinButtonGetAdjustment:: SpinButtonClass sb => sb -> IO Adjustment
spinButtonGetValue:: SpinButtonClass sb => sb -> IO Double
spinButtonGetValueAsInt:: SpinButtonClass sb => sb -> IO Int
spinButtonNewWithRange:: Double -> Double -> Double -> IO SpinButton
spinButtonSetAdjustment:: SpinButtonClass sb => sb -> Adjustment -> IO ()
spinButtonSetDigits:: SpinButtonClass sb => sb -> Int -> IO ()
spinButtonSetIncrements:: SpinButtonClass sb => sb -> Double -> Double -> IO ()
spinButtonSetNumeric:: SpinButtonClass sb => sb -> Bool -> IO ()
spinButtonSetRange:: SpinButtonClass sb => sb -> Double -> Double -> IO ()
spinButtonSetSnapToTicks:: SpinButtonClass sb => sb -> Bool -> IO ()
spinButtonSetUpdatePolicy:: SpinButtonClass sb => sb -> SpinButtonUpdatePolicy -> IO ()
spinButtonSetValue:: SpinButtonClass sb => sb -> Double -> IO ()
spinButtonSetWrap:: SpinButtonClass sb => sb -> Bool -> IO ()
spinButtonSpin:: SpinButtonClass sb => sb -> SpinType -> Double -> IO ()
spinButtonUpdate:: SpinButtonClass sb => sb -> IO ()
onInput:: SpinButtonClass sb => sb -> (IO (Maybe Double)) -> IO (ConnectId sb)
onOutput:: SpinButtonClass sb => sb -> IO Bool -> IO (ConnectId sb)
onValueSpinned:: SpinButtonClass sb => sb -> IO () -> IO (ConnectId sb)

Constructors

spinButtonNew

Create a new SpinButton.

spinButtonNew:: Adjustment:: Double:: Int:: IO SpinButton
adjclimbRatedigits

climbRate is the amount by which the value is changed each time the up/down buttons are pressed.

digits is the number of shown digits. Set to 0 to work with integer values.

Methods

spinButtonConfigure

Change the settings of a SpinButton.

spinButtonConfigure:: sb:: Adjustment:: Double:: Int:: IO ()
sbadjclimbRatedigits

spinButtonGetAdjustment

Retrieve the Adjustment object that is currently controlling the SpinButton.

spinButtonGetAdjustment:: sb:: IO Adjustment
sb

spinButtonGetValue

Retrieve the current value as a floating point value.

spinButtonGetValue:: sb:: IO Double
sb

spinButtonGetValueAsInt

Retrieve the current value as integral value.

spinButtonGetValueAsInt:: sb:: IO Int
sb

spinButtonNewWithRange

Create a new SpinButton with a restricted range.

spinButtonNewWithRange:: Double:: Double:: Double:: IO SpinButton
minmaxstep

This is a convenience function because the user does not have to create an Adjustment first. Page increments are set to 10 * step.

spinButtonSetAdjustment

Attach a new Adjustment object to the SpinButton.

spinButtonSetAdjustment:: sb:: Adjustment:: IO ()
sbadj

spinButtonSetDigits

Sets the number of shown digits.

spinButtonSetDigits:: sb:: Int:: IO ()
sbdigits

spinButtonSetIncrements

Sets the increment for up/down buttons.

spinButtonSetIncrements:: sb:: Double:: Double:: IO ()
sbsteppage

spinButtonSetNumeric

Sets the flag that determines if non-numeric text can be typed into the spin button.

spinButtonSetNumeric:: sb:: Bool:: IO ()
sbnumeric

spinButtonSetRange

Set the maximal allowable range for the spinbutton.

spinButtonSetRange:: sb:: Double:: Double:: IO ()
sbminmax

spinButtonSetSnapToTicks

Sets the policy as to whether values are corrected to the nearest step increment when a spin button is activated after providing an invalid value.

spinButtonSetSnapToTicks:: sb:: Bool:: IO ()
sbsnapToTicks

spinButtonSetUpdatePolicy

Whether the an out-of-range value set by spinButtonSetValue is clamped to the limits or simply ignored.

spinButtonSetUpdatePolicy:: sb:: SpinButtonUpdatePolicy:: IO ()
sbup

spinButtonSetValue

Set the value of the SpinButton.

spinButtonSetValue:: sb:: Double:: IO ()
sbvalue

spinButtonSetWrap

Sets the flag that determines if a spin button value wraps around to the opposite limit when the upper or lower limit of the range is exceeded.

spinButtonSetWrap:: sb:: Bool:: IO ()
sbwrap

spinButtonSpin

Increment or decrement the current value of the SpinButton.

spinButtonSpin:: sb:: SpinType:: Double:: IO ()
sbstoffset

spinButtonUpdate

Force an update of the SpinButton.

spinButtonUpdate:: sb:: IO ()
sb

Signals

onInput

Install a custom input handler.

onInput:: sb:: (IO (Maybe Double)):: IO (ConnectId sb)
sbuser

This signal is called upon each time the value of the SpinButton is set by spinButtonSetValue. The function can return Nothing if the value is no good.

onOutput

Install a custom output handler.

onOutput:: sb:: IO Bool:: IO (ConnectId sb)

This handler makes it possible to query the current value and to render something completely different to the screen using entrySetText. The return value must be False in order to let the default output routine run after this signal returns.

onValueSpinned

The value of the spin button has changed.

onValueSpinned:: sb:: IO ():: IO (ConnectId sb)