コード例 #1
0
        /// <summary>
        /// Unselects the specified row.
        /// </summary>
        /// <param name="row">Row to unselect.</param>
        public void UnselectRow(ListBoxRow row)
        {
            row.IsSelected = false;
            m_SelectedRows.Remove(row);

            if (RowUnselected != null)
            {
                RowUnselected.Invoke(this);
            }
        }
コード例 #2
0
        /// <summary>
        /// Adds a new row.
        /// </summary>
        /// <param name="label">Row text.</param>
        /// <param name="name">Internal control name.</param>
        /// <returns>Newly created control.</returns>
        public TableRow AddRow(String label, String name)
        {
            ListBoxRow row = new ListBoxRow(this);

            m_Table.AddRow(row);

            row.SetCellText(0, label);
            row.Name = name;

            row.Selected += OnRowSelected;

            m_Table.SizeToContents(Width);

            return(row);
        }
コード例 #3
0
        /// <summary>
        /// Slelects the specified row.
        /// </summary>
        /// <param name="control">Row to select.</param>
        /// <param name="clearOthers">Determines whether to deselect previously selected rows.</param>
        public void SelectRow(Control control, bool clearOthers = false)
        {
            if (!AllowMultiSelect || clearOthers)
            {
                UnselectAll();
            }

            ListBoxRow row = control as ListBoxRow;

            if (row == null)
            {
                return;
            }

            // TODO: make sure this is one of our rows!
            row.IsSelected = true;
            m_SelectedRows.Add(row);
            if (RowSelected != null)
            {
                RowSelected.Invoke(this);
            }
        }
コード例 #4
0
        /// <summary>
        /// Handler for the row selection event.
        /// </summary>
        /// <param name="control">Event source.</param>
        protected virtual void OnRowSelected(Control control)
        {
            // [omeg] changed default behavior
            bool       clear = false;// !InputHandler.InputHandler.IsShiftDown;
            ListBoxRow row   = control as ListBoxRow;

            if (row == null)
            {
                return;
            }

            if (row.IsSelected)
            {
                if (IsToggle)
                {
                    UnselectRow(row);
                }
            }
            else
            {
                SelectRow(control, clear);
            }
        }
コード例 #5
0
ファイル: ListBox.cs プロジェクト: FloodProject/flood
        /// <summary>
        /// Unselects the specified row.
        /// </summary>
        /// <param name="row">Row to unselect.</param>
        public void UnselectRow(ListBoxRow row)
        {
            row.IsSelected = false;
            m_SelectedRows.Remove(row);

            if (RowUnselected != null)
                RowUnselected.Invoke(this);
        }
コード例 #6
0
ファイル: ListBox.cs プロジェクト: FloodProject/flood
        /// <summary>
        /// Adds a new row.
        /// </summary>
        /// <param name="label">Row text.</param>
        /// <param name="name">Internal control name.</param>
        /// <returns>Newly created control.</returns>
        public TableRow AddRow(String label, String name)
        {
            ListBoxRow row = new ListBoxRow(this);
            m_Table.AddRow(row);

            row.SetCellText(0, label);
            row.Name = name;

            row.Selected += OnRowSelected;

            m_Table.SizeToContents(Width);

            return row;
        }