This is a simple text-edit control, that can be popped up by itself, not in a window.
It can be used to change a single numerical value. When the user presses enter, or this widget loses focus for any other reason, then the field sends a message with the new value and destroys itself.
#include
<class_numerical_input_widget_1_1_numerical_input_widget.h>
Public Member Functions |
|
__init__ () | |
parentWindow: The window this edit field is
appearing over initialString: The float value that should be
showing in the edit field when it appears position: (x,y) relative
to its parent window size: (x,y) messageToSend: the name of the
application message that will be sent when the user presses ENTER
data: a callable function that will take the value and return valid
message data for the given message. |
|
getFloatValue () | |
Returns the field value as a float. |
|
OnCancelIfEscape () | |
The escape key is interpreted as cancel.
|
|
OnKillFocus () |
NumericalInputWidget.NumericalInputWidget.__init__ | ( | ) |
parentWindow: The window this edit field is appearing over initialString: The float value that should be showing in the edit field when it appears position: (x,y) relative to its parent window size: (x,y) messageToSend: the name of the application message that will be sent when the user presses ENTER data: a callable function that will take the value and return valid message data for the given message.
For instance, createRotateMsgData = \ lambda angle : (angle, True, (0,0,0), (0,0,1), ()) will return a tuple that can be sent as message data for a ROTATE message. supportUnitConversion: allow user to enter unit information such as 1cm, 1ft etc. lengthUnit: convert input to this unit if supportUnitConversion is True
Reimplemented from RenameWidget.RenameWidget.
NumericalInputWidget.NumericalInputWidget.getFloatValue | ( | ) |
Returns the field value as a float.
Throws an exception if there was a problem converting the field's contents to a float value(in the case that units are not supported).
NumericalInputWidget.NumericalInputWidget.OnCancelIfEscape | ( | ) |
The escape key is interpreted as cancel.
Reimplemented from RenameWidget.RenameWidget.
NumericalInputWidget.NumericalInputWidget.OnKillFocus | ( | ) |
Reimplemented from RenameWidget.RenameWidget.