internal static SheetEventButton ToSheetEventButton(this EventButton evnt) { var buttonParams = new SheetEventButton(); buttonParams.X = (int)evnt.X; buttonParams.Y = (int)evnt.Y; return(buttonParams); }
/// <summary>Invoked when the user clicks a mouse button.</summary> /// <param name="evnt">The event data.</param> /// <returns></returns> public bool OnButtonPressEvent(SheetEventButton evnt) { try { MouseClick?.Invoke(this, evnt); } catch (Exception ex) { MainView.MasterView.ShowError(ex); } return(true); }
/// <summary>Invoked when the user clicks a mouse button.</summary> /// <param name="sender">Sender of event.</param> /// <param name="evnt">The event data.</param> private void OnMouseClickEvent(object sender, SheetEventButton evnt) { int colIndex; int rowIndex; if (sheet.CellHitTest(evnt.X, evnt.Y, out colIndex, out rowIndex) && rowIndex >= sheet.NumberFrozenRows) { selectedColumnIndex = colIndex; selectedRowIndex = rowIndex; sheetWidget.GrabFocus(); sheet.Refresh(); } }
/// <summary>Invoked when the user clicks a mouse button.</summary> /// <param name="evnt">The event data.</param> /// <returns></returns> protected override bool OnButtonPressEvent(EventButton evnt) { try { if (evnt.Type == EventType.ButtonPress) { SheetEventButton buttonParams = evnt.ToSheetEventButton(); sheet.InvokeButtonPress(buttonParams); } } catch (Exception ex) { MainView.MasterView.ShowError(ex); } return(true); }
public void InvokeButtonPress(SheetEventButton button) { MouseClick.Invoke(this, button); }