OmegaEngine API  1.0.3
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | Events | List of all members
OmegaGUI.Render.ListBox Class Reference

List box control More...

Inheritance diagram for OmegaGUI.Render.ListBox:
OmegaGUI.Render.Control

Public Member Functions

 ListBox (Dialog parent)
 Create a new list box control More...
 
void SetScrollbarWidth (int width)
 Sets the scroll bar width of this control More...
 
override void OnInitialize ()
 Initialize the scrollbar control here More...
 
override bool HandleKeyboard (WindowMessage msg, IntPtr wParam, IntPtr lParam)
 Called when the control needs to handle the keyboard More...
 
override bool HandleMouse (WindowMessage msg, Point pt, IntPtr wParam, IntPtr lParam)
 Called when the control should handle the mouse More...
 
override void Render (Device device, float elapsedTime)
 Called when the control should be rendered More...
 
void AddItem (string text, string tag, object data)
 Adds an item to the list box control More...
 
void InsertItem (int index, string text, object data)
 Inserts an item to the list box control More...
 
void RemoveAt (int index)
 Removes an item at a particular index More...
 
void Clear ()
 Removes all items from the control More...
 
int GetSelectedIndex (int previousSelected)
 For single-selection listbox, returns the index of the selected item. For multi-selection, returns the first selected item after the previousSelected position. To search for the first selected item, the app passes -1 for previousSelected. For subsequent searches, the app passes the returned index back to GetSelectedIndex as. previousSelected. Returns -1 on error or if no item is selected. More...
 
ListItem GetSelectedItem (int previousSelected)
 Gets the selected item More...
 
ListItem GetSelectedItem ()
 Gets the selected item More...
 
void SetBorder (int borderSize, int marginSize)
 Sets the border and margin sizes More...
 
void SetSelected (string text)
 Sets the selected item by text More...
 
void SelectItem (int newIndex)
 Selects this item More...
 
- Public Member Functions inherited from OmegaGUI.Render.Control
override string ToString ()
 
virtual bool MsgProc (IntPtr hWnd, WindowMessage msg, IntPtr wParam, IntPtr lParam)
 Message Handler More...
 
virtual void OnFocusIn ()
 Called when control gets focus More...
 
virtual void OnFocusOut ()
 Called when control loses focus More...
 
virtual void OnMouseEnter ()
 Called when mouse goes over the control More...
 
virtual void OnMouseExit ()
 Called when mouse leaves the control More...
 
virtual void OnHotKey ()
 Called when the control's hotkey is hit More...
 
virtual bool ContainsPoint (Point pt)
 Does the control contain this point More...
 
virtual void SetLocation (int x, int y)
 Called to set control's location More...
 
virtual void SetSize (int w, int h)
 Called to set control's size More...
 
virtual void Refresh ()
 Refreshes the control More...
 

Public Attributes

const int MainLayer = 0
 
const int SelectionLayer = 1
 
override bool CanHaveFocus => (IsVisible && IsEnabled)
 Can this control have focus More...
 
int NumberItems => itemList.Count
 Number of items current in the list More...
 
ListItem this[int index] => itemList[index]
 Indexer for items in the list More...
 
- Public Attributes inherited from OmegaGUI.Render.Control
uint index
 
bool IsDefault
 
Dialog Parent => parentDialog
 The parent dialog of this control More...
 
virtual bool CanHaveFocus => false
 Can the control have focus More...
 
virtual ControlType ControlType => ctrlType
 Type of the control More...
 

Protected Member Functions

void RaiseDoubleClickEvent (ListBox sender, bool wasTriggeredByUser)
 Raises the double click event More...
 
void RaiseSelectionEvent (ListBox sender, bool wasTriggeredByUser)
 Raises the selection event More...
 
override void UpdateRectangles ()
 Update the rectangles for the list box control More...
 
- Protected Member Functions inherited from OmegaGUI.Render.Control
 Control (Dialog parent)
 Create a new instance of a control More...
 

Protected Attributes

Rectangle textRect
 
Rectangle selectionRect
 
ScrollBar scrollbarControl
 
int scrollWidth = 16
 
int margin = 5
 
int border = 6
 
int textHeight
 
int selectedIndex = -1
 
int selectedStarted
 
bool isDragging
 
ListBoxStyle ctrlStyle = ListBoxStyle.SingleSelection
 
List< ListItemitemList = new List<ListItem>()
 
- Protected Attributes inherited from OmegaGUI.Render.Control
Dialog parentDialog
 
object localUserData
 
bool visible = true
 
bool isMouseOver
 
bool hasFocus
 
int controlId
 
ControlType ctrlType
 
Keys ctrlHotKey
 
bool enabled = true
 
Rectangle boundingBox
 
int controlX
 
List< ElementelementList = new List<Element>()
 

Properties

ListBoxStyle Style [get, set]
 Sets the style of the listbox More...
 
- Properties inherited from OmegaGUI.Render.Control
object UserData [get, set]
 User specified data More...
 
virtual bool IsEnabled [get, set]
 Is the control enabled More...
 
virtual bool IsVisible [get, set]
 Is the control visible More...
 
virtual int ID [get, set]
 Unique ID of the control More...
 
virtual Keys Hotkey [get, set]
 The controls hotkey More...
 
Element this[uint elementIndex] [get, set]
 Index for the elements this control has access to More...
 

Events

EventHandler DoubleClick
 
EventHandler Selection
 
- Events inherited from OmegaGUI.Render.Control
EventHandler MouseEnter
 

Detailed Description

List box control

Constructor & Destructor Documentation

◆ ListBox()

OmegaGUI.Render.ListBox.ListBox ( Dialog  parent)
inline

Create a new list box control

Member Function Documentation

◆ AddItem()

void OmegaGUI.Render.ListBox.AddItem ( string  text,
string  tag,
object  data 
)
inline

Adds an item to the list box control

◆ Clear()

void OmegaGUI.Render.ListBox.Clear ( )
inline

Removes all items from the control

◆ GetSelectedIndex()

int OmegaGUI.Render.ListBox.GetSelectedIndex ( int  previousSelected)
inline

For single-selection listbox, returns the index of the selected item. For multi-selection, returns the first selected item after the previousSelected position. To search for the first selected item, the app passes -1 for previousSelected. For subsequent searches, the app passes the returned index back to GetSelectedIndex as. previousSelected. Returns -1 on error or if no item is selected.

◆ GetSelectedItem() [1/2]

ListItem OmegaGUI.Render.ListBox.GetSelectedItem ( int  previousSelected)
inline

Gets the selected item

◆ GetSelectedItem() [2/2]

ListItem OmegaGUI.Render.ListBox.GetSelectedItem ( )
inline

Gets the selected item

◆ HandleKeyboard()

override bool OmegaGUI.Render.ListBox.HandleKeyboard ( WindowMessage  msg,
IntPtr  wParam,
IntPtr  lParam 
)
inlinevirtual

Called when the control needs to handle the keyboard

Reimplemented from OmegaGUI.Render.Control.

◆ HandleMouse()

override bool OmegaGUI.Render.ListBox.HandleMouse ( WindowMessage  msg,
Point  pt,
IntPtr  wParam,
IntPtr  lParam 
)
inlinevirtual

Called when the control should handle the mouse

Reimplemented from OmegaGUI.Render.Control.

◆ InsertItem()

void OmegaGUI.Render.ListBox.InsertItem ( int  index,
string  text,
object  data 
)
inline

Inserts an item to the list box control

◆ OnInitialize()

override void OmegaGUI.Render.ListBox.OnInitialize ( )
inlinevirtual

Initialize the scrollbar control here

Reimplemented from OmegaGUI.Render.Control.

◆ RaiseDoubleClickEvent()

void OmegaGUI.Render.ListBox.RaiseDoubleClickEvent ( ListBox  sender,
bool  wasTriggeredByUser 
)
inlineprotected

Raises the double click event

◆ RaiseSelectionEvent()

void OmegaGUI.Render.ListBox.RaiseSelectionEvent ( ListBox  sender,
bool  wasTriggeredByUser 
)
inlineprotected

Raises the selection event

◆ RemoveAt()

void OmegaGUI.Render.ListBox.RemoveAt ( int  index)
inline

Removes an item at a particular index

◆ Render()

override void OmegaGUI.Render.ListBox.Render ( Device  device,
float  elapsedTime 
)
inlinevirtual

Called when the control should be rendered

Implements OmegaGUI.Render.Control.

◆ SelectItem()

void OmegaGUI.Render.ListBox.SelectItem ( int  newIndex)
inline

Selects this item

◆ SetBorder()

void OmegaGUI.Render.ListBox.SetBorder ( int  borderSize,
int  marginSize 
)
inline

Sets the border and margin sizes

◆ SetScrollbarWidth()

void OmegaGUI.Render.ListBox.SetScrollbarWidth ( int  width)
inline

Sets the scroll bar width of this control

◆ SetSelected()

void OmegaGUI.Render.ListBox.SetSelected ( string  text)
inline

Sets the selected item by text

◆ UpdateRectangles()

override void OmegaGUI.Render.ListBox.UpdateRectangles ( )
inlineprotectedvirtual

Update the rectangles for the list box control

Reimplemented from OmegaGUI.Render.Control.

Member Data Documentation

◆ CanHaveFocus

override bool OmegaGUI.Render.ListBox.CanHaveFocus => (IsVisible && IsEnabled)

Can this control have focus

◆ NumberItems

int OmegaGUI.Render.ListBox.NumberItems => itemList.Count

Number of items current in the list

◆ this[int index]

ListItem OmegaGUI.Render.ListBox.this[int index] => itemList[index]

Indexer for items in the list

Property Documentation

◆ Style

ListBoxStyle OmegaGUI.Render.ListBox.Style
getset

Sets the style of the listbox


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