A board (fl_tile_board) that lays its child panels out on a grid of equally sized cells.
Set the number of columns and rows with set_grid_size, then dock panels with
attach_panel, which positions and sizes them from the size the board has at that moment.
Derives from fl_base_panel.
Summary
Methods
Methods
Parents a panel to the board and docks it at a grid position.
Parameters
- panel Panel
- x Number optional, defaults to
1horizontal grid position - y Number optional, defaults to
1vertical grid position - w Number optional, defaults to
1width in grid cells - h Number optional, defaults to
1height in grid cells
Returns
- Map the docked entry { panel = Panel, pos = { x, y, w, h } }, or nil if it could not be positioned
Returns the size of the grid, either as a whole or for a single dimension.
Parameters
- dimension Boolean optional, defaults to
niltrue for the number of columns, false for rows, nil for both
Returns
- Number/Map the requested dimension, or the { x = columns, y = rows } table
Gives the board a grid of one cell and an empty list of docked panels of its own.
Moves and resizes a docked panel according to its grid position and the current size of the board.
Parameters
- obj Map docked entry of the form { panel = Panel, pos = { x, y, w, h } }
Returns
- Map the same entry, or nil if its panel is invalid or the grid size is not positive
Fills in the missing grid coordinates of a docked entry and repositions its panel. Coordinates the entry already has are kept; only those that are nil take the given values.
Parameters
- panel Map docked entry as returned by attach_panel, not the panel itself
- x Number horizontal grid position
- y Number vertical grid position
- w Number width in grid cells
- h Number height in grid cells
Returns
- Map the entry, or nil if it could not be positioned
Sets the number of columns and rows of the grid. Does nothing if x is not a number.
Parameters
- x Number columns
- y Number optional, defaults to
xrows
Twice a second, drops docked entries whose panel is no longer valid.