SVN r1005
SVN-Revision: r1005
This commit is contained in:
@@ -9772,4 +9772,41 @@ namespace Lskj.Control
|
|||||||
return Rectangle.Empty;
|
return Rectangle.Empty;
|
||||||
|
|
||||||
// 转换为网格控件内的坐标(关键修正)
|
// 转换为网格控件内的坐标(关键修正)
|
||||||
|
Point cellLocation = view.GridControl.PointToClient(
|
||||||
|
viewInfo.GridControl.PointToScreen(cellInfo.Bounds.Location)
|
||||||
|
);
|
||||||
|
|
||||||
|
return new Rectangle(
|
||||||
|
cellLocation.X,
|
||||||
|
cellLocation.Y,
|
||||||
|
cellInfo.Bounds.Width,
|
||||||
|
cellInfo.Bounds.Height
|
||||||
|
);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return Rectangle.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算按钮起始X坐标(支持左右对齐)
|
||||||
|
private int GetButtonStartX(int cellWidth, int totalButtonsWidth, bool isLeftAligned)
|
||||||
|
{
|
||||||
|
if (isLeftAligned)
|
||||||
|
{
|
||||||
|
// 靠左对齐:从单元格左侧开始
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 靠右对齐:从右侧减去总宽度
|
||||||
|
return cellWidth - totalButtonsWidth;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user