using System;
//using System.Drawing;
using Gwen.Control.Layout;
namespace Gwen.Control
{
/// <summary>
/// List box row (selectable).
/// </summary>
public class ListBoxRow : TableRow
private bool m_Selected;
/// Initializes a new instance of the <see cref="ListBoxRow"/> class.
/// <param name="parent">Parent control.</param>
public ListBoxRow(Base parent)
: base(parent)
MouseInputEnabled = true;
IsSelected = false;
}
/// Indicates whether the control is selected.
public bool IsSelected
get { return m_Selected; }
set
m_Selected = value;
// TODO: Get these values from the skin.
if (value)
SetTextColor(Color.White);
else
SetTextColor(Color.Black);
/// Renders the control using specified skin.
/// <param name="skin">Skin to use.</param>
protected override void Render(Skin.Base skin)
skin.DrawListBoxLine(this, IsSelected, EvenRow);
/// Handler invoked on mouse click (left) event.
/// <param name="x">X coordinate.</param>
/// <param name="y">Y coordinate.</param>
/// <param name="down">If set to <c>true</c> mouse button is down.</param>
protected override void OnMouseClickedLeft(int x, int y, bool down)
if (down)
//IsSelected = true; // [omeg] ListBox manages that
OnRowSelected();