AG_Numerical widget allows the value of an integer or floating-point variable to be
edited by the user.
AG_Numerical provides a
value binding, and optional limits may be specified as the
If min or max are undefined when the widget is first shown, default limits are set according to the widest numerical range that can be represented by the type of value.
AG_Numerical is composed of an AG_Textbox(3), two AG_Button(3) widgets to increment and decrement the value, and optionally an AG_UCombo(3) for selecting units.
|AG_Object(3)-> AG_Widget(3)-> AG_Numerical.|
The AG_NumericalNew() function allocates, initializes, and attaches a new AG_Numerical widget. Acceptable flags include:
The unit argument is the name of the conversion unit that will be used by default (other conversion units in the same unit group will also be displayed in the unit selector). If unit is NULL, no conversion is done and the unit selector is not shown. See AG_Units(3) for more information.
The alternate constructor routines AG_NumericalNew<Type>() create a new widget bound to a variable of the specified type. AG_NumericalNew<Type>R() also accept explicit min and max arguments.
AG_NumericalSizeHint() requests that the initial geometry of the AG_Numerical widget be sufficient to display sizeHint in its entirety (see AG_SizeSpec(3)).
AG_NumericalSetUnitSystem() searches all unit groups for a unit of the given name and selects it as the active unit. Other units in the group will be displayed in the unit selector. If no such unit exists, the function returns -1.
AG_NumericalSelectUnit() searches only the current unit group and selects the unit of the given name as the active conversion unit.
The AG_NumericalSetPrecision() function selects the preferred style and precision for printing floating-point numbers. The default is %.2f.
AG_NumericalSetWriteable() enables of disables user modification sets the writeability flag, also accessible as the writeable member of the structure.
AG_Numerical widget generates the following events:
AG_Numerical widget provides the following bindings:
The value binding indicates the number to display. The min and max bindings allow a range to be specified. The inc binding specifies the increment effected by the widget's "+" and "-" buttons (if unit conversion is in use, inc should be of the same unit system as value).
The 64-bit types are only available if AG_HAVE_64BIT is defined. The long double type requires the AG_HAVE_LONG_DOUBLE be defined.
|AG_Button(3), AG_Intro(3), AG_Textbox(3), AG_Ucombo(3), AG_Units(3)|
|The AG_Numerical widget first appeared in Agar 1.2 as a replacement for AG_Spinbutton and AG_FSpinbutton that can handle both floating-point and integer values. As of Agar 1.5.0, support was added for 64-bit types and long double.|