Skip to main content

Edit Box

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

PropertyDescription
TextThe current content displayed in the Edit Box.
Only DigitIf true, Edit Box will only accept input of digits, decimal points and minus signs and ignore other inputs.
Password CharAll the inputs will be replaced with corresponding characters when displayed.
Font ColorDisplay the font color of the control.
Hint TextHint text appears when the mouse hovers over the control.

Events

Callback NameCallback Function
on_get_focusGet focus callback by mouse clicks.
on_lost_focusLost mouse click focus callback.
on_enterThe callback called when Enter is hit.
on_changedThe 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