Widget

The base structure used by all control types; a widget provides all the minimal functionalities to create a workable control. When a widget is created based on the WidgetType specified a corresponding component will be added to it extending its properties and functionalities.

See Also

Static Variables


Name Description
bounds Local bounds of the Widget.
margin Optional margin to offset the Widget drawing.
history_index Absolute Widget bounds in window coordinates.
data Access the Widget component data determine by the WidgetType it has been created with.
property_count Total amount of custom properties associated with the Widget.
parent Reference to the parent of the active Widget.
child_count Current number of child connected to the active Widget.

Variables


Name Description
anchor Bit mask of AnchorState that specify to which edge(s) the Widget is anchored to.
priority Controls the priority of the Widget; the higher the value the foremost the Widget is draw on screen.
index Internal sorting index used when sorting Widget.
name Name that identify the Widget globally.
visible Toggle on/off the Widget visibility.
enabled Determine wether or not the Widget is enabled.
sensitive Determine if the Widget is sensitive the GUI input Signal.
can_focus Specify if the Widget can be focused or not.

Functions


Name Description
SetBounds Set the active Widget bounds.
SetMargin Set the Widget margin offset.
SetParent Function to assign the parent of the active Widget.
ClearParent Clear the active Widget parent.
RemoveChild Remove a specific child using its Widget reference as key.
RemoveChildAt Remove a child using its index as key.
DetachChild Detach a specific child from the active Widget.
GetChild Retrieve the reference of a child connected to the active Widget by name.
GetChildIndex Retrieve the internal index of the child connected to the current Widget.
SetChildIndex Change the internal index of a child connected to the active Widget.
GetVisibleChildIndex Helper that return the visible index of a child based on all previously visible Widget connected to the active one.
GetChildAt Retrieve a child reference using its internal index as key.
GetRoot Recursively loop down the parent of a Widget for a specified amount of level(s).
SetSignal Assign a Signal to the Widget to respond to.
IsPointInParentsBounds Helper function that check if an arbitraty point in window coordinate is inside the Widget parent bounds.
IsInParentsBounds Helper to test if the active Widget bounds is inside all the Widget parent bounds.
IsContained Helper function that determine if a certain root is inside the Widget bounds.
IsInParentBounds Helper to test if the active Widget bounds is inside its immediate parent bounds.
IsPointInBounds Test if a point is insize the current Widget bounds.
SetAllVisible Recursively set visibile or invisible all children of the Widget (including the current Widget).
IsContained Recursively enable or disable all children of the Widget (including the current Widget).
Resize Resize the current Widget (and all its children if any).
SwapChildren Exchange the internal index of two children.
SortChildren Soft all children by their index property.
AddProperty Add a new custom Property to the active Widget.
GetProperty Retrieve an existing Widget Property by name.
GetPropertyAt Retrieve a Property using its index as key.
GetPriority Retreive the actual prioriy of the Widget based on its own and the one its parent(s).
RespondToSignalL Retrieve wether or not the active Widget can respond to a specific Signal type.

WidgetData


A structure that allows you to manipulate the active Widget data. Using the associated data type that is represented by the WidgetType of your widget you will gain access to its variables, methods, and functions specific to that data class.

Static Variables


Name Description
type Return the object data WidgetType.
button_type Sub data type used by Button Widget that determine the ButtonType to use.
textbox_type Sub data type used by TextBox Widget that determine the TextBoxType to use.
panel_type Sub data type used by Panel Widget that determine the PanelType to use.
scroller_type Sub data type used by Scroller Widget that determine the ScrollerType to use.
splitter_type Sub data type used by Splitter Widget that determine the SplitterType to use.
button Access the Button component attached to the Widget; nil if the WidgetType is not kButton.
label Access the Label component attached to the Widget; nil if the WidgetType is not kLabel.
textbox Access the TextBox component attached to the Widget; nil if the WidgetType is not kTextBox.
textarea Access the TextArea component attached to the Widget; nil if the WidgetType is not kTextArea.
panel Access the Panel component attached to the Widget; nil if the WidgetType is not kPanel.
grid Access the Grid component attached to the Widget; nil if the WidgetType is not kGrid.
picture Access the Panel component attached to the Widget; nil if the WidgetType is not kPicture.
scroller Access the Scroller component attached to the Widget; nil if the WidgetType is not kScroller.
layout Access the Layout component attached to the Widget; nil if the WidgetType is not kLayout.
splitter Access the Splitter component attached to the Widget; nil if the WidgetType is not kSplitter.

RunType


Constants that determine when a Signal should be executed.

  • kOverride: Override the default C/C++ Signal (if any) and replace it.
  • kBefore: Run before the default C/C++ Signal (if any).
  • kAfter: Run after the default C/C++ Signal (if any).

AnchorState


Bit flags that define each edge a Widget can be anchored to.

  • fNone: Not anchored.
  • fLeft: Left edge.
  • fRight: Right edge.
  • fTop: Top edge.
  • fBottom: Bottom edge.
  • fAllSides: All edges (left,right,top,down).

WidgetType


Constant value that defines the primary component type of Widget which gave it its capabilities and potential behaviors.

  • kUser: Empty user based Widget.
  • kButton: Provides functionalities to implement all sort of buttons.
  • kArea: Draw using a custom OpenGL area.
  • kLabel: Component that handles static text.
  • kTextBox: Component to implement single or multiple line text inputs.
  • kTextArea: Component that allows the user to edit large Stream of text.
  • kPanel: Provides a scrolling area that scrolls horizontally or vertically children Widget.
  • kGrid: Provides functionality to create a table to place Widget on every cell.
  • kPicture: Component that allows integrating Texture to the UI.
  • kScroller: Provide slider and scrollbar functionalities to a Widget.
  • kLayout: Component that allows splitting a Widget horizontally and vertically creating resizable cells that can be used to place other Widget.
  • kSplitter: Provides functionalities to split a Widget where both cells can be resized and use to store other Widget.
  • kBase: Empty Widget that is marked as based.




NRG - API 2022.1.377663 - Fri Feb 4 2022
Copyright © 2022 nrgcore.com. All Rights Reserved. Terms of Service - Privacy Policy - EULA