AG_Numerical * AG_NumericalNew (AG_Widget *parent, Uint flags, const char *unit, const char *format, ...)
AG_Numerical * AG_NumericalNewS (AG_Widget *parent, Uint flags, const char *unit, const char *label)
AG_Numerical * AG_NumericalNew{Flt,Dbl,Ldbl,Int,Uint} (AG_Widget *parent, Uint flags, const char *unit, const char *label, <Type> *value)
AG_Numerical * AG_NumericalNew{Flt,Dbl,Ldbl,Int,Uint}R (AG_Widget *parent, Uint flags, const char *unit, const char *label, <Type> *value, <Type> min, <Type> max)
void AG_NumericalSizeHint (AG_Numerical *num, const char *sizeHint)
int AG_NumericalSetUnitSystem (AG_Numerical *num, const char *unit)
void AG_NumericalSelectUnit (AG_Numerical *num, const char *unit)
void AG_NumericalSetPrecision (AG_Numerical *num, const char *fmt, int precision)
void AG_NumericalSetWriteable (AG_Numerical *num, int writeable)
|
The
AG_NumericalNew() function allocates, initializes, and attaches a new
AG_Numerical widget.
Acceptable
flags include:
AG_NUMERICAL_INT | If no "value" binding has been set when the widget is first shown,
use a built-in variable of type
int (by default, a built-in
double is used).
| AG_NUMERICAL_EXCL | No external changes to the
value binding are to be expected and
AG_Numerical can perform optimizations based on the assumption of exclusive access
(by default, the value is checked periodically and the widget is redrawn
if a change is detected).
| AG_NUMERICAL_SLOW | In non-EXCL case, check value every 2 seconds instead of the default
of 250ms.
| AG_NUMERICAL_HFILL | Expand horizontally in parent container.
| AG_NUMERICAL_VFILL | Expand vertically in parent container.
| AG_NUMERICAL_EXPAND | Shorthand for
AG_NUMERICAL_HFILL AG_NUMERICAL_VFILL|. |
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.
|