本文整理汇总了C#中XPTable.Models.CellPos类的典型用法代码示例。如果您正苦于以下问题:C# CellPos类的具体用法?C# CellPos怎么用?C# CellPos使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CellPos类属于XPTable.Models命名空间,在下文中一共展示了CellPos类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnMouseUp
/// <summary>
/// Raises the MouseUp event
/// </summary>
/// <param name="e">A MouseEventArgs that contains the event data</param>
protected override void OnMouseUp(MouseEventArgs e)
{
base.OnMouseUp(e);
if (!this.CanRaiseEvents)
{
return;
}
// work out the current state of play
this.CalcTableState(e.X, e.Y);
TableRegion region = this.HitTest(e.X, e.Y);
if (e.Button == MouseButtons.Left)
{
// if the left mouse button was down for a cell,
// Raise a mouse up for that cell
if (!this.LastMouseDownCell.IsEmpty)
{
if (this.IsValidCell(this.LastMouseDownCell))
{
this.RaiseCellMouseUp(this.LastMouseDownCell, e);
}
// reset the lastMouseDownCell
this.lastMouseDownCell = CellPos.Empty;
}
// if we have just finished resizing, it might
// be a good idea to relayout the table
if (this.resizingColumnIndex != -1)
{
if (this.resizingColumnWidth != -1)
{
this.DrawReversibleLine(this.ColumnRect(this.resizingColumnIndex).Left + this.resizingColumnWidth);
}
this.ColumnModel.Columns[this.resizingColumnIndex].Width = this.resizingColumnWidth;
this.resizingColumnIndex = -1;
this.resizingColumnWidth = -1;
this.UpdateScrollBars();
this.Invalidate(this.PseudoClientRect, true);
}
// check if the mouse was released in a column header
if (region == TableRegion.ColumnHeader)
{
int column = this.ColumnIndexAt(e.X, e.Y);
// if we are in the header, check if we are in the pressed column
if (this.pressedColumn != -1)
{
if (this.pressedColumn == column)
{
if (this.hotColumn != -1 && this.hotColumn != column)
{
this.ColumnModel.Columns[this.hotColumn].InternalColumnState = ColumnState.Normal;
}
this.ColumnModel.Columns[this.pressedColumn].InternalColumnState = ColumnState.Hot;
this.RaiseHeaderMouseUp(column, e);
}
this.pressedColumn = -1;
// only sort the column if we have rows to sort
if (this.ColumnModel.Columns[column].Sortable)
{
if (this.TableModel != null && this.TableModel.Rows.Count > 0)
{
this.Sort(column);
}
}
this.Invalidate(this.HeaderRectangle, false);
}
return;
}
// the mouse wasn't released in a column header, so if we
// have a pressed column then we need to make it unpressed
if (this.pressedColumn != -1)
{
this.pressedColumn = -1;
this.Invalidate(this.HeaderRectangle, false);
}
}
}
开发者ID:nithinphilips,项目名称:SMOz,代码行数:98,代码来源:Table.cs
示例2: RemoveCells
/// <summary>
/// Removes the Cells located between the specified start and end CellPos from the
/// current selection
/// </summary>
/// <param name="start">A CellPos that specifies the start Cell</param>
/// <param name="end">A CellPos that specifies the end Cell</param>
public void RemoveCells(CellPos start, CellPos end)
{
this.RemoveCells(start.Row, start.Column, end.Row, end.Column);
}
开发者ID:virl,项目名称:yttrium,代码行数:10,代码来源:TableModel.cs
示例3: SelectCells
/// <summary>
/// Replaces the currently selected Cells with the Cells located between the specified
/// start and end row/column indicies
/// </summary>
/// <param name="startRow">The row index of the start Cell</param>
/// <param name="startColumn">The column index of the start Cell</param>
/// <param name="endRow">The row index of the end Cell</param>
/// <param name="endColumn">The column index of the end Cell</param>
public void SelectCells(int startRow, int startColumn, int endRow, int endColumn)
{
int[] oldSelectedIndicies = this.SelectedIndicies;
this.InternalClear();
if (this.InternalAddCells(startRow, startColumn, endRow, endColumn))
{
this.owner.OnSelectionChanged(new SelectionEventArgs(this.owner, oldSelectedIndicies, this.SelectedIndicies));
}
this.shiftSelectStart = new CellPos(startRow, startColumn);
this.shiftSelectEnd = new CellPos(endRow, endColumn);
}
开发者ID:virl,项目名称:yttrium,代码行数:22,代码来源:TableModel.cs
示例4: Clear
/// <summary>
/// Removes all selected Rows and Cells from the selection
/// </summary>
public void Clear()
{
if (this.rows.Count > 0)
{
int[] oldSelectedIndicies = this.SelectedIndicies;
this.InternalClear();
this.shiftSelectStart = CellPos.Empty;
this.shiftSelectEnd = CellPos.Empty;
this.owner.OnSelectionChanged(new SelectionEventArgs(this.owner, oldSelectedIndicies, this.SelectedIndicies));
}
}
开发者ID:virl,项目名称:yttrium,代码行数:17,代码来源:TableModel.cs
示例5: RemoveCell
/// <summary>
/// Removes the Cell at the specified row and column indicies from the current selection
/// </summary>
/// <param name="cellPos">A CellPos that specifies the Cell to remove from the selection</param>
public void RemoveCell(CellPos cellPos)
{
this.RemoveCell(cellPos.Row, cellPos.Column);
}
开发者ID:virl,项目名称:yttrium,代码行数:8,代码来源:TableModel.cs
示例6: AddCell
/// <summary>
/// Adds the Cell at the specified row and column indicies to the current selection
/// </summary>
/// <param name="cellPos">A CellPos that specifies the Cell to add to the selection</param>
public void AddCell(CellPos cellPos)
{
this.AddCell(cellPos.Row, cellPos.Column);
}
开发者ID:virl,项目名称:yttrium,代码行数:8,代码来源:TableModel.cs
示例7: AddShiftSelectedCell
/// <summary>
/// Adds the Cells between the last selection start Cell and the Cell at the
/// specified row/column indicies to the current selection. Any Cells that are
/// between the last start and end Cells that are not in the new area are
/// removed from the current selection
/// </summary>
/// <param name="row">The row index of the shift selected Cell</param>
/// <param name="column">The column index of the shift selected Cell</param>
public void AddShiftSelectedCell(int row, int column)
{
int[] oldSelectedIndicies = this.SelectedIndicies;
if (this.shiftSelectStart == CellPos.Empty)
{
this.shiftSelectStart = new CellPos(0, 0);
}
bool changed = false;
if (this.shiftSelectEnd != CellPos.Empty)
{
changed = this.InternalRemoveCells(this.shiftSelectStart, this.shiftSelectEnd);
changed |= this.InternalAddCells(this.shiftSelectStart, new CellPos(row, column));
}
else
{
changed = this.InternalAddCells(0, 0, row, column);
}
if (changed)
{
this.owner.OnSelectionChanged(new SelectionEventArgs(this.owner, oldSelectedIndicies, this.SelectedIndicies));
}
this.shiftSelectEnd = new CellPos(row, column);
}
开发者ID:virl,项目名称:yttrium,代码行数:36,代码来源:TableModel.cs
示例8: table_MouseDoubleClick
void table_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (!AllowSelection) return;
int cindex = ColumnIndexAt(e.X, e.Y);
if (cindex!=0) return;
int rindex = RowIndexAt(e.X, e.Y, true); // take virtual row
if (rindex < 0) return;
if (TableModel.Rows.Count > rindex) return;
// we need to create new row and start edit mode
int rowsToAdd = rindex - TableModel.Rows.Count + 1;
while (rowsToAdd > 0)
{
VisualizeFilter("");
rowsToAdd--;
}
lastMouseCell = new CellPos(rindex, 0);
FocusedCell = lastMouseCell;
TableModel.Selections.SelectCell(lastMouseCell);
base.OnDoubleClick(e);
}
开发者ID:binaryage,项目名称:xrefresh,代码行数:24,代码来源:FilterTable.cs
示例9: button1_Click
private void button1_Click(object sender, System.EventArgs e)
{
CellPos cell = new CellPos((int)numericUpDown1.Value, 0);
table.TableModel.Selections.AddCell(cell);
table.EnsureVisible(cell);
}
开发者ID:antiduh,项目名称:XPTable,代码行数:6,代码来源:Demo.cs
示例10: CellRect
/// <summary>
/// Returns a Rectangle that specifies the size and location the cell at
/// the specified cell position in client coordinates
/// </summary>
/// <param name="cellPos">The position of the cell</param>
/// <returns>A Rectangle that specifies the size and location the cell at
/// the specified cell position in client coordinates</returns>
public Rectangle CellRect(CellPos cellPos)
{
return this.CellRect(cellPos.Row, cellPos.Column);
}
开发者ID:nithinphilips,项目名称:SMOz,代码行数:11,代码来源:Table.cs
示例11: TableUsingNumericCellEditor
/// <summary>
/// Gets whether the specified Table is using a NumericCellEditor to edit the
/// Cell at the specified CellPos
/// </summary>
/// <param name="table">The Table to check</param>
/// <param name="cellPos">A CellPos that represents the Cell to check</param>
/// <returns>true if the specified Table is using a NumericCellEditor to edit the
/// Cell at the specified CellPos, false otherwise</returns>
internal bool TableUsingNumericCellEditor(Table table, CellPos cellPos)
{
return (table.IsEditing && cellPos == table.EditingCell && table.EditingCellEditor is NumberCellEditor);
}
开发者ID:samuraitruong,项目名称:comitdownloader,代码行数:12,代码来源:NumberCellRenderer.cs
示例12: OnCellRemoved
/// <summary>
/// Raises the CellRemoved event
/// </summary>
/// <param name="e">A RowEventArgs that contains the event data</param>
protected internal virtual void OnCellRemoved(RowEventArgs e)
{
if (this.CanRaiseEvents)
{
this.InvalidateRow(e.Index);
if (CellRemoved != null)
{
CellRemoved(this, e);
}
if (e.CellFromIndex == -1 && e.CellToIndex == -1)
{
if (this.FocusedCell.Row == e.Index)
{
this.focusedCell = CellPos.Empty;
}
}
else
{
for (int i=e.CellFromIndex; i<=e.CellToIndex; i++)
{
if (this.FocusedCell.Row == e.Index && this.FocusedCell.Column == i)
{
this.focusedCell = CellPos.Empty;
break;
}
}
}
}
}
开发者ID:nithinphilips,项目名称:SMOz,代码行数:36,代码来源:Table.cs
示例13: Table
/*/// <summary>
/// Specifies whether pressing the Tab key while editing moves the
/// editor to the next available cell
/// </summary>
private bool tabMovesEditor;*/
#endregion
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the Table class with default settings
/// </summary>
public Table()
{
// starting setup
this.init = true;
// This call is required by the Windows.Forms Form Designer.
components = new System.ComponentModel.Container();
//
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.SetStyle(ControlStyles.Selectable, true);
this.TabStop = true;
this.Size = new Size(150, 150);
this.BackColor = Color.White;
//
this.columnModel = null;
this.tableModel = null;
// header
this.headerStyle = ColumnHeaderStyle.Clickable;
this.headerFont = this.Font;
this.headerRenderer = new XPHeaderRenderer();
//this.headerRenderer = new GradientHeaderRenderer();
//this.headerRenderer = new FlatHeaderRenderer();
this.headerRenderer.Font = this.headerFont;
this.headerContextMenu = new HeaderContextMenu();
this.columnResizing = true;
this.resizingColumnIndex = -1;
this.resizingColumnWidth = -1;
this.hotColumn = -1;
this.pressedColumn = -1;
this.lastSortedColumn = -1;
this.sortedColumnBackColor = Color.WhiteSmoke;
// borders
this.borderStyle = BorderStyle.Fixed3D;
// scrolling
this.scrollable = true;
this.hScrollBar = new HScrollBar();
this.hScrollBar.Visible = false;
this.hScrollBar.Location = new Point(this.BorderWidth, this.Height - this.BorderWidth - SystemInformation.HorizontalScrollBarHeight);
this.hScrollBar.Width = this.Width - (this.BorderWidth * 2) - SystemInformation.VerticalScrollBarWidth;
this.hScrollBar.Scroll += new ScrollEventHandler(this.OnHorizontalScroll);
this.Controls.Add(this.hScrollBar);
this.vScrollBar = new VScrollBar();
this.vScrollBar.Visible = false;
this.vScrollBar.Location = new Point(this.Width - this.BorderWidth - SystemInformation.VerticalScrollBarWidth, this.BorderWidth);
this.vScrollBar.Height = this.Height - (this.BorderWidth * 2) - SystemInformation.HorizontalScrollBarHeight;
this.vScrollBar.Scroll += new ScrollEventHandler(this.OnVerticalScroll);
this.Controls.Add(this.vScrollBar);
//
this.gridLines = GridLines.None;;
this.gridColor = SystemColors.Control;
this.gridLineStyle = GridLineStyle.Solid;
this.allowSelection = true;
this.multiSelect = false;
this.fullRowSelect = false;
this.hideSelection = false;
this.selectionBackColor = SystemColors.Highlight;
this.selectionForeColor = SystemColors.HighlightText;
this.unfocusedSelectionBackColor = SystemColors.Control;
this.unfocusedSelectionForeColor = SystemColors.ControlText;
this.selectionStyle = SelectionStyle.ListView;
this.alternatingRowColor = Color.Transparent;
// current table state
this.tableState = TableState.Normal;
this.lastMouseCell = new CellPos(-1, -1);
this.lastMouseDownCell = new CellPos(-1, -1);
this.focusedCell = new CellPos(-1, -1);
this.hoverTime = 1000;
//.........这里部分代码省略.........
开发者ID:nithinphilips,项目名称:SMOz,代码行数:101,代码来源:Table.cs
示例14: OnMouseMove
//.........这里部分代码省略.........
// is the default cursor (we may have just come from a
// resizing area)
this.Cursor = Cursors.Default;
}
// reset the last cell the mouse was over
this.ResetLastMouseCell();
return;
}
#endregion
// we're outside of the header, so if there is a hot column,
// it need to be reset
if (this.hotColumn != -1)
{
this.ColumnModel.Columns[this.hotColumn].InternalColumnState = ColumnState.Normal;
this.ResetHotColumn();
this.Cursor = Cursors.Default;
}
// if there is a pressed column, its state need to beset to normal
if (this.pressedColumn != -1)
{
this.ColumnModel.Columns[this.pressedColumn].InternalColumnState = ColumnState.Normal;
}
#region Cells
if (hitTest == TableRegion.Cells)
{
// find the cell the mouse is over
CellPos cellPos = new CellPos(this.RowIndexAt(e.X, e.Y), this.ColumnIndexAt(e.X, e.Y));
if (!cellPos.IsEmpty)
{
if (cellPos != this.lastMouseCell)
{
// check if the cell exists (ie is not null)
if (this.IsValidCell(cellPos))
{
CellPos oldLastMouseCell = this.lastMouseCell;
if (!oldLastMouseCell.IsEmpty)
{
this.ResetLastMouseCell();
}
this.lastMouseCell = cellPos;
this.RaiseCellMouseEnter(cellPos);
}
else
{
this.ResetLastMouseCell();
// make sure the cursor is the default cursor
// (we may have just come from a resizing area in the header)
this.Cursor = Cursors.Default;
}
}
else
{
this.RaiseCellMouseMove(cellPos, e);
}
开发者ID:nithinphilips,项目名称:SMOz,代码行数:67,代码来源:Table.cs
示例15:
public Cell this[CellPos cellPos]
{
get
{
return this[cellPos.Row, cellPos.Column];
}
}
开发者ID:virl,项目名称:yttrium,代码行数:7,代码来源:TableModel.cs
示例16: PrepareForEditing
/// <summary>
/// Prepares the CellEditor to edit the specified Cell
/// </summary>
/// <param name="cell">The Cell to be edited</param>
/// <param name="table">The Table that contains the Cell</param>
/// <param name="cellPos">A CellPos representing the position of the Cell</param>
/// <param name="cellRect">The Rectangle that represents the Cells location and size</param>
/// <param name="userSetEditorValues">Specifies whether the ICellEditors
/// starting value has already been set by the user</param>
/// <returns>true if the ICellEditor can continue editing the Cell, false otherwise</returns>
public virtual bool PrepareForEditing(Cell cell, Table table, CellPos cellPos, Rectangle cellRect, bool userSetEditorValues)
{
this.cell = cell;
this.table = table;
this.cellPos = cellPos;
this.cellRect = cellRect;
// check if the user has already set the editors value for us
if (!userSetEditorValues)
{
this.SetEditValue();
}
this.SetEditLocation(cellRect);
// raise the BeginEdit event
var e = new CellEditEventArgs(cell, this, table, cellPos.Row, cellPos.Column, cellRect)
{
Handled = userSetEditorValues
};
this.OnBeginEdit(e);
// if the edit has been canceled, remove the editor and return false
if (e.Cancel)
{
this.RemoveEditControl();
return false;
}
return true;
}
开发者ID:adarmus,项目名称:XPTable,代码行数:42,代码来源:CellEditor.cs
示例17: Selection
/// <summary>
/// Initializes a new instance of the TableModel.Selection class
/// that belongs to the specified TableModel
/// </summary>
/// <param name="owner">A TableModel representing the tableModel that owns
/// the Selection</param>
public Selection(TableModel owner)
{
if (owner == null)
{
throw new ArgumentNullException("owner", "owner cannot be null");
}
this.owner = owner;
this.rows = new ArrayList();
this.shiftSelectStart = CellPos.Empty;
this.shiftSelectEnd = CellPos.Empty;
}
开发者ID:virl,项目名称:yttrium,代码行数:19,代码来源:TableModel.cs
示例18: RemoveEditControl
/// <summary>
/// Conceals the editor from the user and removes it from the Table's
/// Control collection
/// </summary>
protected virtual void RemoveEditControl()
{
if (this.control != null)
{
this.control.Visible = false;
this.control.Parent = null;
}
if (this.table != null)
{
this.table.Focus();
}
this.cell = null;
this.table = null;
this.cellPos = CellPos.Empty;
this.cellRect = Rectangle.Empty;
}
开发者ID:adarmus,项目名称:XPTable,代码行数:22,代码来源:CellEditor.cs
示例19: AddCells
/// <summary>
/// Adds the Cells located between the specified start and end CellPos to the
/// current selection
/// </summary>
/// <param name="start">A CellPos that specifies the start Cell</param>
/// <param name="end">A CellPos that specifies the end Cell</param>
public void AddCells(CellPos start, CellPos end)
{
this.AddCells(start.Row, start.Column, end.Row, end.Column);
}
开发者ID:virl,项目名称:yttrium,代码行数:10,代码来源:TableModel.cs
示例20: CellEditor
/// <summary>
/// Initializes a new instance of the CellEditor class with default settings
/// </summary>
protected CellEditor()
{
this.control = null;
this.cell = null;
this.table = null;
this.cellPos = CellPos.Empty;
this.cellRect = Rectangle.Empty;
this.mouseMessageFilter = new MouseMessageFilter(this);
this.keyMessageFilter = new KeyMessageFilter(this);
}
开发者ID:adarmus,项目名称:XPTable,代码行数:14,代码来源:CellEditor.cs
注:本文中的XPTable.Models.CellPos类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论