Skip to content

SubGrid


Members

DPIScale

desc: Whether or not to change the size of controls based on DPI. Needed since a subgrid does not make its own gui to handle the gui options.

type: bool

meta: [const]

hwnd

desc: The hwnd of the gui that the GridGUI.SubGrid adds controls to when calling GridGUI.GridGUIClass.Add and GridGUI.GridGUIClass.AddControl. Needed since a subgrid does not make its own gui.

type: hwnd

minHeight

desc: Whether or not to restrict the min height of the subgrid to GridGUI.SubGrid.minHeightVal. Needed in providing the interface required to be managed by a GridGUI.Cell instance.

type: bool

default: false

minHeightVal

desc: The min height of the GridGUI.SubGrid. Needed in providing the interface required to be managed by a GridGUI.Cell instance.

type: number

default: 0

minWidth

desc: Whether or not to restrict the min width of the subgrid to GridGUI.SubGrid.minWidthVal. Needed in providing the interface required to be managed by a GridGUI.Cell instance.

type: bool

default: false

minWidthVal

desc: The min width of the GridGUI.SubGrid. Needed in providing the interface required to be managed by a GridGUI.Cell instance.

type: number

default: 0

pos

desc: The position of the subgrid. Needed since a subgrid does not make its own gui and thus do not have the gui event callbacks.

type: GridGUI.Position

default: GridGUI.Position(0, 0, 0, 0)

meta: [object]

Methods

__Init

__Init(area)

Sets the min size of the subgrid and initialises the members that are required when managed by a GridGUI.Cell instance.

parameters

name: area

desc: The minimum area that the subgrid will have.

type: GridGUI.Position

__New

__New(guiHwnd, area := false, DPIScale := true, showGrid := false, justify := false)

Constructor.

parameters

name: guiHwnd

desc: The hwnd of the gui that the GridGUI.SubGrid adds controls to when calling GridGUI.GridGUIClass.Add and GridGUI.GridGUIClass.AddControl. Needed since a subgrid does not make its own gui.

type: hwnd

name: area

desc: The minimum area that the subgrid will have.

type: GridGUI.Position|bool

default: false

name: DPIScale

desc: Whether or not to change the size of controls based on DPI. Needed since a subgrid does not make its own gui to handle the gui options.

type: bool

default: true

name: showGrid

desc: Whether or not to show a debug grid for the GridGUI.Cells that where placed in the GridGUI.SubGrid.grid](../SubGrid/#grid) before [GridGUI.SubGrid.Draw` was called the first time.

type: bool

default: false

name: justify

desc: The position of the controls with in the grid, can be any combination of C (Center), N (North), S (South), W (West) and E (East).

type: string|false

default: false

return value

desc: Returns a new instance of GridGUI.SubGrid.

type: GridGUI.SubGrid

Draw

Draw(area)

Stores the area in GridGUI.SubGrid.pos and calculates the new positions of the controls in the subgrid based on the settings of their GridGUI.Cell and moved them to their new positions.

parameters

name: area

desc: The area that the controls in the grid will be sized to fit into if possible.

type: GridGUI.Position

GetPos

GetPos()

Retrieves the position of the subgrid. Needed in providing the interface required to be managed by a GridGUI.Cell instance.

return value

desc: The last position that GridGUI.SubGrid.Draw was called with.

type: GridGUI.Position

MinSize

MinSize(w, h)

Sets the minimum size of the subgrid. The min size is used by a GridGUI.Cell to determin the cells size.

parameters

name: w

desc: The minimal width of the subgrid, if left empty the current min width won't be changed unless both parameters are left empty in which case the min width will be set to the current width of the subgrid.

type: number|""

name: h

desc: The minimal height of the subgrid, if left empty the current min height won't be changed unless both parameters are left empty in which case the min height will be set to the current height of the subgrid.

type: number|""

Back to top