Skip to content

Columns


Members

catched

desc: Whether or not the members have already been calculate.

type: bool

default: false

columns

desc: A collection of the GridGUI.Columns where one or more GridGUI.Cells have been placed. That is only used columns are generated.

type: associative array

default: {}

meta: [object]

expanders

desc: A collection of the sum of horizontal GridGUI.Cell expansion weights of each GridGUI.Column in GridGUI.Columns.columns.

type: associative array

default: {}

meta: [object, cached]

expandersMaxValue

desc: A collection of the maximum horizontal GridGUI.Cell expansion weight of each GridGUI.Column in GridGUI.Columns.columns.

type: associative array

default: {}

meta: [object, cached]

fixedWidths

desc: A collection of the fixed width of each GridGUI.Column in GridGUI.Columns.columns.

type: associative array

default: {}

meta: [object, cached]

minWidths

desc: A collection of the min width of each GridGUI.Column in GridGUI.Columns.columns.

type: associative array

default: {}

meta: [object, cached]

nonExpanders

desc: A collection of the amount of horizontally fixed GridGUI.Cells in each GridGUI.Column in GridGUI.Columns.columns.

type: associative array

default: {}

meta: [object, cached]

Methods

__New

__New()

Constructor.

return value

desc: A new GridGUI.Columns instance.

type: GridGUI.Columns

__ResetConstants

__ResetConstants()

Resets the cached GridGUI.Columns members to their default values.

Add

Add(c)

Adds a GridGUI.Cell to the GridGUI.Columns that it spans over. If the GridGUI.Columns are not already in GridGUI.Columns.columns they are added before adding the cell.

parameters

name: c

desc: The GridGUI.Cell to add to the GridGUI.Columns.

type: GridGUI.Cell

CalculateConstants

CalculateConstants()

Calculates the values for the GridGUI.Columns members that are cached.

CalculateWidths

CalculateWidths(width, expandersW,, nonExpandersW,, height, expandersH, nonExpandersH)

Calculates the part of the available width that each GridGUI.Column in GridGUI.Columns.columns will get.

parameters

name: width

desc: The width of the grid. That is the width that the grid should fill.

type: number

name: expandersW,

desc: The member GridGUI.Columns.expanders

type: associative array

name: nonExpandersW,

desc: The member GridGUI.Columns.nonExpanders

type: associative array

name: height

desc: The unclaimed height of the grid. That is the height of the grid that is left after removing the height of the fixed cells.

type: number

name: expandersH

desc: The member GridGUI.Rows.expanders

type: associative array

name: nonExpandersH

desc: The member GridGUI.Rows.nonExpanders

type: associative array

return value

desc: The calculated widths of the GridGUI.Columns in GridGUI.Columns.columns.

type: associative array

GetFixedWidth

GetFixedWidth()

Returns the sum of the fixed widths of the GridGUI.Columns in GridGUI.Columns.columns.

return value

desc: The sum of the fixed widths of the GridGUI.Columns in GridGUI.Columns.columns.

type: number

GetMinWidth

GetMinWidth()

Returns the sum of the minimal widths of the GridGUI.Columns in GridGUI.Columns.columns.

return value

desc: The sum of the minimal widths of the GridGUI.Columns in GridGUI.Columns.columns.

type: number

ReduceToGuiSize

ReduceToGuiSize(widths, expandedWidths, sumExpandedWidths, excessWidth)

Fixes miscalculations in the width of expanding GridGUI.Cells by reducing their width down until they all fit in the available width or all have reach their min width. The reduction is done starting with the widest GridGUI.Column to the thinnest.

parameters

name: widths

desc: The calculated widths for the GridGUI.Columns in GridGUI.Columns.columns.

type: associative array

name: expandedWidths

desc: An array of the widths of GridGUI.Columns with one or more horizontally expanding GridGUI.Cell if the current width in widths corresponding to the column is larger than the minimum of the column otherwise it wont be included in the expandedWidths

type: array

name: sumExpandedWidths

desc: The sum of the widths in expandedWidths.

type: number

name: excessWidth

desc: The amount of width that the sum of widths would exceed the width of the grid/gui.

type: number

Remove

Remove(c)

Removes a GridGUI.Cell from the GridGUI.Columns that it spans over. If the GridGUI.Columns are empty after removing the cell the column will be removed as well.

parameters

name: c

desc: The GridGUI.Cell to remove from the GridGUI.Columns.

type: GridGUI.Cell

Back to top