OmegaEngine API
1.0.3
|
List box control More...
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< ListItem > | itemList = 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< Element > | elementList = 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 |
List box control
|
inline |
Create a new list box control
|
inline |
Adds an item to the list box control
|
inline |
Removes all items from the control
|
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.
|
inline |
Gets the selected item
|
inline |
Gets the selected item
|
inlinevirtual |
Called when the control needs to handle the keyboard
Reimplemented from OmegaGUI.Render.Control.
|
inlinevirtual |
Called when the control should handle the mouse
Reimplemented from OmegaGUI.Render.Control.
|
inline |
Inserts an item to the list box control
|
inlinevirtual |
Initialize the scrollbar control here
Reimplemented from OmegaGUI.Render.Control.
|
inlineprotected |
Raises the double click event
|
inlineprotected |
Raises the selection event
|
inline |
Removes an item at a particular index
|
inlinevirtual |
Called when the control should be rendered
Implements OmegaGUI.Render.Control.
|
inline |
Selects this item
|
inline |
Sets the border and margin sizes
|
inline |
Sets the scroll bar width of this control
|
inline |
Sets the selected item by text
|
inlineprotectedvirtual |
Update the rectangles for the list box control
Reimplemented from OmegaGUI.Render.Control.
Can this control have focus
int OmegaGUI.Render.ListBox.NumberItems => itemList.Count |
Number of items current in the list
ListItem OmegaGUI.Render.ListBox.this[int index] => itemList[index] |
Indexer for items in the list
|
getset |
Sets the style of the listbox