public virtual bool ShouldSelectCell(EventObject anEvent) { return false; }
/// <summary> /// Overridden to return false, and if the event is a mouse event /// it is forwarded to the tree.<p> /// The behavior for this is debatable, and should really be offered /// as a property. /// </summary> /// <remarks> /// Overridden to return false, and if the event is a mouse event /// it is forwarded to the tree.<p> /// The behavior for this is debatable, and should really be offered /// as a property. By returning false, all keyboard actions are /// implemented in terms of the table. By returning true, the /// tree would get a chance to do something with the keyboard /// events. For the most part this is ok. But for certain keys, /// such as left/right, the tree will expand/collapse where as /// the table focus should really move to a different column. Page /// up/down should also be implemented in terms of the table. /// By returning false this also has the added benefit that clicking /// outside of the bounds of the tree node, but still in the tree /// column will select the row, whereas if this returned true /// that wouldn't be the case. /// <p>By returning false we are also enforcing the policy that /// the tree will never be editable (at least by a key sequence). /// </remarks> public override bool IsCellEditable(EventObject e) { if (e is MouseEvent) { for (int counter = this._enclosing.GetColumnCount() - 1; counter >= 0; counter--) { if (this._enclosing.GetColumnClass(counter) == typeof(TreeTableModel)) { MouseEvent me = (MouseEvent)e; MouseEvent newME = new MouseEvent(this._enclosing.tree, me.GetID(), me.GetWhen(), me.GetModifiers(), me.GetX() - this._enclosing.GetCellRect(0, counter, true).x, me.GetY(), me.GetClickCount(), me.IsPopupTrigger()); this._enclosing.tree.DispatchEvent(newME); break; } } } return false; }
public virtual bool IsCellEditable(EventObject e) { return true; }