Float Edit Boxes
Overview
Float Edit is to receive user input, mainly for processing and receiving numeric types. Especially when dealing with floating point numbers, the Float Edit will not receive input other than numbers.
Focus can be got by clicking the Edit Box and there will be a cursor flashing in the Edit Bar at this time. The Edit Box can only get user input after getting the focus. Clicking other areas outside the Edit Box will make it fail to obtain user input because of losing focus.
- Get Focus
- Lost Focus
Properties
Property | Description |
---|---|
Text | The current content displayed in the Edit Box. |
Font Color | Display the font color of the control. |
Hint Text | Hint text appears when the mouse hovers over the control. |
Format | Set the precision of the floating point number. |
Events
Callback Name | Callback Function |
---|---|
on_get_focus | Get focus callback by mouse clicks. |
on_lost_focus | Lost mouse click focus callback. |
on_changed | The callback called when the input content is changed. |
on_enter | The callback called when the Enter key is hit. |
Lua Script Example
self.Text = "Edit"
self.Format = "%.5f"
function on_float_edit_enter(self)
local str=nx_string(self.Text)
nx_msgbox(str)
end