コード例 #1
0
        /// <summary>
        /// Sets the selected and the control indexes.
        /// </summary>
        /// <param name="sel">The selected index.</param>
        /// <param name="ctrl">The control index.</param>
        public void SetIndices(int sel, int ctrl, MyPoint org)
        {
            const int margin = 10;

            Rectangle rcSel  = Rectangle.Empty;
            Rectangle rcCtrl = Rectangle.Empty;
            Rectangle rect   = Rectangle.Empty;

            if (_selectedIndex != sel)
            {
                rcSel = GetBoundingBox(_selectedIndex, sel);

                rect = rcSel;

                _selectedIndex = sel;
            }

            if (_controlIndex != ctrl)
            {
                rcCtrl = GetBoundingBox(_controlIndex, ctrl);

                if (rcSel != Rectangle.Empty)
                {
                    rect = Rectangle.Union(rcSel, rcCtrl);
                }
                else
                {
                    rect = rcCtrl;
                }

                _controlIndex = ctrl;
            }


            rect.Offset(-org.X, -org.Y);
            rect.Inflate(margin, margin);

            _view.Invalidate(rect);
        }
コード例 #2
0
 /// <summary>
 /// Clears all data.
 /// </summary>
 public void Clear()
 {
     _list.Clear();
     _view.Invalidate();
 }
コード例 #3
0
 public void SetVisible(bool yesno)
 {
     _visible = yesno;
     _view.Invalidate();
 }