libui-ng
A portable GUI library for C
uiGrid Struct Reference

A control container to arrange containing controls in a grid. More...

#include <ui.h>

Inheritance diagram for uiGrid:
uiControl

Public Member Functions

void uiGridAppend (uiGrid *g, uiControl *c, int left, int top, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)
 Appends a control to the grid. More...
 
void uiGridInsertAt (uiGrid *g, uiControl *c, uiControl *existing, uiAt at, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)
 Inserts a control positioned in relation to another control within the grid. More...
 
int uiGridPadded (uiGrid *g)
 Returns whether or not controls within the grid are padded. More...
 
void uiGridSetPadded (uiGrid *g, int padded)
 Sets whether or not controls within the grid are padded. More...
 
uiGriduiNewGrid (void)
 Creates a new grid. More...
 
- Public Member Functions inherited from uiControl
void uiControlDestroy (uiControl *c)
 Dispose and free all allocated resources. More...
 
uintptr_t uiControlHandle (uiControl *c)
 Returns the control's OS-level handle. More...
 
uiControluiControlParent (uiControl *c)
 Returns the parent control. More...
 
void uiControlSetParent (uiControl *c, uiControl *parent)
 Sets the control's parent. More...
 
int uiControlToplevel (uiControl *c)
 Returns whether or not the control is a top level control. More...
 
int uiControlVisible (uiControl *c)
 Returns whether or not the control is visible. More...
 
void uiControlShow (uiControl *c)
 Shows the control. More...
 
void uiControlHide (uiControl *c)
 Hides the control. More...
 
int uiControlEnabled (uiControl *c)
 Returns whether or not the control is enabled. More...
 
void uiControlEnable (uiControl *c)
 Enables the control. More...
 
void uiControlDisable (uiControl *c)
 Disables the control. More...
 
uiControluiAllocControl (size_t n, uint32_t OSsig, uint32_t typesig, const char *typenamestr)
 Allocates a uiControl. More...
 
void uiFreeControl (uiControl *c)
 Frees the memory associated with the control reference. More...
 
void uiControlVerifySetParent (uiControl *c, uiControl *parent)
 Makes sure the control's parent can be set to parent. More...
 
int uiControlEnabledToUser (uiControl *c)
 Returns whether or not the control can be interacted with by the user. More...
 

Additional Inherited Members

- Public Attributes inherited from uiControl
uint32_t Signature
 
uint32_t OSSignature
 
uint32_t TypeSignature
 
void(* Destroy )(uiControl *)
 
uintptr_t(* Handle )(uiControl *)
 
uiControl *(* Parent )(uiControl *)
 
void(* SetParent )(uiControl *, uiControl *)
 
int(* Toplevel )(uiControl *)
 
int(* Visible )(uiControl *)
 
void(* Show )(uiControl *)
 
void(* Hide )(uiControl *)
 
int(* Enabled )(uiControl *)
 
void(* Enable )(uiControl *)
 
void(* Disable )(uiControl *)
 

Detailed Description

A control container to arrange containing controls in a grid.

Contained controls are arranged on an imaginary grid of rows and columns. Controls can be placed anywhere on this grid, spanning multiple rows and/or columns.

Additionally placed controls can be programmed to expand horizontally and/or vertically, sharing the remaining space among other expanded controls.

Alignment options are available via uiAlign attributes to determine the controls placement within the reserved area, should the area be bigger than the control itself.

Controls can also be placed in relation to other controls using uiAt attributes.

Member Function Documentation

◆ uiGridAppend()

void uiGridAppend ( uiGrid g,
uiControl c,
int  left,
int  top,
int  xspan,
int  yspan,
int  hexpand,
uiAlign  halign,
int  vexpand,
uiAlign  valign 
)

Appends a control to the grid.

Parameters
guiGrid instance.
cThe control to insert.
leftPlacement as number of columns from the left. Integer in range of [INT_MIN, INT_MAX].
topPlacement as number of rows from the top. Integer in range of [INT_MIN, INT_MAX].
xspanNumber of columns to span. Integer in range of [0, INT_MAX].
yspanNumber of rows to span. Integer in range of [0, INT_MAX].
hexpandTRUE to expand reserved area horizontally, FALSE otherwise.
halignHorizontal alignment of the control within the reserved space.
vexpandTRUE to expand reserved area vertically, FALSE otherwise.
valignVertical alignment of the control within the reserved space.

◆ uiGridInsertAt()

void uiGridInsertAt ( uiGrid g,
uiControl c,
uiControl existing,
uiAt  at,
int  xspan,
int  yspan,
int  hexpand,
uiAlign  halign,
int  vexpand,
uiAlign  valign 
)

Inserts a control positioned in relation to another control within the grid.

Parameters
guiGrid instance.
cThe control to insert.
existingThe existing control to position relatively to.
atPlacement specifier in relation to existing control.
xspanNumber of columns to span. Integer in range of [0, INT_MAX].
yspanNumber of rows to span. Integer in range of [0, INT_MAX].
hexpandTRUE to expand reserved area horizontally, FALSE otherwise.
halignHorizontal alignment of the control within the reserved space.
vexpandTRUE to expand reserved area vertically, FALSE otherwise.
valignVertical alignment of the control within the reserved space.

◆ uiGridPadded()

int uiGridPadded ( uiGrid g)

Returns whether or not controls within the grid are padded.

Padding is defined as space between individual controls.

Parameters
guiGrid instance.
Returns
TRUE if controls are padded, FALSE otherwise. [Default: TODO]

◆ uiGridSetPadded()

void uiGridSetPadded ( uiGrid g,
int  padded 
)

Sets whether or not controls within the grid are padded.

Padding is defined as space between individual controls. The padding size is determined by the OS defaults.

Parameters
guiGrid instance.
paddedTRUE to make controls padded, FALSE otherwise.

◆ uiNewGrid()

uiGrid * uiNewGrid ( void  )

Creates a new grid.

Returns
A new uiGrid instance.

The documentation for this struct was generated from the following file: