Class GuiElementDropDown
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
Creates a drop-down list of items.
public class GuiElementDropDown : GuiElementTextBase, IDisposable
- Inheritance
-
GuiElementDropDown
- Implements
- Inherited Members
- Extension Methods
Constructors
GuiElementDropDown(ICoreClientAPI, string[], string[], int, SelectionChangedDelegate, ElementBounds, CairoFont, bool)
Constructor.
public GuiElementDropDown(ICoreClientAPI capi, string[] values, string[] names, int selectedIndex, SelectionChangedDelegate onSelectionChanged, ElementBounds bounds, CairoFont font, bool multiSelect)
Parameters
capi
ICoreClientAPIThe client API
values
string[]The values of the strings.
names
string[]The names of the strings.
selectedIndex
intThe default selected index.
onSelectionChanged
SelectionChangedDelegateThe event that occurs when the selection is changed.
bounds
ElementBoundsThe bounds of the drop down.
font
CairoFontmultiSelect
bool
Fields
PluralMoreNameCode
public string PluralMoreNameCode
Field Value
PluralNameCode
public string PluralNameCode
Field Value
SingularMoreNameCode
public string SingularMoreNameCode
Field Value
SingularNameCode
public string SingularNameCode
Field Value
arrowDownButtonPressed
protected LoadedTexture arrowDownButtonPressed
Field Value
arrowDownButtonReleased
protected LoadedTexture arrowDownButtonReleased
Field Value
currentValueTexture
protected LoadedTexture currentValueTexture
Field Value
highlightBounds
protected ElementBounds highlightBounds
Field Value
highlightTexture
protected LoadedTexture highlightTexture
Field Value
listMenu
public GuiElementListMenu listMenu
Field Value
onSelectionChanged
protected SelectionChangedDelegate onSelectionChanged
Field Value
richTextElem
public GuiElementRichtext richTextElem
Field Value
Properties
DrawOrder
The draw order of this GUI Element.
public override double DrawOrder { get; }
Property Value
Enabled
Enables/disables the given element (default is enabled)
public override bool Enabled { get; set; }
Property Value
Focusable
Can this element be put into focus?
public override bool Focusable { get; }
Property Value
Scale
The scale of this GUI element.
public override double Scale { get; set; }
Property Value
SelectedIndices
public int[] SelectedIndices { get; }
Property Value
- int[]
SelectedValue
public string SelectedValue { get; }
Property Value
SelectedValues
public string[] SelectedValues { get; }
Property Value
- string[]
Methods
ComposeElements(Context, ImageSurface)
Composes the element based on the context.
public override void ComposeElements(Context ctx, ImageSurface surface)
Parameters
ctx
ContextThe context of the element.
surface
ImageSurfaceThe surface of the image. (Not used)
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public override void Dispose()
IsPositionInside(int, int)
Whether or not the point on screen is inside the Element's area.
public override bool IsPositionInside(int posX, int posY)
Parameters
Returns
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
api
ICoreClientAPIThe client API
args
KeyEventThe 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
api
ICoreClientAPIThe Client API
args
MouseEvent
OnMouseMove(ICoreClientAPI, MouseEvent)
The event fired when the mouse is moved.
public override void OnMouseMove(ICoreClientAPI api, MouseEvent args)
Parameters
api
ICoreClientAPIThe Client API.
args
MouseEventThe mouse event arguments.
OnMouseUp(ICoreClientAPI, MouseEvent)
The event fired when the mouse is released.
public override void OnMouseUp(ICoreClientAPI api, MouseEvent args)
Parameters
api
ICoreClientAPIThe Client API.
args
MouseEventThe 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
api
ICoreClientAPIThe Client API
args
MouseWheelEventArgsThe mouse wheel arguments.
RenderInteractiveElements(float)
Renders the dropdown's interactive elements.
public override void RenderInteractiveElements(float deltaTime)
Parameters
deltaTime
floatThe change in time.
SetList(string[], string[])
Sets the values of the list with their corresponding names.
public void SetList(string[] values, string[] names)
Parameters
SetSelectedIndex(int)
Sets the current index to a newly selected index.
public void SetSelectedIndex(int selectedIndex)
Parameters
selectedIndex
intthe index that is to be selected.
SetSelectedValue(params string[])
Sets the current index to the value of the selected string.
public void SetSelectedValue(params string[] value)
Parameters
value
string[]the string contained in the drop down.