예제 #1
0
        public override void Event(UiEvent ev)
        {
            var rect = new RectangleF(Position.X, Position.Y - Height - 25, Width, Height);

            if (ev is UiMouseEvent mev)
            {
                var r = rect.Contains(mev.Position);
                if (!r)
                {
                    return;
                }
                if (Items.Any())
                {
                    if (mev.Position.X > (rect.Left + rect.Width - 60))
                    {
                        Items.RemoveAt(hoveredItemIndex);
                        ev.Handled = true;
                    }


                    else if (mev.Position.X < (rect.Left + 30))
                    {
                        Items[hoveredItemIndex].Done = !Items[hoveredItemIndex].Done;
                        ev.Handled = true;
                    }
                }
            }
        }
예제 #2
0
파일: AItem.cs 프로젝트: fel88/ATree
 public virtual void Event(UiEvent ev)
 {
 }