<--- Cannot embed stylesheet: [Errno 2] No such file or directory: '../../../../aros.css' --->

Numeric.mui

MUIA_Numeric_CheckAllSizes

Function

Store a size-checking policy flag. Default FALSE.

Inputs

BOOL; initialize, set and get.

Notes

Getter normalizes to TRUE/FALSE. Numeric itself does not consume the
flag for size calculation. The AROS Slider implementation scans its
selected range regardless of this flag; changing it alone does not
request relayout.

MUIA_Numeric_Default

Function

Store the value used by SetDefault and by construction without explicit
Value. Default zero.

Inputs

LONG; initialize, set and get.

Notes

Stored without clamping; SetDefault clamps when applying it. Setting
Default alone does not change Value. Getter can therefore return a value
outside current bounds.

MUIA_Numeric_Format

Function

Choose the snprintf format used by Stringify. Default %ld.

Inputs

Borrowed string pointer; initialize, set and get.

Notes

Supply a non-NULL valid format accepting exactly the supplied long
argument, such as %ld. The string is not copied or freed. A changed
pointer requests parent relayout and redraw; in-place edits do not.
Getter returns the borrowed pointer. Formatting is bounded, but
incompatible conversions or missing arguments are not validated.

MUIA_Numeric_Max

Function

Store the upper bound. Default 100.

Inputs

LONG; initialize, set and get.

Notes

Keep Min <= Max. Construction clamps Value after parsing all tags;
runtime setting clamps immediately at this tag. Changed bounds request
parent relayout and redraw, but do not directly invoke a subclass size
calculator. Getter returns stored bound; no range-error status exists.

MUIA_Numeric_Min

Function

Store the lower bound. Default zero.

Inputs

LONG; initialize, set and get.

Notes

Keep Min <= Max. Construction clamps Value after parsing all tags;
runtime setting clamps immediately at this tag. Changed bounds request
parent relayout and redraw, but do not directly invoke a subclass size
calculator. Getter returns stored bound; no range-error status exists.

MUIA_Numeric_RevLeftRight

Function

Reverse the horizontal branch of Numeric key handling. Default FALSE.

Inputs

BOOL; initialize, set and get.

Notes

Combines with Reverse, so two reversals cancel. Left/Right and endpoint
keys use the horizontal branch; Up/Down, page and word keys use the
vertical branch. Wheel handling ignores these axis flags. Scale methods
also ignore them. Getter returns normalized state; setting alone does
not redraw.

MUIA_Numeric_RevUpDown

Function

Reverse the vertical branch of Numeric key handling. Default FALSE.

Inputs

BOOL; initialize, set and get.

Notes

Combines with Reverse, so two reversals cancel. Left/Right and endpoint
keys use the horizontal branch; Up/Down, page and word keys use the
vertical branch. Wheel handling ignores these axis flags. Scale methods
also ignore them. Getter returns normalized state; setting alone does
not redraw.

MUIA_Numeric_Reverse

Function

Reverse scale mapping and Numeric input direction. Default FALSE.

Inputs

BOOL; initialize, set and get.

Notes

Getter normalizes the flag. Direct Increase/Decrease retain their
arithmetic meaning. Reversal alone does not redraw or invalidate Slider
cached position; arrange a subsequent valid redraw/recalculation when
changing it live.

MUIA_Numeric_Value

Function

Store the current value, clamped to the current Min/Max.

Inputs

LONG; initialize, set and get.

Notes

Construction defaults to Default. Runtime setter rewrites the tag to its
clamp result, or TAG_IGNORE when unchanged. Tag storage must be
writable. Bound changes clamp internally without synthesizing a Value
tag. Getter returns stored state; arithmetic and inverted bounds are not
validated.

MUIC_Numeric

Superclass

Area.mui

Description

Maintain a signed LONG value, bounds, default and formatting policy for
numeric subclasses. Defaults are Min zero, Max 100, Default zero, Format
%ld and all flags FALSE. Construction uses the explicit Value or
Default, clamped after all initialization tags. Keep Min no greater than
Max and all arithmetic representable; inverted bounds and signed
overflow are not rejected.
Format is borrowed; keep it valid until replacement or disposal.
Stringify returns a per-instance buffer overwritten by the next call.
Numeric owns no separately allocated formatter string.

Methods

Setup calls Area then registers a raw-key handler; Cleanup removes it
before Area Cleanup. Keyboard arrows change by one, page/word keys by
ten (one when the range span is below ten), endpoint keys select bounds,
Toggle selects Default, and Press/Release are consumed. Reverse and axis
reversal flags affect direction. WordLeft/WordRight use the vertical
reversal branch in this implementation. Wheel up/down inside the object
change by one and consult only Reverse. HandleEvent does not delegate to
Area; when muikey is NONE it dereferences imsg without a NULL check.
Export stores one LONG under nonzero ObjectID; Import reads a matching
LONG without checking stored length and invokes the ordinary Value
setter. Both return zero, ignore delegated results and do not call Area
serialization.

Notes

The setter processes tags in order. Each bound change immediately clamps
Value; a later bound can therefore change the effect of earlier Value
tags. Value tags are rewritten to the clamped value, or TAG_IGNORE if
unchanged. A value change caused only by Min/Max does not synthesize a
Value notification.
Changed Min, Max or Format pointer requests parent Group
InitChange/ExitChange before superclass setting, then redraws. Mutating
a format string in place does not change that pointer. CheckAllSizes and
reversal changes alone do not request redraw or parent relayout. Numeric
stores CheckAllSizes but does not calculate rendered sizes itself.

MUIM_Numeric_Decrease

Synopsis

IPTR result = DoMethod(obj, MUIM_Numeric_Decrease, amount);

Function

Compute Value - amount, clamp to Min/Max and set Value if changed.

Inputs

amount - LONG; signed arithmetic must remain representable.

Result

Always one; setter status is ignored.

Notes

Negative amounts reverse the arithmetic direction. Reverse flags do not
alter this method. Ordinary Value notifications remain enabled. Overflow
happens before clamping and is not prevented by it.

MUIM_Numeric_Increase

Synopsis

IPTR result = DoMethod(obj, MUIM_Numeric_Increase, amount);

Function

Compute Value + amount, clamp to Min/Max and set Value if changed.

Inputs

amount - LONG; signed arithmetic must remain representable.

Result

Always one; setter status is ignored.

Notes

Negative amounts reverse the arithmetic direction. Reverse flags do not
alter this method. Ordinary Value notifications remain enabled. Overflow
happens before clamping and is not prevented by it.

MUIM_Numeric_ScaleToValue

Synopsis

IPTR result = DoMethod(obj, MUIM_Numeric_ScaleToValue, scalemin,
scalemax, scale);

Function

Calculate a numeric value from an external scale, swapping numeric
endpoints when Reverse is set.

Inputs

scalemin, scalemax, scale - LONG values. Use ordered endpoints and
representable differences/products.

Result

Calculated LONG carried as IPTR; Value is not changed.

Notes

The implementation clamps (scale - scalemin) between scalemin and
scalemax, then multiplies by the numeric span, divides by the scale span
when nonzero, and adds the numeric start. This is not a correct general
normalization for nonzero scalemin; a zero-based scale avoids that
particular defect. A zero scale span skips division, not the other
arithmetic. There is no final numeric clamp or overflow protection.

MUIM_Numeric_SetDefault

Synopsis

IPTR result = DoMethod(obj, MUIM_Numeric_SetDefault);

Function

Apply Default through the ordinary Value setter after clamping to
Min/Max.

Inputs

No arguments beyond MethodID. Valid ordered bounds required.

Result

Always zero; setter result is ignored.

Notes

Notifications follow Value setter behavior, including suppression when
unchanged. Default itself remains unclamped.

MUIM_Numeric_Stringify

Synopsis

IPTR result = DoMethod(obj, MUIM_Numeric_Stringify, value);

Function

Format the supplied value using Format into a per-instance character
buffer.

Inputs

value - LONG; not clamped to Numeric bounds. Format must accept the
single long argument.

Result

Borrowed string pointer, returned as IPTR.

Notes

snprintf receives size 49, so at most 48 output characters plus
terminator are produced; byte 49 is also cleared. Formatting status is
ignored. Copy before another Stringify on the same object, and before
disposal. Do not free the returned pointer. Subclasses may override this
conversion.

MUIM_Numeric_ValueToScale

Synopsis

IPTR result = DoMethod(obj, MUIM_Numeric_ValueToScale, scalemin,
scalemax);

Function

Map the stored Value to an external scale without changing Value.

Inputs

scalemin, scalemax - Ordered LONG output bounds; differences/products
must be representable.

Result

Calculated scale position, clamped to the supplied scale bounds.

Notes

Reverse swaps output endpoints. For nonzero numeric span, calculation
adds half the numeric span before integer division; reversed/negative
cases are not guaranteed symmetric rounding. Equal numeric bounds return
the selected starting endpoint. No overflow checking. Use
ValueToScaleExt to map a value other than stored Value.

MUIM_Numeric_ValueToScaleExt

Synopsis

IPTR result = DoMethod(obj, MUIM_Numeric_ValueToScaleExt, value,
scalemin, scalemax);

Function

Map an explicit value to an external scale without changing Value.

Inputs

value - LONG, clamped to Numeric bounds.
scalemin, scalemax - Ordered LONG output bounds; differences/products
must be representable.

Result

Calculated scale position, clamped to the supplied scale bounds.

Notes

Reverse swaps output endpoints. For nonzero numeric span, calculation
adds half the numeric span before integer division; reversed/negative
cases are not guaranteed symmetric rounding. Equal numeric bounds return
the selected starting endpoint. No overflow checking. This is the public
Zune extension declared in numeric.h.