SafeDispatch/Safedispatch_4_0/maptab/UIClasses/ColorCellElement.cs
2024-02-22 18:43:59 +02:00

57 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SafeMobileLib;
using Telerik.WinControls.UI;
namespace Dispatcher.maptab.UIClasses
{
public class ColorCellElement : SimpleListViewVisualItem
{
private LightVisualElement bgColor;
protected override void CreateChildElements()
{
base.CreateChildElements();
this.bgColor = new LightVisualElement();
this.bgColor.ShouldHandleMouseInput = false;
this.NumberOfColors = 1;
this.bgColor.MinSize = new System.Drawing.Size(24, 24);
this.bgColor.MaxSize = new System.Drawing.Size(24, 24);
this.bgColor.Size = new System.Drawing.Size(24, 24);
this.bgColor.ImageOpacity = 0.5;
this.bgColor.ImageAlignment = ContentAlignment.MiddleCenter;
this.Children.Add(this.bgColor);
}
protected override Type ThemeEffectiveType
{
get
{
return typeof(SimpleListViewVisualItem);
}
}
protected override void SynchronizeProperties()
{
base.SynchronizeProperties();
Color col = (Color)this.Data.Value;
this.Text = "";
this.BackColor = col;
this.NumberOfColors = 1;
if (this.Selected)
this.bgColor.Image = Utils.ScaleImage(global::Dispatcher.Properties.Resources.i_completed, 16, 16);
else
this.bgColor.Image = null;
}
}
}