#include <NumericField.h>
Inherits TextField.
Inheritance diagram for NumericField:


Public Methods | |
| NumericField (int i=0) | |
| Default constructor. More... | |
| void | setValue (double v) |
| Sets the numeric value of the field. More... | |
| double | asDouble () |
| Returns the numeric value as double. | |
| float | asFloat () |
| Returns the numeric value as float. | |
| int | asInt () |
| Returns the numeric value as int. | |
| void | setFormat (unsigned short f0, unsigned short f1) |
| Set the format of the numeric value. | |
| void | checkInput () |
| Checkes the current input. More... | |
| void | parseSymbol (Token &t, ObjectFile &file) |
| Reads a single parameter sections inside the body of the object description. More... | |
| void | writeParams (ostream &stream) |
| Writes all parameter sections inside the body of the object description. More... | |
Protected Methods | |
| void | createSymbols () |
| Creates all parameter symbols that are used within the body of the object description. | |
Protected Attributes | |
| double | value |
| The current numeric value displayed. | |
| unsigned short | format0 |
| The number of digits displayed before '.'. | |
| unsigned short | format1 |
| The number of digits displayed after '.'. | |
Used to edit a numeric value. The numeric value is displayed as "%<format0>.<format1>f" where format0 is the number of digits before the '.' and format1 the number of digits after '.'.
Events:
PARAM ::= VALUE | NUMERIC_FORMAT
VALUE :== "value" <double>
NUMERIC_FORMAT :== "format" <unsigned int> <unsigned int>
|
|
Default constructor. Constructs a new NumericField with id 'i'. The id must be unique in the current scope.
|
|
|
Checkes the current input. Called when the text value is modified. This method is to be used by sub-classes of TextField to verify the input.
Reimplemented from TextField. |
|
||||||||||||
|
Reads a single parameter sections inside the body of the object description. Each object has a set of parameter names associated with it, called symbols. Symbols are declared inside the createSymbols method. The method parseSymbol expects the Token t to be such a symbol and reads the corresponding parameters. Unknown symbols are passed to its super class.
Reimplemented from TextField. |
|
|
Sets the numeric value of the field. Formats the value v as "%<format0>.<format1>f" and set the text value.
|
|
|
Writes all parameter sections inside the body of the object description. This method writes all object parameters to ostream. Inhereting classes will always call super::writeParams().
Reimplemented from TextField. |