Exemple #1
0
        public void Insert(int index, ListBoxExRow item)
        {
            // 幅の指定
#if !DEBUG
            try
            {
#endif
            item.Width = _parent.Width;
            // 座標調整
            if (index < _object.Count)
            {
                if (_parent.Items[index].Top < _parent.ScrollTop)
                {
                    _parent.ScrollTop += item.Height;
                }
            }
#if !DEBUG
        }

        catch { }
#endif
            // アイテムの挿入
            _object.Insert(index, item);
            item.Parent = _parent;
            // 高さの更新
            _parent.SetItemTops();
            _parent.Invalidate();
        }
Exemple #2
0
        /// <summary>
        /// 各アイテムの描画位置のTopを再計算します。
        /// </summary>
        public void SetItemTops()
        {
            int top = 0;

            _rowsHeight = 0;
            for (int i = 0; i < _items.Count; i++)
            {
                ListBoxExRow obj = _items[i] as ListBoxExRow;
                obj.Top      = top;
                top         += obj.Height;
                _rowsHeight += obj.Height;
            }
        }
Exemple #3
0
        public void Remove(ListBoxExRow item)
        {
            if (item.Top < _parent.ScrollTop)
            {
                _parent.ScrollTop -= item.Height;
            }

            // アイテムの削除
            _object.Remove(item);
            // 高さの更新
            _parent.SetItemTops();
            _parent.Invalidate();
        }
Exemple #4
0
        public void Add(ListBoxExRow item)
        {
            // 幅の指定
#if !DEBUG
            try
            {
#endif
            item.Width = _parent.Width;
#if !DEBUG
        }
        catch { }
#endif
            // アイテムを追加
            _object.Add(item);
            item.Parent = _parent;
            // 高さの更新
            _parent.SetItemTops();
            _parent.Invalidate();
        }