/// <summary> /// Draw item. /// </summary> public override void Draw() { base.Draw(); string caption = _items[Index].ToString(); int offset = StringMeasurer.MeasureString(caption); _itemText.Color = Enabled ? Selected ? UnknownColors.Black : UnknownColors.WhiteSmoke : Color.FromArgb(163, 159, 148); _itemText.Caption = caption; _arrowLeft.Color = Enabled ? Selected ? UnknownColors.Black : UnknownColors.WhiteSmoke : Color.FromArgb(163, 159, 148); _arrowRight.Color = Enabled ? Selected ? UnknownColors.Black : UnknownColors.WhiteSmoke : Color.FromArgb(163, 159, 148); _arrowLeft.Position = new PointF(375 - offset + Offset.X + Parent.WidthOffset, _arrowLeft.Position.Y); if (Selected) { _arrowLeft.Draw(); _arrowRight.Draw(); _itemText.Position = new PointF(405 + Offset.X + Parent.WidthOffset, (int)_itemText.Position.Y); } else { _itemText.Position = new PointF(420 + Offset.X + Parent.WidthOffset, (int)_itemText.Position.Y); } _itemText.Draw(); }
/// <summary> /// Draw item. /// </summary> public override void Draw() { base.Draw(); string caption = _items[Index].ToString(); float offset = StringMeasurer.MeasureString(caption, _itemText.Font, _itemText.Scale); _itemText.Color = Enabled ? Selected ? Color.Black : Color.WhiteSmoke : Color.FromArgb(163, 159, 148); _itemText.Caption = caption; _arrowLeft.Color = Enabled ? Selected ? Color.Black : Color.WhiteSmoke : Color.FromArgb(163, 159, 148); _arrowRight.Color = Enabled ? Selected ? Color.Black : Color.WhiteSmoke : Color.FromArgb(163, 159, 148); _arrowLeft.Position = new Point(375 - (int)offset + Offset.X + Parent.WidthOffset, _arrowLeft.Position.Y); if (Selected) { _arrowLeft.Draw(); _arrowRight.Draw(); _itemText.Position = new Point(403 + Offset.X + Parent.WidthOffset, _itemText.Position.Y); } else { _itemText.Position = new Point(418 + Offset.X + Parent.WidthOffset, _itemText.Position.Y); } _itemText.Draw(); }