This commit is contained in:
parent
7193488913
commit
5877037beb
@ -155,6 +155,8 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
public void InitializeBorder(VlnFlexGrid myFlexGrid, CellRange myRange)
|
||||
{
|
||||
if (myRange.r1 == 0 && myRange.c1 == 0 && myRange.r2 == 2 && myRange.c2 == 2)
|
||||
Console.WriteLine("here");
|
||||
_TopBorder = GridLinePattern.Unknown;
|
||||
_InsideHorizontalBorder = GridLinePattern.Unknown;
|
||||
_BottomBorder = GridLinePattern.Unknown;
|
||||
@ -167,21 +169,21 @@ namespace Volian.Controls.Library
|
||||
CellRange cr = myFlexGrid.GetMergedRange(r, c);
|
||||
if (r == myRange.r1) // Top Border
|
||||
_TopBorder = CombinePattern(_TopBorder, myFlexGrid.MyBorders.HorizontalLines[cr.r1, cr.c1]);
|
||||
if (r == myRange.r1 && c == myRange.c1) // Left Border
|
||||
if (c == myRange.c1) // Left Border
|
||||
_LeftBorder = CombinePattern(_LeftBorder, myFlexGrid.MyBorders.VerticalLines[cr.r1, cr.c1]);
|
||||
if (r == myRange.r2) // Bottom Border
|
||||
_BottomBorder = CombinePattern(_BottomBorder, myFlexGrid.MyBorders.HorizontalLines[cr.r2+1, cr.c2]);
|
||||
if (r == myRange.r2 && c == myRange.c2) // Right Border
|
||||
if (c == myRange.c2) // Right Border
|
||||
_RightBorder = CombinePattern(_RightBorder, myFlexGrid.MyBorders.VerticalLines[cr.r2, cr.c2+1]);
|
||||
if (r == cr.r1 && c == cr.c1) // Look for inside lines
|
||||
{
|
||||
if (cr.r1 > myRange.r1 && cr.r1 < myRange.r2) // Inside Horizontal Top
|
||||
_InsideHorizontalBorder = CombinePattern(_InsideHorizontalBorder, myFlexGrid.MyBorders.HorizontalLines[cr.r1, cr.c1]);
|
||||
if (cr.r2 > myRange.r1 && cr.r2 < myRange.r2) // Inside Horizontal Bottom
|
||||
if (cr.r2+1 > myRange.r1 && cr.r2 < myRange.r2) // Inside Horizontal Bottom
|
||||
_InsideHorizontalBorder = CombinePattern(_InsideHorizontalBorder, myFlexGrid.MyBorders.HorizontalLines[cr.r2 +1, cr.c2]);
|
||||
if (cr.c1 > myRange.c1 && cr.c1 < myRange.c2) // Inside Vertical Left
|
||||
_InsideVerticalBorder = CombinePattern(_InsideVerticalBorder, myFlexGrid.MyBorders.VerticalLines[cr.r1, cr.c1]);
|
||||
if (cr.c2 > myRange.c1 && cr.c2 < myRange.c2) // Inside Vertical Right
|
||||
if (cr.c2+1 > myRange.c1 && cr.c2 < myRange.c2) // Inside Vertical Right
|
||||
_InsideVerticalBorder = CombinePattern(_InsideVerticalBorder, myFlexGrid.MyBorders.VerticalLines[cr.r2, cr.c2 + 1]);
|
||||
}
|
||||
c = cr.c2;//Skip to the end of the merged cells
|
||||
|
@ -226,6 +226,7 @@ namespace Volian.Controls.Library
|
||||
public class LinePatternArray
|
||||
{
|
||||
#region Properties
|
||||
protected static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private int _Rows;
|
||||
[XmlAttribute("Rows")]
|
||||
public int Rows
|
||||
@ -262,7 +263,13 @@ namespace Volian.Controls.Library
|
||||
#region Array Access
|
||||
public GridLinePattern this[int r, int c]
|
||||
{
|
||||
get { return Lines[r * Columns + c]; }
|
||||
get
|
||||
{
|
||||
int indx = r * Columns + c;
|
||||
if (indx < Lines.Length) return Lines[r * Columns + c];
|
||||
_MyLog.WarnFormat("GridLinePattern: Lines Array Access out-of-bounds ({0}, {1}) within ({2}, {3})", r, c, Rows, Columns);
|
||||
return GridLinePattern.Single;
|
||||
}
|
||||
set { Lines[r * Columns + c] = value; }
|
||||
}
|
||||
#endregion
|
||||
|
Loading…
x
Reference in New Issue
Block a user