+ (MUINumeric *) numeric

Default constructor

- (BOOL) checkAllSizes
- (IPTR) decrease:(LONG)amount

Decrease the value of a numeric class object.

- (OBString *) format

printf-style string to describe the format of the slider display.

Whenever a subclass of Numeric.mui thinks its time to render a new value, it doesn't simply write it to a string but instead calls MUIM_Numeric_Stringify. This method of Numeric class looks for the specified MUIA_Numeric_Format in its data structures and fills a string with the current value. In detail, things work like his:

- Some slider object (e.g. a knob) receives a MUIM_Draw method. - The MUIM_Draw implementation of the knob object reads the current value of the Numeric class and calls MUIM_Numeric_Stringify with this valuse. - MUIM_Numeric_Stringify of numeric class reads the current format and sprintf()s the given value to a buffer. The buffer is returned the caller. - After all this stuff, the MUIM_Draw implementation receives a nice string as result code and finally puts it somewhere into the window.

All this method stuff might sound a bit crazy, but in fact its quite powerful. If you write a subclass of any of MUI's slider classes which simply replaces MUIM_Numeric_Stringify with your own code, you can create any string you like for display in these sliders. You might e.g. want to display a nice formatted time string (hh:mm:ss) in a slider knob which adjusts a number of seconds. Or you need to adjust a baudrate from a hand of predefined values. Just overrided MUIM_Numeric_Stringify and you have the choice how the slider value translates into a string.

If you dont override MUIM_Numeric_Stringify, the method reaches Numeric class which simply does a sprintf() with the defined MUIA_Numeric_Format.

Note well: The maximum length of the result string for MUIA_Numeric_Format is limited to 32 characters. If you need more, you *must* override the method.

MUIA_Numeric_Format defaults to "%ld".

- (IPTR) increase:(LONG)amount

Increase the value of a numeric class object.

- (LONG) isDefault

Adjust the default value for a numeric input/display gadget. When the object receives a MUIM_Numeric_SetDefault method, it sets its value to the one given here.

Each type of slider can have a default value to which the user can always return immediately by some action depending on the implementation of the subclass. Knob.mui e.g. resets to defaults after a double click in the knob area.

The default value can also be reached by pressing the toggle key (usually SPACE) on an active numeric gadget.

MUIA_Numeric_Default defaults to 0.

- (LONG) max

Adjust the maximum value for a numeric input/display gadget.

Numeric class will automatically clip its value to make it fit between MUIA_Numeric_Min and MUI_Numeric_Max. Also, minimum and maximum values are used for several internal calculations such as the maximum space required to display a numeric value.

You may change MUIA_Numeric_Min and MUIA_Numeric_Max with SetAttrs(), but current MUI versions will *not* update the objects and with the windows width or height if your change causes the value display to change it's minimum and/or maximum pixel sizes. The slider position itself will be updated though.

MUI treats all values in numeric class as signed longwords, so that's the limit for all tags.

MUIA_Numeric_Max defaults to 100.

- (LONG) min

Adjust the minimum value for a numeric input/display gadget.

Numeric class will automatically clip its value to make it fit between MUIA_Numeric_Min and MUI_Numeric_Max. Also, minimum and maximum values are used for several internal calculations such as the maximum space required to display a numeric value.

You may change MUIA_Numeric_Min and MUIA_Numeric_Max with SetAttrs(), but current MUI versions will *not* update the objects and with the windows width or height if your change causes the value display to change it's minimum and/or maximum pixel sizes. The slider position itself will be updated though.

MUI treats all values in numeric class as signed longwords, so that's the limit for all tags.

MUIA_Numeric_Min defaults to 0.

- (void) noNotifySetCheckAllSizes:(BOOL)checkallsizes
- (void) noNotifySetFormat:(OBString *)format
- (void) noNotifySetIsDefault:(LONG)isdefault
- (void) noNotifySetMax:(LONG)max
- (void) noNotifySetMin:(LONG)min
- (void) noNotifySetRevLeftRight:(BOOL)revleftright
- (void) noNotifySetRevUpDown:(BOOL)revupdown
- (void) noNotifySetReverse:(BOOL)reverse
- (void) noNotifySetValue:(LONG)value
- (BOOL) revLeftRight

Reverse the function of left/right keys.

Under some circumstances it might be desirable to reverse the keyboard control for a slider gadget. This tag might help.

MUIA_Numeric_RevLeftRight defaults to FALSE.

- (BOOL) revUpDown

Reverse the function of up/down keys.

Under some circumstances it might be desirable to reverse the keyboard control for a slider gadget. This tag might help.

MUIA_Numeric_RevUpDown defaults to FALSE.

- (BOOL) reverse

Reverse the display of a numeric gadget.

When set to TRUE, the MUIM_Numeric_ScaleToValue and MUIM_Numeric_ValueToScale methods are effected in a way that makes your gadget behave "reverse". Its minimum numeric value will be mapped to the maximum scale value of the display and vice versa.

MUIA_Numeric_Reverse defaults to FALSE.

- (IPTR) scaleToValue:(LONG)scalemin scalemax:(LONG)scalemax scale:(LONG)scale

This method takes the given sale values and transforms them to something between the numeric objects min and max values.

RESULT The transformed value.

- (void) setCheckAllSizes:(BOOL)checkallsizes
- (IPTR) setDefault

This method does nothing but reset the value to its default. Defaults can be adjusted through MUIA_Numeric_Default.

Only implementors of custom slider classes will need this method. Sending it from applications doesnt make any sense.

- (void) setFormat:(OBString *)format
- (void) setIsDefault:(LONG)isdefault
- (void) setMax:(LONG)max
- (void) setMin:(LONG)min
- (void) setRevLeftRight:(BOOL)revleftright
- (void) setRevUpDown:(BOOL)revupdown
- (void) setReverse:(BOOL)reverse
- (void) setValue:(LONG)value
- (OBString *) stringify:(LONG)value

Call this method in your subclass whenever you want to translate a value into a string. A pointer to a string buffer is returned.

Only implementors of custom slider classes will need this method. Sending it from applications doesnt make any sense.

- (LONG) value

Adjust the current value for a numeric input/display gadget. Numeric class will automatically clip this value to make it fit between MUIA_Numeric_Min and MUI_Numeric_Max.

Whenever a new value is set, the object receices a new MUIM_Draw method to get a chance to update its display.

MUIA_Numeric_Default defaults to 0.

- (IPTR) valueToScale:(LONG)scalemin scalemax:(LONG)scalemax

This method takes the current value of the numeric object and transforms it to another scale determined by the parameters.

RESULT The transformed value.