using System; using System.Drawing; using Gwen.Control.Layout; namespace Gwen.Control { /// /// List box row (selectable). /// public class ListBoxRow : TableRow { private bool m_Selected; /// /// Initializes a new instance of the class. /// /// Parent control. 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. /// /// Skin to use. protected override void Render(Skin.Base skin) { skin.DrawListBoxLine(this, IsSelected, EvenRow); } /// /// Handler invoked on mouse click (left) event. /// /// X coordinate. /// Y coordinate. /// If set to true mouse button is down. protected override void OnMouseClickedLeft(int x, int y, bool down) { if (down) { //IsSelected = true; // [omeg] ListBox manages that OnRowSelected(); } } } }