Exemplo n.º 1
0
        protected internal override void OnButtonPressEvent(CellButtonPressEventArgs args)
        {
            if (eventLock)
            {
                return;
            }

            try {
                eventLock = true;

                base.OnButtonPressEvent(args);

                if (!IsEditable)
                {
                    return;
                }

                if (parentColumn.ParentListView.ManualEditControl)
                {
                    return;
                }

                CellPosition pos = ParentColumn.ParentListView.EditedCell;
                if (pos.Row != args.Cell.Row || pos.Column != args.Cell.Column)
                {
                    if (args.EventButton.Type == EventType.TwoButtonPress)
                    {
                        BeginCellEdit(args);
                    }
                }
            } finally {
                eventLock = false;
            }
        }
Exemplo n.º 2
0
        internal virtual void OnCellButtonPress(CellButtonPressEventArgs args)
        {
#if DEBUG_LISTVIEW
            Debug.WriteLine(string.Format("ListView received {0} at {1}", "OnCellButtonPress", args.Cell));
#endif
            OnListButtonPressEvent(args.EventButton);
            //OnButtonPressEvent (args.EventButton);
        }
Exemplo n.º 3
0
        protected internal virtual void OnButtonPressEvent(CellButtonPressEventArgs args)
        {
#if DEBUG_LISTVIEW
            Debug.WriteLine(string.Format("Cell received {0} at {1}", "OnButtonPressEvent", args.Cell));
#endif
            if (ButtonPressEvent != null)
            {
                ButtonPressEvent(this, args);
            }

            if (parentColumn != null)
            {
                parentColumn.OnButtonPressEvent(args);
            }
        }
        private bool OnListButtonPressEvent(EventButton evnt)
        {
            if (eventLock)
            {
                return(true);
            }

            try {
                eventLock = true;

                int x = (int)evnt.X - list_interaction_alloc.X + (int)hadjustment.Value;
                int y = (int)evnt.Y - list_interaction_alloc.Y;

                GrabFocus();

                int row_index = GetRowAtY(y);
                int col_index = GetColumnAtX(x).Index;

                if (row_index < 0 || row_index >= Model.Count)
                {
                    return(true);
                }

                CellButtonPressEventArgs args = new CellButtonPressEventArgs(col_index, row_index, evnt);
                if (col_index >= 0 && row_index >= 0)
                {
                    column_cache [col_index].Column.ListCell.OnButtonPressEvent(args);
                }

                if (CellButtonPressEvent != null)
                {
                    CellButtonPressEvent(this, args);
                }

                if ((evnt.Button != 1 || evnt.Type != EventType.TwoButtonPress) && Selection != null &&
                    ((evnt.State & KeyShortcuts.ControlModifier) == 0 || !AllowMultipleSelect) &&
                    (((evnt.State & ModifierType.ShiftMask) == 0 || !AllowMultipleSelect) && AllowSelect) &&
                    evnt.Button != 3)
                {
                    pressed_row_index = row_index;
                    last_row_index    = row_index;
                }

                if (!ManualFucusChange)
                {
                    if (cellsFucusable)
                    {
                        FocusCell(col_index, row_index);
                    }
                    else
                    {
                        FocusRow(row_index);
                    }
                }

                if (evnt.Button == 1 && evnt.Type == EventType.TwoButtonPress)
                {
                    pressed_row_index = -1;
                    last_row_index    = -1;
                    OnRowActivated();
                }

                if (evnt.Button == 3)
                {
                    OnPopupMenu();
                }

                return(true);
            } finally {
                eventLock = false;
            }
        }