Derived from: none
Declared in: NumericTextFieldUtilities.h
Library: none
Provides functions to facitilate use of BTextView for integers and floating point numbers (floating point numbers are converted to fixed point).
int32 CheckIntegralValue(BTextControl* field, int32 min, int32 max) int32 CheckIntegralFloatValue(BTextControl* text_control, int32 min, int32 max, int8 digits_after_decimal, BSlider* slider_partner = NULL)
Returns the numeric content of the text control, checking it for being a valid number, checking against min, max, and changing the text in the BTextControl if necessary to ensure legality and that the number is in range. If the number was out of range, it returns the value that the number is limited to. For CheckIntegralFloatValue, if a slider_partner is specified, the slider's value is set to match the floating point value. CheckIntegralFloatValue returns the integral value representing the float. If digits_after_decimal is 2, then a value of 1.00 will return an integral value of 100. If digits_after_decimal is 3, then a value of 1.000 returns an integral value of 1000.
int32 SetIntegralFloatValueFromSlider(BTextControl* text_control, int8 digits_after_decimal, BSlider* slider_partner)
Sets the value of text_control to match slider_partner, converting to floating point ascii from the fixed point slider value. For example, if the slider value is 100 and digits_after_decimal is 2, then the text_control is set to 1.00. Returns the integral value representing the float.
By Brian Tietz
Copyright 2000
Bug reports (including documentation errors) and feature requests can be sent to briant@timelinevista.com.