Edit Boxes
Overview
Edit Box allows the users to input and display the corresponding content, which is generally used to process the input of normal strings and integers.
Click on Edit Box to get the focus, 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. Click 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. |
Only Digit | If true, Edit Box will only accept input of digits, decimal points and minus signs and ignore other inputs. |
Password Char | All the inputs will be replaced with corresponding characters when displayed. |
Font Color | Display the font color of the control. |
Hint Text | Hint text appears when the mouse hovers over the control. |
Events
Callback Name | Callback Function |
---|---|
on_get_focus | Get focus callback by mouse clicks. |
on_lost_focus | Lost mouse click focus callback. |
on_enter | The callback called when Enter is hit. |
on_changed | The callback called when the input content is changed. |
Lua Script Example
self.Text = "Edit"
self.OnlyDigit = false
--Output the contents inside the Editor when they are changed
function on_edit_enter(self)
local str=nx_string(self.Text)
nx_msgbox(str)
end