Exemple #1
0
 public void AddItemToTop(WarframeListBoxItem item)
 {
     this.SafeInvoke(() =>
     {
         Items.Insert(0, item);
     });
 }
Exemple #2
0
 public void AddItemToBottom(WarframeListBoxItem item)
 {
     this.SafeInvoke(() =>
     {
         Items.Add(item);
     });
 }
Exemple #3
0
        protected override void OnDrawItem(DrawItemEventArgs e)
        {
            if (Items.Count <= e.Index)
            {
                return;
            }

            WarframeListBoxItem item = Items[e.Index] as WarframeListBoxItem;

            if (item == null)
            {
                return;
            }

            if (!drawingInitialized)
            {
                InitializeDrawing(e);
            }

            SolidBrush backgroundBrush = e.Index % 2 == 0 ? backgroundAlphaBrush : backgroundBetaBrush;
            SolidBrush foregroundBrush = item.faded ? textBrushFaded : textBrushSolid;

            e.DrawBackground();
            e.Graphics.FillRectangle(backgroundBrush, e.Bounds);
            e.Graphics.DrawString(item.text, e.Font, foregroundBrush, e.Bounds);
            e.DrawFocusRectangle();
        }
Exemple #4
0
 public void RemoveItem(WarframeListBoxItem item)
 {
     this.SafeInvoke(() =>
     {
         RemoveItem(item.tag);
     });
 }
Exemple #5
0
        protected override void OnMeasureItem(MeasureItemEventArgs e)
        {
            if (Items.Count <= e.Index)
            {
                return;
            }

            WarframeListBoxItem item = Items[e.Index] as WarframeListBoxItem;

            if (item == null)
            {
                return;
            }

            int realWidth = Width - SystemInformation.VerticalScrollBarWidth;

            e.ItemHeight = (int)e.Graphics.MeasureString(item.text, Font, realWidth).Height;
        }
Exemple #6
0
        public void RemoveItem(string tag)
        {
            this.SafeInvoke(() =>
            {
                for (int i = Items.Count - 1; i >= 0; --i)
                {
                    WarframeListBoxItem item = Items[i] as WarframeListBoxItem;

                    if (item == null)
                    {
                        continue;
                    }

                    if (item.tag == tag)
                    {
                        Items.RemoveAt(i);
                    }
                }
            });
        }