|
|
@ -22,7 +22,9 @@ namespace Rs.Controls
|
|
|
|
public enum ESortDir
|
|
|
|
public enum ESortDir
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LeftToRight,
|
|
|
|
LeftToRight,
|
|
|
|
RightToLeft
|
|
|
|
RightToLeft,
|
|
|
|
|
|
|
|
RightTopToBottom,
|
|
|
|
|
|
|
|
LeftBottomToTop
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public enum ESlotStatus
|
|
|
|
public enum ESlotStatus
|
|
|
@ -95,6 +97,27 @@ namespace Rs.Controls
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool _ShowRowNumber;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 是否显示行号
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public bool ShowRowNumber
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get { return _ShowRowNumber; }
|
|
|
|
|
|
|
|
set { _ShowRowNumber = value; }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool _ShowColNumber;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 是否显示列号
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public bool ShowColNumber
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get { return _ShowColNumber; }
|
|
|
|
|
|
|
|
set { _ShowColNumber = value; }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public RsTray()
|
|
|
|
public RsTray()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
InitializeComponent();
|
|
|
@ -184,7 +207,7 @@ namespace Rs.Controls
|
|
|
|
set { _HeadText = value; this.label1.Text = value; }
|
|
|
|
set { _HeadText = value; this.label1.Text = value; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int _RowNum = 26;
|
|
|
|
private int _RowNum = 16;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 行数
|
|
|
|
/// 行数
|
|
|
@ -195,7 +218,7 @@ namespace Rs.Controls
|
|
|
|
set { _RowNum = value; InitSlot(InitSlotStatus); Invalidate(); }
|
|
|
|
set { _RowNum = value; InitSlot(InitSlotStatus); Invalidate(); }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int _ColumnNum = 10;
|
|
|
|
private int _ColumnNum = 16;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 列数量
|
|
|
|
/// 列数量
|
|
|
@ -387,6 +410,48 @@ namespace Rs.Controls
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (sortDir == ESortDir.RightTopToBottom)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//从列开始画
|
|
|
|
|
|
|
|
for (int r = RowNum; r > 0; r--)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
for (int c = 0; c < ColumnNum; c++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
index++;
|
|
|
|
|
|
|
|
if (traySlotsDic.ContainsKey(index))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
float x = slotWidth * r;
|
|
|
|
|
|
|
|
float y = slotHeight * c;
|
|
|
|
|
|
|
|
traySlotsDic[index].Bound = new RectangleF(x, y, (int)slotWidth - ColSpace, (int)slotHeight - RowSpace);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (sortDir == ESortDir.LeftBottomToTop)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//从列开始画
|
|
|
|
|
|
|
|
for (int r = 0; r < RowNum; r++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
for (int c = ColumnNum; c > 0; c--)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
index++;
|
|
|
|
|
|
|
|
if (traySlotsDic.ContainsKey(index))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
float y = 0;
|
|
|
|
|
|
|
|
float x = LeftSpaceWidth + slotWidth * r;
|
|
|
|
|
|
|
|
if(!ShowColNumber)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
y = slotHeight * c - TopSpaceHeight / 2;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
y = slotHeight * c;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
traySlotsDic[index].Bound = new RectangleF(x, y, (int)slotWidth - ColSpace, (int)slotHeight - RowSpace);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
panel2.Refresh();
|
|
|
|
panel2.Refresh();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -409,22 +474,33 @@ namespace Rs.Controls
|
|
|
|
{
|
|
|
|
{
|
|
|
|
index++;
|
|
|
|
index++;
|
|
|
|
if (r == 0)
|
|
|
|
if (r == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(ShowRowNumber)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//画料盘的列号
|
|
|
|
//画料盘的列号
|
|
|
|
if (SortDir == ESortDir.LeftToRight)
|
|
|
|
if (SortDir == ESortDir.LeftToRight)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g2.DrawString((c+ 1).ToString(), new Font("宋体", 7.0F), new SolidBrush(Color.White), new PointF(LeftSpaceWidth + (widthPer * c) + 5, 5));
|
|
|
|
g2.DrawString((c + 1).ToString(), new Font("宋体", 7.0F), new SolidBrush(Color.White), new PointF(LeftSpaceWidth + (widthPer * c) + 5, 5));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(SortDir== ESortDir.RightToLeft)
|
|
|
|
else if (SortDir == ESortDir.RightToLeft)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g2.DrawString((ColumnNum - c).ToString(), new Font("宋体", 7.0F), new SolidBrush(Color.White), new PointF(LeftSpaceWidth + (widthPer * c) + 5, 5));
|
|
|
|
g2.DrawString((ColumnNum - c).ToString(), new Font("宋体", 7.0F), new SolidBrush(Color.White), new PointF(LeftSpaceWidth + (widthPer * c) + 5, 5));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (SortDir == ESortDir.LeftBottomToTop)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//g2.DrawString((ColumnNum - c).ToString(), new Font("宋体", 7.0F), new SolidBrush(Color.White), new PointF(LeftSpaceWidth + (widthPer * c) + 5, 5));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (c == 0)
|
|
|
|
if (c == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(ShowColNumber)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//画料盘的行号
|
|
|
|
//画料盘的行号
|
|
|
|
g2.DrawString((r + 1).ToString(), new Font("宋体", 7.0F), new SolidBrush(Color.White), new PointF(5, TopSpaceHeight + (heightPer * r)));
|
|
|
|
g2.DrawString((r + 1).ToString(), new Font("宋体", 7.0F), new SolidBrush(Color.White), new PointF(5, TopSpaceHeight + (heightPer * r)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if (traySlotsDic.ContainsKey(index))
|
|
|
|
if (traySlotsDic.ContainsKey(index))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
traySlotsDic[index].Draw(g2, ShowText);
|
|
|
|
traySlotsDic[index].Draw(g2, ShowText);
|
|
|
|