public ApplyCursor ( CellContext sender, |
||
sender | CellContext | |
e | ||
return | void |
//Non uso questo evento altrimenti non verrebbero applicate le regole di selezione del tasto Shift // public override void OnClick(PositionEventArgs e) // { // base.OnClick (e); // // sender.Grid.Rows[sender.Position.Row].Focus(); // } public override void OnMouseMove(CellContext sender, MouseEventArgs e) { base.OnMouseMove(sender, e); Rectangle l_CellRect = sender.Grid.PositionToRectangle(sender.Position); Point l_MousePoint = new Point(e.X, e.Y); float distance; DevAge.Drawing.RectanglePartType partType = LogicalBorder.GetPointPartType(l_CellRect, l_MousePoint, out distance); if (partType == DevAge.Drawing.RectanglePartType.ContentArea) { mSelectionCursor.ApplyCursor(sender, e); } }
public override void OnMouseMove(CellContext sender, MouseEventArgs e) { base.OnMouseMove(sender, e); Rectangle cellRect = sender.Grid.PositionToRectangle(sender.Position); if (cellRect.IsEmpty) { return; } Point mousePoint = new Point(e.X, e.Y); float dummy; DevAge.Drawing.RectanglePartType partType = LogicalBorder.GetPointPartType(cellRect, mousePoint, out dummy); //sono gi?in fase di resizing if (sender.Grid.MouseDownPosition == sender.Position) { if (m_IsWidthResize) { int newWidth = mousePoint.X - cellRect.Left; if (newWidth > 0) { SetWidth(sender.Grid, sender.Position, (int)(newWidth + mDistanceFromBorder)); } mWidthCursor.ApplyCursor(sender, e); mHeightCursor.ResetCursor(sender, e); } else if (m_IsHeightResize) { int newHeight = mousePoint.Y - cellRect.Top; if (newHeight > 0) { SetHeight(sender.Grid, sender.Position, (int)(newHeight + mDistanceFromBorder)); } mHeightCursor.ApplyCursor(sender, e); mWidthCursor.ResetCursor(sender, e); } } else { if (partType == DevAge.Drawing.RectanglePartType.RightBorder && (ResizeMode & CellResizeMode.Width) == CellResizeMode.Width) { mWidthCursor.ApplyCursor(sender, e); } else if (partType == DevAge.Drawing.RectanglePartType.BottomBorder && (ResizeMode & CellResizeMode.Height) == CellResizeMode.Height) { mHeightCursor.ApplyCursor(sender, e); } else { mWidthCursor.ResetCursor(sender, e); mHeightCursor.ResetCursor(sender, e); } } }