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

Base class for GUI controls providing common methods. More...

#include <ui.h>

Inheritance diagram for uiControl:
uiBox uiButton uiCheckbox uiColorButton uiCombobox uiDateTimePicker uiEditableCombobox uiEntry uiFontButton uiForm uiGrid uiGroup uiLabel uiMultilineEntry uiProgressBar uiRadioButtons uiSeparator uiSlider uiSpinbox uiTab uiTable uiWindow

Public Member Functions

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...
 

Public Attributes

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

Base class for GUI controls providing common methods.

Member Function Documentation

◆ uiAllocControl()

uiControl * uiAllocControl ( size_t  n,
uint32_t  OSsig,
uint32_t  typesig,
const char *  typenamestr 
)

Allocates a uiControl.

Helper to allocate new controls.

Parameters
nSize of type to allocate.
Todo:
Document parameters

◆ uiControlDestroy()

void uiControlDestroy ( uiControl c)

Dispose and free all allocated resources.

The platform specific APIs that actually destroy a control (and its children) are called.

Note
Most of the time is needed to be used directly only on the top level windows.
Parameters
cuiControl instance.
Todo:
Document ownership.

◆ uiControlDisable()

void uiControlDisable ( uiControl c)

Disables the control.

Parameters
cuiControl instance.

◆ uiControlEnable()

void uiControlEnable ( uiControl c)

Enables the control.

Parameters
cuiControl instance.

◆ uiControlEnabled()

int uiControlEnabled ( uiControl c)

Returns whether or not the control is enabled.

Defaults to true.

Parameters
cuiControl instance.
See also
uiControlEnabledToUser

◆ uiControlEnabledToUser()

int uiControlEnabledToUser ( uiControl c)

Returns whether or not the control can be interacted with by the user.

Checks if the control and all it's parents are enabled to make sure it can be interacted with by the user.

Parameters
cuiControl instance.
Returns
TRUE if enabled, FALSE otherwise.
See also
uiControlEnabled

◆ uiControlHandle()

uintptr_t uiControlHandle ( uiControl c)

Returns the control's OS-level handle.

Parameters
cuiControl instance.
Returns
OS-level handle.

◆ uiControlHide()

void uiControlHide ( uiControl c)

Hides the control.

Parameters
cuiControl instance.
Note
Hidden controls do not take up space within the layout.

◆ uiControlParent()

uiControl * uiControlParent ( uiControl c)

Returns the parent control.

Parameters
cuiControl instance.
Returns
The parent control, NULL if detached.

◆ uiControlSetParent()

void uiControlSetParent ( uiControl c,
uiControl parent 
)

Sets the control's parent.

Parameters
cuiControl instance.
parentThe parent control, NULL to detach.
Todo:
Document ownership.

◆ uiControlShow()

void uiControlShow ( uiControl c)

Shows the control.

Parameters
cuiControl instance.

◆ uiControlToplevel()

int uiControlToplevel ( uiControl c)

Returns whether or not the control is a top level control.

Parameters
cuiControl instance.
Returns
TRUE if top level control, FALSE otherwise.

◆ uiControlVerifySetParent()

void uiControlVerifySetParent ( uiControl c,
uiControl parent 
)

Makes sure the control's parent can be set to parent.

Parameters
cuiControl instance.
parentuiControl instance.
Todo:
Make sure all controls have these
Warning
This will crash the application if FALSE.

◆ uiControlVisible()

int uiControlVisible ( uiControl c)

Returns whether or not the control is visible.

Parameters
cuiControl instance.
Returns
TRUE if visible, FALSE otherwise.

◆ uiFreeControl()

void uiFreeControl ( uiControl c)

Frees the memory associated with the control reference.

Note
This method is public only for writing custom controls.
Parameters
cuiControl instance.

Member Data Documentation

◆ Destroy

void(* uiControl::Destroy) (uiControl *)

◆ Disable

void(* uiControl::Disable) (uiControl *)

◆ Enable

void(* uiControl::Enable) (uiControl *)

◆ Enabled

int(* uiControl::Enabled) (uiControl *)

◆ Handle

uintptr_t(* uiControl::Handle) (uiControl *)

◆ Hide

void(* uiControl::Hide) (uiControl *)

◆ OSSignature

uint32_t uiControl::OSSignature

◆ Parent

uiControl *(* uiControl::Parent) (uiControl *)

◆ SetParent

void(* uiControl::SetParent) (uiControl *, uiControl *)

◆ Show

void(* uiControl::Show) (uiControl *)

◆ Signature

uint32_t uiControl::Signature

◆ Toplevel

int(* uiControl::Toplevel) (uiControl *)

◆ TypeSignature

uint32_t uiControl::TypeSignature

◆ Visible

int(* uiControl::Visible) (uiControl *)

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