Esempio n. 1
0
        internal static SheetEventButton ToSheetEventButton(this EventButton evnt)
        {
            var buttonParams = new SheetEventButton();

            buttonParams.X = (int)evnt.X;
            buttonParams.Y = (int)evnt.Y;
            return(buttonParams);
        }
Esempio n. 2
0
        /// <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);
        }
Esempio n. 3
0
        /// <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();
            }
        }
Esempio n. 4
0
        /// <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);
        }
Esempio n. 5
0
 public void InvokeButtonPress(SheetEventButton button)
 {
     MouseClick.Invoke(this, button);
 }