本文整理汇总了C#中XPTable.Events.CellMouseEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# CellMouseEventArgs类的具体用法?C# CellMouseEventArgs怎么用?C# CellMouseEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CellMouseEventArgs类属于XPTable.Events命名空间,在下文中一共展示了CellMouseEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnEditorButtonMouseDown
/// <summary>
/// Handler for the editors drop down button MouseDown event
/// </summary>
/// <param name="sender">The object that raised the event</param>
/// <param name="e">A CellMouseEventArgs that contains the event data</param>
public virtual void OnEditorButtonMouseDown(object sender, CellMouseEventArgs e)
{
FolderBrowserDialog browser = new FolderBrowserDialog();
browser.Description = "Select web project folder";
browser.SelectedPath = TextBox.Text;
inBrowseMode = true;
DialogResult res = browser.ShowDialog();
inBrowseMode = false;
if (res == DialogResult.OK) TextBox.Text = browser.SelectedPath;
EditingTable.StopEditing();
}
示例2: OnEditorButtonMouseDown
/// <summary>
/// Handler for the editors buttons MouseDown event
/// </summary>
/// <param name="sender">The object that raised the event</param>
/// <param name="e">A CellMouseEventArgs that contains the event data</param>
public void OnEditorButtonMouseDown(object sender, CellMouseEventArgs e)
{
this.ParseEditText();
if (e.Y < this.buttonBounds.Top + (this.buttonBounds.Height / 2))
{
this.buttonID = UpButtonID;
this.UpButton();
}
else
{
this.buttonID = DownButtonID;
this.DownButton();
}
this.StartTimer();
}
示例3: OnMouseMove
/// <summary>
/// Raises the MouseMove event
/// </summary>
/// <param name="e">A CellMouseEventArgs that contains the event data</param>
public override void OnMouseMove(CellMouseEventArgs e)
{
base.OnMouseMove(e);
// get the button renderer data
ButtonRendererData rendererData = this.GetButtonRendererData(e.Cell);
Rectangle buttonRect = this.CalcButtonBounds();
// check if the left mouse button is pressed
if (e.Button == MouseButtons.Left)
{
// check if the mouse press originated in the button area
if (buttonRect.Contains(rendererData.ClickPoint))
{
// check if the mouse is currently in the button
if (buttonRect.Contains(e.X, e.Y))
{
// make sure the button is pressed
if (rendererData.ButtonState != PushButtonState.Pressed)
{
rendererData.ButtonState = PushButtonState.Pressed;
e.Table.Invalidate(e.CellRect);
}
}
else
{
// the mouse isn't inside the button so make sure it is "hot"
if (rendererData.ButtonState != PushButtonState.Hot)
{
rendererData.ButtonState = PushButtonState.Hot;
e.Table.Invalidate(e.CellRect);
}
}
}
}
else
{
// check if the mouse is currently in the button
if (buttonRect.Contains(e.X, e.Y))
{
// the mouse is inside the button so make sure it is "hot"
if (rendererData.ButtonState != PushButtonState.Hot)
{
rendererData.ButtonState = PushButtonState.Hot;
e.Table.Invalidate(e.CellRect);
}
}
else
{
// not inside the button so make sure it is in its normal state
if (rendererData.ButtonState != PushButtonState.Normal)
{
rendererData.ButtonState = PushButtonState.Normal;
e.Table.Invalidate(e.CellRect);
}
}
}
}
示例4: OnMouseEnter
/// <summary>
/// Raises the MouseEnter event
/// </summary>
/// <param name="e">A CellMouseEventArgs that contains the event data</param>
public override void OnMouseEnter(CellMouseEventArgs e)
{
base.OnMouseEnter(e);
// get the button renderer data
ButtonRendererData rendererData = this.GetButtonRendererData(e.Cell);
// if the mouse is inside the button, make sure it is "hot"
if (this.CalcButtonBounds().Contains(e.X, e.Y))
{
if (rendererData.ButtonState != PushButtonState.Hot)
{
rendererData.ButtonState = PushButtonState.Hot;
e.Table.Invalidate(e.CellRect);
}
}
// the mouse isn't inside the button, so it is in its normal state
else
{
if (rendererData.ButtonState != PushButtonState.Normal)
{
rendererData.ButtonState = PushButtonState.Normal;
e.Table.Invalidate(e.CellRect);
}
}
}
示例5: OnEditorButtonMouseUp
/// <summary>
/// Handler for the editors drop down button MouseUp event
/// </summary>
/// <param name="sender">The object that raised the event</param>
/// <param name="e">A CellMouseEventArgs that contains the event data</param>
public virtual void OnEditorButtonMouseUp(object sender, CellMouseEventArgs e)
{
}
示例6: OnMouseLeave
/// <summary>
/// Raises the MouseLeave event
/// </summary>
/// <param name="e">A CellMouseEventArgs that contains the event data</param>
public override void OnMouseLeave(CellMouseEventArgs e)
{
base.OnMouseLeave(e);
if (e.Table.IsCellEditable(e.CellPos))
{
// get the renderer data
CheckBoxRendererData rendererData = this.GetCheckBoxRendererData(e.Cell);
if (e.Cell.CheckState == CheckState.Checked)
{
if (rendererData.CheckState != CheckBoxStates.CheckedNormal)
{
rendererData.CheckState = CheckBoxStates.CheckedNormal;
e.Table.Invalidate(e.CellRect);
}
}
else if (e.Cell.CheckState == CheckState.Indeterminate)
{
if (rendererData.CheckState != CheckBoxStates.MixedNormal)
{
rendererData.CheckState = CheckBoxStates.MixedNormal;
e.Table.Invalidate(e.CellRect);
}
}
else //if (e.Cell.CheckState == CheckState.Unchecked)
{
if (rendererData.CheckState != CheckBoxStates.UncheckedNormal)
{
rendererData.CheckState = CheckBoxStates.UncheckedNormal;
e.Table.Invalidate(e.CellRect);
}
}
}
}
示例7: OnMouseDown
public override void OnMouseDown(CellMouseEventArgs e)
{
//base.OnMouseDown(e);
if (this.ShowDropDownButton || (e.Table.IsEditing && e.CellPos == e.Table.EditingCell))
{
if (e.Table.IsCellEditable(e.CellPos))
{
// get the button renderer data
DropDownRendererData rendererData = this.GetDropDownRendererData(e.Cell);
if (!(e.Table.ColumnModel.GetCellEditor(e.CellPos.Column) is DropDownCellEditor))
{
throw new InvalidOperationException("Cannot edit Cell as DropDownCellRenderer requires a DropDownColumn that uses a DropDownCellEditor");
}
rendererData.ButtonState = ComboBoxStates.Pressed;
if (!e.Table.IsEditing)
{
e.Table.EditCell(e.CellPos);
}
((IEditorUsesRendererButtons)e.Table.EditingCellEditor).OnEditorButtonMouseDown(this, e);
e.Table.Invalidate(e.CellRect);
}
}
}
示例8: OnCellMouseHover
/// <summary>
/// Raises the CellHover event
/// </summary>
/// <param name="e">A CellEventArgs that contains the event data</param>
protected virtual void OnCellMouseHover(CellMouseEventArgs e)
{
if (this.CanRaiseEvents)
{
if (CellMouseHover != null)
{
CellMouseHover(e.Cell, e);
}
}
}
示例9: OnCellDoubleClick
/// <summary>
/// Raises the CellDoubleClick event
/// </summary>
/// <param name="e">A CellEventArgs that contains the event data</param>
protected virtual void OnCellDoubleClick(CellMouseEventArgs e)
{
if (!this.IsCellEnabled(e.CellPos))
{
return;
}
if (this.CanRaiseEvents)
{
ICellRenderer renderer = this.ColumnModel.GetCellRenderer(this.LastMouseCell.Column);
if (renderer != null)
{
renderer.OnDoubleClick(e);
}
if (CellDoubleClick != null)
{
CellDoubleClick(e.Cell, e);
}
}
}
示例10: OnCellMouseMove
/// <summary>
/// Raises the CellMouseMove event
/// </summary>
/// <param name="e">A CellMouseEventArgs that contains the event data</param>
protected virtual void OnCellMouseMove(CellMouseEventArgs e)
{
if (this.CanRaiseEvents)
{
ICellRenderer renderer = this.ColumnModel.GetCellRenderer(e.Column);
if (renderer != null)
{
renderer.OnMouseMove(e);
}
if (CellMouseMove != null)
{
CellMouseMove(e.Cell, e);
}
}
}
示例11: RaiseCellMouseMove
/// <summary>
/// Raises a MouseMove event for the Cell at the specified cell position
/// </summary>
/// <param name="cellPos">The position of the Cell</param>
/// <param name="e">A MouseEventArgs that contains the event data</param>
protected void RaiseCellMouseMove(CellPos cellPos, MouseEventArgs e)
{
if (!this.IsValidCell(cellPos))
{
return;
}
if (this.ColumnModel.GetCellRenderer(cellPos.Column) != null)
{
Cell cell = null;
if (cellPos.Column < this.TableModel.Rows[cellPos.Row].Cells.Count)
{
cell = this.TableModel.Rows[cellPos.Row].Cells[cellPos.Column];
}
CellMouseEventArgs mcea = new CellMouseEventArgs(cell, this, cellPos.Row, cellPos.Column, this.CellRect(cellPos.Row, cellPos.Column), e);
this.OnCellMouseMove(mcea);
}
}
示例12: OnMouseEnter
/// <summary>
/// Raises the MouseEnter event
/// </summary>
/// <param name="e">A CellMouseEventArgs that contains the event data</param>
public virtual void OnMouseEnter(CellMouseEventArgs e)
{
this.Bounds = e.CellRect;
this.Padding = e.Cell == null ? CellPadding.Empty : e.Cell.Padding;
bool tooltipActive = e.Table.ToolTip.Active;
if (tooltipActive)
e.Table.ToolTip.Active = false;
e.Table.ResetMouseEventArgs();
if (tooltipActive)
{
if (e.Cell != null)
{
CellToolTipEventArgs args = new CellToolTipEventArgs(e.Cell, new Point(e.X, e.Y));
// The default tooltip is to show the full text for any cell that has been truncated
if (e.Cell.IsTextTrimmed)
args.ToolTipText = e.Cell.Text;
// Allow the outside world to modify the text or cancel this tooltip
e.Table.OnCellToolTipPopup(args);
// Even if this tooltip has been cancelled we need to get rid of the old tooltip
if (args.Cancel)
e.Table.ToolTip.SetToolTip(e.Table, string.Empty);
else
e.Table.ToolTip.SetToolTip(e.Table, args.ToolTipText);
}
else
{
e.Table.ToolTip.SetToolTip(e.Table, string.Empty);
}
e.Table.ToolTip.Active = true;
}
}
示例13: OnMouseUp
/// <summary>
/// Raises the MouseUp event
/// </summary>
/// <param name="e">A CellMouseEventArgs that contains the event data</param>
public override void OnMouseUp(CellMouseEventArgs e)
{
base.OnMouseUp(e);
if (e.Table.IsCellEditable(e.CellPos))
{
// get the renderer data
CheckBoxRendererData rendererData = this.GetCheckBoxRendererData(e.Cell);
if (this.CalcCheckRect(e.Table.TableModel.Rows[e.Row].Alignment, e.Table.ColumnModel.Columns[e.Column].Alignment).Contains(e.X, e.Y))
{
if (e.Button == MouseButtons.Left && e.Table.LastMouseDownCell.Row == e.Row && e.Table.LastMouseDownCell.Column == e.Column)
{
//
if (e.Cell.CheckState == CheckState.Checked)
{
if (!e.Cell.ThreeState || !(e.Table.ColumnModel.Columns[e.Column] is CheckBoxColumn) ||
((CheckBoxColumn) e.Table.ColumnModel.Columns[e.Column]).CheckStyle == CheckBoxColumnStyle.RadioButton)
{
rendererData.CheckState = CheckBoxStates.UncheckedHot;
e.Cell.CheckState = CheckState.Unchecked;
}
else
{
rendererData.CheckState = CheckBoxStates.MixedHot;
e.Cell.CheckState = CheckState.Indeterminate;
}
}
else if (e.Cell.CheckState == CheckState.Indeterminate)
{
rendererData.CheckState = CheckBoxStates.UncheckedHot;
e.Cell.CheckState = CheckState.Unchecked;
}
else //if (e.Cell.CheckState == CheckState.Unchecked)
{
rendererData.CheckState = CheckBoxStates.CheckedHot;
e.Cell.CheckState = CheckState.Checked;
}
e.Table.Invalidate(e.CellRect);
}
}
}
}
示例14: OnEditorButtonMouseUp
/// <summary>
/// Handler for the editors buttons MouseUp event
/// </summary>
/// <param name="sender">The object that raised the event</param>
/// <param name="e">A CellMouseEventArgs that contains the event data</param>
public void OnEditorButtonMouseUp(object sender, CellMouseEventArgs e)
{
this.StopTimer();
this.buttonID = 0;
}
示例15: OnMouseUp
/// <summary>
/// Raises the MouseUp event
/// </summary>
/// <param name="e">A CellMouseEventArgs that contains the event data</param>
public override void OnMouseUp(CellMouseEventArgs e)
{
base.OnMouseUp(e);
if (mustBeChecked != null)
{
// get the renderer data
CheckBoxRendererData rendererData = this.GetCheckBoxRendererData(mustBeChecked);
if (mustBeChecked.CheckState == CheckState.Checked)
{
if (!mustBeChecked.ThreeState || !(e.Table.ColumnModel.Columns[e.Column] is CheckBoxColumn) ||
((CheckBoxColumn)e.Table.ColumnModel.Columns[e.Column]).CheckStyle == CheckBoxColumnStyle.RadioButton)
{
rendererData.CheckState = CheckBoxStates.UncheckedHot;
mustBeChecked.CheckState = CheckState.Unchecked;
}
else
{
rendererData.CheckState = CheckBoxStates.MixedHot;
mustBeChecked.CheckState = CheckState.Indeterminate;
}
}
else if (mustBeChecked.CheckState == CheckState.Indeterminate)
{
rendererData.CheckState = CheckBoxStates.UncheckedHot;
mustBeChecked.CheckState = CheckState.Unchecked;
}
else //if (mustBeChecked.CheckState == CheckState.Unchecked)
{
rendererData.CheckState = CheckBoxStates.CheckedHot;
mustBeChecked.CheckState = CheckState.Checked;
}
e.Table.Invalidate(CalcCheckRectangle());
mustBeChecked = null;
}
}