Table of Contents

Class DropdownList

Namespace
OmegaGUI.Render
Assembly
OmegaGUI.dll

Dropdown list control

public class DropdownList : Button
Inheritance
DropdownList
Inherited Members
Extension Methods

Constructors

DropdownList(Dialog)

Create new dropdown list control

public DropdownList(Dialog parent)

Parameters

parent Dialog

Fields

ComboButtonLayer

public const int ComboButtonLayer = 1

Field Value

int

DropdownLayer

public const int DropdownLayer = 2

Field Value

int

MainLayer

public const int MainLayer = 0

Field Value

int

SelectionLayer

public const int SelectionLayer = 3

Field Value

int

buttonRect

protected Rectangle buttonRect

Field Value

Rectangle

dropDownRect

protected Rectangle dropDownRect

Field Value

Rectangle

dropDownTextRect

protected Rectangle dropDownTextRect

Field Value

Rectangle

dropHeight

protected int dropHeight

Field Value

int

focusedIndex

protected int focusedIndex

Field Value

int

isComboOpen

protected bool isComboOpen

Field Value

bool

itemList

protected List<ListItem> itemList

Field Value

List<ListItem>

scrollWidth

protected int scrollWidth

Field Value

int

scrollbarControl

protected ScrollBar scrollbarControl

Field Value

ScrollBar

selectedIndex

protected int selectedIndex

Field Value

int

textRect

protected Rectangle textRect

Field Value

Rectangle

Properties

CanHaveFocus

Can this control have focus

public override bool CanHaveFocus { get; }

Property Value

bool

this[int]

Indexer for items in the list

public ListItem this[int index] { get; }

Parameters

index int

Property Value

ListItem

NumberItems

Number of items current in the list

public int NumberItems { get; }

Property Value

int

Methods

AddItem(string, string, object)

Adds an item to the dropdown list control

public void AddItem(string text, string tag, object data)

Parameters

text string
tag string
data object

Clear()

Removes all items from the control

public void Clear()

ContainsItem(string)

Determines whether this control contains an item

public bool ContainsItem(string text)

Parameters

text string

Returns

bool

ContainsItem(string, int)

Determines whether this control contains an item

public bool ContainsItem(string text, int start)

Parameters

text string
start int

Returns

bool

FindItem(string)

Finds an item in the list and returns the index

protected int FindItem(string text)

Parameters

text string

Returns

int

FindItem(string, int)

Finds an item in the list and returns the index

protected int FindItem(string text, int start)

Parameters

text string
start int

Returns

int

GetItemData(string)

Gets the data for an item

public object GetItemData(string text)

Parameters

text string

Returns

object

GetSelectedData()

Gets the data for the selected item

public object GetSelectedData()

Returns

object

GetSelectedItem()

Gets the selected item

public ListItem GetSelectedItem()

Returns

ListItem

HandleKeyboard(WindowMessage, IntPtr, IntPtr)

Called when the control needs to handle the keyboard

public override bool HandleKeyboard(WindowMessage msg, IntPtr wParam, IntPtr lParam)

Parameters

msg WindowMessage
wParam IntPtr
lParam IntPtr

Returns

bool

HandleMouse(WindowMessage, Point, IntPtr, IntPtr)

Called when the control should handle the mouse

public override bool HandleMouse(WindowMessage msg, Point pt, IntPtr wParam, IntPtr lParam)

Parameters

msg WindowMessage
pt Point
wParam IntPtr
lParam IntPtr

Returns

bool

OnFocusOut()

Called when focus leaves the control

public override void OnFocusOut()

OnHotKey()

Called when the control's hotkey is pressed

public override void OnHotKey()

OnInitialize()

Initialize the scrollbar control here

public override void OnInitialize()

RaiseChangedEvent(DropdownList, bool)

Create new button instance

protected void RaiseChangedEvent(DropdownList sender, bool wasTriggeredByUser)

Parameters

sender DropdownList
wasTriggeredByUser bool

RemoveAt(int)

Removes an item at a particular index

public void RemoveAt(int index)

Parameters

index int

Render(Device, float)

Called when the control should be rendered

public override void Render(Device device, float elapsedTime)

Parameters

device Device
elapsedTime float

SetDropHeight(int)

Sets the drop height of this control

public void SetDropHeight(int height)

Parameters

height int

SetScrollbarWidth(int)

Sets the scroll bar width of this control

public void SetScrollbarWidth(int width)

Parameters

width int

SetSelected(int)

Sets the selected item by index

public void SetSelected(int index)

Parameters

index int

SetSelected(string)

Sets the selected item by text

public void SetSelected(string text)

Parameters

text string

UpdateRectangles()

Update the rectangles for the dropdown list control

protected override void UpdateRectangles()

Events

Changed

public event EventHandler Changed

Event Type

EventHandler