Numeric.mui Class Reference

BOOPSI custom class Numeric.mui (MUI 3.8 dev). Each ### sub-section below documents one of the class's attributes or methods. Sub-classes of Numeric.mui are listed at the end under Sub-classes; the class hierarchy itself is documented in the MUI classes index.

Function index

Class definition

Attributes

Methods


Numeric.mui


MUIA_Numeric_CheckAllSizes

MUIA_Numeric_CheckAllSizes -- (V11) [ISG], BOOL

Function

yet undocumented, please complain in mailing list :)


MUIA_Numeric_Default

MUIA_Numeric_Default -- (V11) [ISG], LONG

Function

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.

See also

MUIA_Numeric_Max, MUIA_Numeric_Value, MUIA_Numeric_Min, MUIM_Numeric_SetDefault


MUIA_Numeric_Format

MUIA_Numeric_Format -- (V11) [ISG], STRPTR

Function

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".

See also

MUIA_Numeric_Max, MUIA_Numeric_Value, MUIA_Numeric_Min, MUIM_Numeric_Stringify, MUIM_Numeric_StringifyValue


MUIA_Numeric_Max

MUIA_Numeric_Max -- (V11) [ISG], LONG

Function

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.

Notes

This attribute replaces the MUIA_Slider_Max tag of previous MUI releases. For compatibility reasons, both have the same hex value. Nevertheless, always use MUIA_Numeric_Max in new code.

See also

MUIA_Numeric_Min, MUIA_Numeric_Value, MUIA_Numeric_Default, MUIM_Numeric_GetPixelSize, MUIM_Numeric_ValueToScale, MUIM_Numeric_ScaleToValue


MUIA_Numeric_Min

MUIA_Numeric_Min -- (V11) [ISG], LONG

Function

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.

Notes

This attribute replaces the MUIA_Slider_Min tag of previous MUI releases. For compatibility reasons, both have the same hex value. Nevertheless, always use MUIA_Numeric_Min in new code.

See also

MUIA_Numeric_Max, MUIA_Numeric_Value, MUIA_Numeric_Default, MUIM_Numeric_GetPixelSize, MUIM_Numeric_ValueToScale, MUIM_Numeric_ScaleToValue


MUIA_Numeric_Reverse

MUIA_Numeric_Reverse -- (V11) [ISG], BOOL

Function

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.

Notes

This attribute replaces the MUIA_Slider_Reverse tag of previous MUI releases. For compatibility reasons, both have the same hex value. Nevertheless, always use MUIA_Numeric_Reverse in new code.

See also

MUIA_Numeric_Max, MUIA_Numeric_Value, MUIA_Numeric_Default, MUIM_Numeric_ValueToScale, MUIM_Numeric_ScaleToValue


MUIA_Numeric_RevLeftRight

MUIA_Numeric_RevLeftRight -- (V11) [ISG], BOOL

Function

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.

See also

MUIA_Numeric_Max, MUIA_Numeric_Value, MUIA_Numeric_Default, MUIA_Numeric_Reverse, MUIA_Numeric_RevUpDown


MUIA_Numeric_RevUpDown

MUIA_Numeric_RevUpDown -- (V11) [ISG], BOOL

Function

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.

See also

MUIA_Numeric_Max, MUIA_Numeric_Value, MUIA_Numeric_Default, MUIA_Numeric_Reverse, MUIA_Numeric_RevUpDown


MUIA_Numeric_Value

MUIA_Numeric_Value -- (V11) [ISG], LONG

Function

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.

Notes

This attribute replaces the MUIA_Slider_Level tag of previous MUI releases. For compatibility reasons, both have the same hex value. Nevertheless, always use MUIA_Numeric_Value in new code.

See also

MUIA_Numeric_Min, MUIA_Numeric_Max, MUIA_Numeric_Default, MUIM_Numeric_Stringify


MUIM_Numeric_Decrease

MUIM_Numeric_Decrease (V11) — SYNOPSIS — DoMethod(obj,MUIM_Numeric_Decrease,LONG amount);

Function

Decrease the value of a numeric class object.

See also

MUIM_Numeric_Increase, MUIA_Numeric_Value


MUIM_Numeric_Increase

MUIM_Numeric_Increase (V11) — SYNOPSIS — DoMethod(obj,MUIM_Numeric_Increase,LONG amount);

Function

Increase the value of a numeric class object.

See also

MUIM_Numeric_Decrease, MUIA_Numeric_Value


MUIM_Numeric_ScaleToValue

MUIM_Numeric_ScaleToValue (V11) — SYNOPSIS — DoMethod(obj,MUIM_Numeric_ScaleToValue,LONG scalemin, LONG scalemax, LONG scale);

Function

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

Result

The transformed value.


MUIM_Numeric_SetDefault

MUIM_Numeric_SetDefault (V11) — SYNOPSIS — DoMethod(obj,MUIM_Numeric_SetDefault);

Function

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.

See also

MUIA_Numeric_Value, MUIA_Numeric_Default


MUIM_Numeric_Stringify

MUIM_Numeric_Stringify (V11) — SYNOPSIS — DoMethod(obj,MUIM_Numeric_Stringify,LONG value);

Function

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.

Example

... somewhere in your Draw method ...
get(obj,MUIA_Numeric_Value,&val);
buf = DoMethod(obj,MUIM_Numeric_Stringify,val);
Text(rp,buf,strlen(buf));

See also

MUIA_Numeric_Value, MUIA_Numeric_Format


MUIM_Numeric_ValueToScale

MUIM_Numeric_ValueToScale (V11) — SYNOPSIS — DoMethod(obj,MUIM_Numeric_ValueToScale,LONG scalemin, LONG scalemax);

Function

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

Result

The transformed value.