Пример #1
0
 public void Render(GraphicsBuffer buffer)
 {
     buffer.DrawHorizontalLine(topRow, leftColumn, width, borderColor);
     buffer.DrawHorizontalLine(topRow + height - 1, leftColumn, width, borderColor);
     buffer.DrawVerticalLine(topRow, leftColumn + width, height, borderColor);
     buffer.FillRect(topRow + 1, leftColumn, position, height - 2, fillColor);
     if (unfilledColor != null)
         buffer.FillRect(topRow + 1, leftColumn + position, width - position, height - 2, unfilledColor.Value);
 }
Пример #2
0
        public override void Render(GraphicsBuffer buffer)
        {
            if (!Visible)
                return;

            var colorScheme = Pushed ? scheme.Inverse : scheme;

            buffer.DrawHorizontalLine(topRow, leftColumn, width - 1, colorScheme.Lighter);
            buffer.DrawVerticalLine(topRow, leftColumn, height, colorScheme.Lighter);
            buffer.DrawHorizontalLine(topRow + 1, leftColumn + 1, width - 3, colorScheme.Light);
            buffer.DrawVerticalLine(topRow + 1, leftColumn + 1, height - 2, colorScheme.Light);
            buffer.FillRect(topRow + 2, leftColumn + 2, width - 4, height - 4, colorScheme.LightDark);
            buffer.DrawHorizontalLine(topRow + height - 2, leftColumn + 2, width - 3, colorScheme.Dark);
            buffer.DrawVerticalLine(topRow + 1, leftColumn + width - 2, height - 2, colorScheme.Dark);
            buffer.DrawHorizontalLine(topRow + height - 1, leftColumn + 1, width - 1, colorScheme.Darker);
            buffer.DrawVerticalLine(topRow, leftColumn + width - 1, height, colorScheme.Darker);

            var textTopRow = topRow + (height - font.Height + 1) / 2;
            var textLeftColumn = leftColumn + (width - font.MeasureString(text)) / 2;
            font.DrawString(buffer, textTopRow, textLeftColumn, text, colorScheme);
        }
Пример #3
0
 private static void DrawGridLines(GraphicsBuffer buffer)
 {
     buffer.DrawFrame(40, 16, 32, 16, Color.Gray);
     buffer.DrawVerticalLine(40, 32, 16, Color.Gray);
     buffer.DrawFrame(40, 112, 32, 16, Color.Gray);
     buffer.DrawVerticalLine(40, 128, 16, Color.Gray);
     buffer.DrawFrame(64, 0, 32, 48, Color.Gray);
     buffer.DrawFrame(64, 128, 32, 48, Color.Gray);
     buffer.DrawFrame(120, 0, 32, 16, Color.Gray);
     buffer.DrawVerticalLine(120, 16, 16, Color.Gray);
     buffer.DrawFrame(120, 128, 32, 16, Color.Gray);
     buffer.DrawVerticalLine(120, 144, 16, Color.Gray);
     buffer.DrawFrame(40, 192, 48, 48, Color.Gray);
     buffer.DrawVerticalLine(40, 208, 48, Color.Gray);
     buffer.DrawVerticalLine(40, 224, 48, Color.Gray);
     buffer.DrawHorizontalLine(56, 192, 48, Color.Gray);
     buffer.DrawHorizontalLine(72, 192, 48, Color.Gray);
     buffer.DrawFrame(104, 192, 64, 16, Color.Gray);
     buffer.DrawFrame(119, 192, 17, 16, Color.Gray);
     buffer.DrawFrame(119, 240, 16, 16, Color.Gray);
     buffer.DrawVerticalLine(104, 208, 16, Color.Gray);
     buffer.DrawVerticalLine(104, 224, 16, Color.Gray);
     buffer.DrawVerticalLine(104, 240, 16, Color.Gray);
     buffer.DrawFrame(152, 0, 320, 48, Color.Gray);
     buffer.DrawHorizontalLine(168, 0, 320, Color.Gray);
     buffer.DrawHorizontalLine(184, 0, 320, Color.Gray);
     for (var column = 16; column < 320; column += 16)
         buffer.DrawVerticalLine(152, column, 48, Color.Gray);
 }