RichEdit
RichEdit is to receive users' input and supports multi-line editing and a part of HTML syntax.
Users should click the RichEdit to get focus (a typing cursor will flash in the editing bar) before typing. Click areas outside the RichEdit will make it fail to obtain users' input because of losing focus.
- Get Focus
- Lose Focus
The HTML code of the pictures above are as follows:
<font style="color:#8431bb">123</font>
<br/>
<font style="color:#567890">456</font>
Properties
Property | Description |
---|---|
Text | Content shown in the current RichEdit. |
Font Color | Show the font color of the control. |
Hint Text | Show hint text when the mouse is over the control. |
Support HTML | Whether the control supports HTML parsing. |
Events
Callback Name | Callback Function |
---|---|
on_get_focus | The callback to get focus by clicking. |
on_lost_focus | The callback to lose focus by clicking. |
on_changed | The callback when the input content changes. |
on_enter | The callback when pressing the Enter key. |
Lua Script Example
self.Text = "Edit"
self.AlwaysVScroll = true
function on_rich_edit_enter(self)
local str=nx_string(self.Text)
nx_msgbox(str)
end