EditBoxΒΆ

class EditBox

An edit box window. This window receives text input and notifies edit changes by calling the editchanged method.

Hierarchy

class EditBox < class Window

Members

Methods:

nil editchanged ( ) The editchanged method is called when the edit box text is changed (that is, after the edit lost focus or the return key was hit.)
nil editupdated ( string text ) The editupdated method is called whenever the edit box text is changed (at every keystroke.)
the Edit getedit ( ) Returns the edit window withing the editbox
nil settext ( string text ) Change the content of the edit box


Inherited from class Window

Methods:

nil destroy ( ) Destroy the window and all its children windows
nil setx ( number x , number parentpivot , number pivot ) Set the X window placement
nil sety ( number y , number parentpivot , number pivot ) Set the Y window placement
nil setw ( number w , number parentmul , number childadd , number childmul ) Set the window width
nil seth ( number h , number parentmul , number childadd , number childmul ) Set the window height
nil getx ( ) Get the window X coordinate in the parent space
nil gety ( ) Get the window Y coordinate in the parent space
nil getw ( ) Get the window width
nil geth ( ) Get the window height
nil hide ( ) Hide the window
nil show ( ) Show the window
nil disable ( ) Disable the window
nil enable ( ) Enable the window
string path getnodepath ( ) Returns the edited node path (is nil if the method is not supported)
nil setnodepath ( string path )
nil addtracker ( table tracker ) Add a tracker to this window. A tracker receives notification when the tracked window is invalidated or destroyed. A tracker may implement onTrackedDestroyed and onTrackedInvalidated to get notifications on such events
nil removetracker ( table tracker ) Remove a tracker of this window.
nil setcolor ( ui.color color ) Change the window color, see also ui.color function
nil getparent ( string|nil parentclass ) Get the first parent window of given class (immediate parent if no class is provided)
nil settopmost ( ) Set the window as top most in children order
nil getchild ( string|number name ) Get a child window
Window container getcontainer ( ) Get the main container of a window
nil settitle ( string name ) Change the window title
nil setfocus ( ) Set the focus to the window
nil getroot ( ) Return the root window of this window

Documentation

nil editchanged ( )

The editchanged method is called when the edit box text is changed (that is, after the edit lost focus or the return key was hit.)


nil editupdated ( string text )

The editupdated method is called whenever the edit box text is changed (at every keystroke.)

This method is a callback to implemented if you want the EditBox to react to user changing the content of the edit.

local myedit = ui.editbox ("myedit", parent)
myedit:setx (0)
myedit:sety (0)
myedit:setw (0, 1)
myedit:seth (20)
function myedit:editchanged (text)
    print ("myedit has changed: new text is " .. text)
end
Arguments:

  • text The new edit box text


the Edit getedit ( )

Returns the edit window withing the editbox

Return:


nil settext ( string text )

Change the content of the edit box

Arguments:

  • text The new content of the edit box