This commit is contained in:
2011-03-30 15:50:40 +00:00
parent 0d79abd34d
commit e439f31c1f
3 changed files with 740 additions and 36 deletions

View File

@@ -779,16 +779,23 @@ namespace Volian.Controls.Library
int y1 = bounds.Top;
int x2 = bounds.Right - 1;
int y2 = bounds.Bottom - 1;
//Console.WriteLine("{0},{1},{2},{3},{4},{5},{6}", e.Row, e.Col, (e.Style ?? Styles.Normal).Name, lineTop, lineLeft, lineBottom, lineRight);
// We should look at the results of the following for Focus Style
Color bColor = Color.Blue; // Temporary - Set the border color to blue.
GridItem myGridItem = Parent as GridItem;
if (myGridItem == null) return;
if ((e.Style ?? Styles.Normal).Name == "Focus")
{
if (lineRight == GridLinePattern.Thick || lineRight == GridLinePattern.Double)
lineRight = GridLinePattern.Single;
if (lineBottom == GridLinePattern.Thick || lineBottom == GridLinePattern.Double)
lineBottom = GridLinePattern.Single;
}
GridItem myGridItem = Parent as GridItem;
if (myGridItem == null) return;
if (row == 0 && lineTop != GridLinePattern.None)
{
Pen pn = VlnBorders.LinePen(lineTop, bColor);
GridLinePattern lineTopLeft = cr.c1 == 0 ? GridLinePattern.None : MyBorders.HorizontalLines[cr.r1, cr.c1 - 1];
//GridLinePattern lineTopLeft = cr.c1 == 0 ? GridLinePattern.None : MyBorders.HorizontalLines[cr.r1, cr.c1 - 1];
GridLinePattern lineTopRight = cr.c2 == Cols.Count - 1 ? GridLinePattern.None : MyBorders.HorizontalLines[cr.r1, cr.c2 + 1];
int dxTop = col == 0 ? (lineLeft == GridLinePattern.Double ? -3 :-1): 0;
int dxTop = col == 0 ? (lineLeft == GridLinePattern.Double || lineLeft == GridLinePattern.Thick ? -3 : -1) : 0;
int dx = col == 0 ? -1 : 0;
using (Graphics grParent = myGridItem.CreateGraphics())
{
@@ -810,9 +817,9 @@ namespace Volian.Controls.Library
if (col == 0 && lineLeft != GridLinePattern.None)
{
Pen pn = VlnBorders.LinePen(lineLeft, bColor);
GridLinePattern lineLeftAbove = cr.r1 == 0 ? GridLinePattern.None : MyBorders.VerticalLines[cr.r1 - 1, cr.c1];
//GridLinePattern lineLeftAbove = cr.r1 == 0 ? GridLinePattern.None : MyBorders.VerticalLines[cr.r1 - 1, cr.c1];
GridLinePattern lineLeftBelow = cr.r2 == Rows.Count - 1 ? GridLinePattern.None : MyBorders.VerticalLines[cr.r2 + 1, cr.c1];
int dyLeft = row == 0 ? (lineTop == GridLinePattern.Double ? -3:-1) : 0;
int dyLeft = row == 0 ? (lineLeft == GridLinePattern.Double || lineLeft == GridLinePattern.Thick ? -3 : -1) : 0;
int dy = row == 0 ? -1 : 0;
//GridItem myGridItem = Parent as GridItem;
using (Graphics grParent = myGridItem.CreateGraphics())
@@ -831,9 +838,9 @@ namespace Volian.Controls.Library
grParent.DrawLine(pn, x1 + Left - 2, y1 + Top + dyLeft, x1 + Left - 2, y2 + Top + 1);
}
}
GridLinePattern lineBottomLeft = cr.c1 == 0 ? GridLinePattern.None : MyBorders.HorizontalLines[cr.r2 + 1, cr.c1 - 1];
//GridLinePattern lineBottomLeft = cr.c1 == 0 ? GridLinePattern.None : MyBorders.HorizontalLines[cr.r2 + 1, cr.c1 - 1];
GridLinePattern lineBottomRight = cr.c2 == Cols.Count - 1 ? GridLinePattern.None : MyBorders.HorizontalLines[cr.r2 + 1, cr.c2 + 1];
GridLinePattern lineRightAbove = cr.r1 == 0 ? GridLinePattern.None : MyBorders.VerticalLines[cr.r1 - 1, cr.c2 + 1];
//GridLinePattern lineRightAbove = cr.r1 == 0 ? GridLinePattern.None : MyBorders.VerticalLines[cr.r1 - 1, cr.c2 + 1];
GridLinePattern lineRightBelow = cr.r2 == Rows.Count - 1 ? GridLinePattern.None : MyBorders.VerticalLines[cr.r2 + 1, cr.c2 + 1];
if (lineBottom != GridLinePattern.None)
{