Skip to content
Benedict Allen edited this page Nov 15, 2015 · 3 revisions

IChildContainer interface

The IChildContainer implements child management methods and is used by Screen and Sheet.

Constructor

IChildContainer:IChildContainer()

Operator Overloads

__add

Sheet X = IChildContainer + Sheet X

Alias for addChild(). Adds a Sheet to the object and returns it.

__concat

IChildContainer = IChildContainer .. Sheet X

Adds a Sheet to the object and returns the object. Due to this, it is chainable:

object = object .. Sheet( ... ) .. Sheet( ... )

Methods

addChild()

child = IChildContainer:addChild( Sheet child )

Adds and returns a child.

removeChild()

child = IChildContainer:removeChild( Sheet child )

Removes a child. Will return nil if the child was not present to begin with.

getChildren()

table children = IChildContainer:getChildren()

Returns a list of the children of the object.

getChildById()

Sheet child = IChildContainer:getChildById( string id )

Returns the child found with the given id, or nil if not present.

getChildrenWithId()

table children = IChildContainer:getChildrenWithId( string id )

Returns a table of all the children with the given id.

getChildrenAt()

table children = IChildContainer:getChildrenAt( number x, number y )

Returns a list of children at the given coordinates (using a mouse_ping event to test).

isChildVisible()

boolean visible = IChildContainer:isChildVisible( Sheet child )

Returns whether the child is visible based on its location and size.

repositionChildZIndex()

IChildContainer:repositionChildZIndex( Sheet child )

Used internally when a child's Z changes. Re-calculates the child's position in the children table.

Clone this wiki locally