Class GuiElementContainer
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
public class GuiElementContainer : GuiElement, IDisposable
- Inheritance
-
GuiElementContainer
- Implements
- Inherited Members
- Extension Methods
Constructors
GuiElementContainer(ICoreClientAPI, ElementBounds)
Creates a new list in the current GUI.
public GuiElementContainer(ICoreClientAPI capi, ElementBounds bounds)
Parameters
capiICoreClientAPIThe Client API.
boundsElementBoundsThe bounds of the list.
Fields
Elements
The cells in the list. See IGuiElementCell for how it's supposed to function.
public List<GuiElement> Elements
Field Value
Tabbable
public bool Tabbable
Field Value
UnscaledCellHorPadding
The padding on the horizontal axis of the cell. Default: 7
public int UnscaledCellHorPadding
Field Value
UnscaledCellVerPadding
The padding on the vertical axis of the cell. Default: 2
public int UnscaledCellVerPadding
Field Value
currentFocusableElementKey
protected int currentFocusableElementKey
Field Value
unscaledCellSpacing
the space between the cells. Default: 10
public int unscaledCellSpacing
Field Value
Properties
CurrentTabIndexElement
Gets the currently tabbed index element, if there is one currently focused.
public GuiElement CurrentTabIndexElement { get; }
Property Value
FirstTabbableElement
public GuiElement FirstTabbableElement { get; }
Property Value
Focusable
Whether or not the element can be focused.
public override bool Focusable { get; }
Property Value
MaxTabIndex
Gets the maximum tab index of the components.
public int MaxTabIndex { get; }
Property Value
Methods
Add(GuiElement, int)
Adds a cell to the list.
public void Add(GuiElement elem, int afterPosition = -1)
Parameters
elemGuiElementThe cell to add.
afterPositionintThe position of the cell to add after. (Default: -1)
BeforeCalcBounds()
public override void BeforeCalcBounds()
CalcTotalHeight()
Calculates the total height for the list.
public void CalcTotalHeight()
Clear()
public void Clear()
ComposeElements(Context, ImageSurface)
Composes the elements.
public override void ComposeElements(Context ctx, ImageSurface surface)
Parameters
ctxContextsurfaceImageSurfaceThe surface of the GUI.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public override void Dispose()
FocusElement(int)
marks an element as in focus.
public bool FocusElement(int tabIndex)
Parameters
tabIndexintThe tab index to focus at.
Returns
- bool
Whether or not the focus could be done.
OnFocusGained()
The event fired when the element gains focus.
public override void OnFocusGained()
OnFocusLost()
The event fired when the element looses focus.
public override void OnFocusLost()
OnKeyDown(ICoreClientAPI, KeyEvent)
The event fired when a key is held down.
public override void OnKeyDown(ICoreClientAPI api, KeyEvent args)
Parameters
apiICoreClientAPIThe client API
argsKeyEventThe key event arguments.
OnKeyPress(ICoreClientAPI, KeyEvent)
The event fired the moment a key is pressed.
public override void OnKeyPress(ICoreClientAPI api, KeyEvent args)
Parameters
apiICoreClientAPIThe Client API.
argsKeyEventThe keyboard state when the key was pressed.
OnKeyUp(ICoreClientAPI, KeyEvent)
The event fired when a key is held down.
public override void OnKeyUp(ICoreClientAPI api, KeyEvent args)
Parameters
apiICoreClientAPIThe client API
argsKeyEventThe key event arguments.
OnMouseDown(ICoreClientAPI, MouseEvent)
The event fired when the mouse is down the element is around. Fires before OnMouseDownOnElement, however OnMouseDownOnElement is called within the base function.
public override void OnMouseDown(ICoreClientAPI api, MouseEvent args)
Parameters
apiICoreClientAPIThe Client API
argsMouseEvent
OnMouseMove(ICoreClientAPI, MouseEvent)
The event fired when the mouse is moved.
public override void OnMouseMove(ICoreClientAPI api, MouseEvent args)
Parameters
apiICoreClientAPIThe Client API.
argsMouseEventThe mouse event arguments.
OnMouseUp(ICoreClientAPI, MouseEvent)
The event fired when the mouse is released.
public override void OnMouseUp(ICoreClientAPI api, MouseEvent args)
Parameters
apiICoreClientAPIThe Client API.
argsMouseEventThe arguments for the mouse event.
OnMouseWheel(ICoreClientAPI, MouseWheelEventArgs)
The event fired when the mouse wheel is scrolled.
public override void OnMouseWheel(ICoreClientAPI api, MouseWheelEventArgs args)
Parameters
apiICoreClientAPIThe Client API
argsMouseWheelEventArgsThe mouse wheel arguments.
RemoveCell(int)
Removes a cell at a specified position.
public void RemoveCell(int position)
Parameters
positionintThe position of the cell to remove.
RenderInteractiveElements(float)
Renders the element as an interactive element.
public override void RenderInteractiveElements(float deltaTime)
Parameters
deltaTimefloatThe change in time.
UnfocusOwnElements()
public void UnfocusOwnElements()
UnfocusOwnElementsExcept(GuiElement)
Unfocuses all elements except one specific element.
public void UnfocusOwnElementsExcept(GuiElement elem)
Parameters
elemGuiElementThe element to remain in focus.