Exemple #1
0
 public override void Draw(Out.ClipWriterAsync writer)
 {
     base.Draw(writer);
     if (rawImage == null)
     {
         for (int x = 0; x < Width; ++x)
         {
             for (int y = 0; y < Height; ++y)
             {
                 writer.SetWriterRelPos(x, y);
                 writer.Write(" ", Color.White, AlternativeColor);
             }
         }
     }
     else
     {
         if (ShownImage == null)
         {
             BuildImage(false);
         }
         if (Colors == null)
         {
             GetColors();
         }
         for (int x = 0; x < Width; ++x)
         {
             for (int y = 0; y < Height; ++y)
             {
                 writer.SetWriterRelPos(x, y);
                 writer.Write(" ", Color.White, Colors[x, y]);
             }
         }
     }
 }
Exemple #2
0
        public override void Draw(Out.ClipWriterAsync writer)
        {
            base.Draw(writer);
            //ChangeSize
            Y     = writer.Owner.Matrix.Height - 2;
            Width = writer.Owner.Matrix.Width;

            writer = writer.ownerWriter.CreatePartialWriter(X, Y, Width, Height);
            writer.BeginWrite();
            //Top-Splitter
            writer.SetWriterRelPos(0, 0);
            var time = " " + DateTime.Now.ToShortTimeString() + " ";

            writer.Write(new string('─', Width - time.Length - 1) + "┬" + new string('─', time.Length), SplitterColor, Background);
            writer.SetWriterRelPos(0, 1);
            writer.Write(new string(' ', Width - time.Length - 1), Foreground, Background);
            writer.Write('|', SplitterColor, Background);
            writer.Write(time, Foreground, Background);
            //Menu-Label
            if (Menu != null)
            {
                writer.SetWriterRelPos(0, 1);
                writer.Write(Menu.Text, ConsoleColor.Black, System.Drawing.Color.LightGreen);
            }
            writer.EndWrite();
            //Menu
            if (Menu != null)
            {
                writer = writer.ownerWriter.CreatePartialWriter(0, 0, Width, writer.Owner.Matrix.Height);
                writer.BeginWrite();
                Menu.Draw(writer);
                writer.EndWrite();
            }
        }
Exemple #3
0
 public void Draw(Out.ClipWriterAsync writer)
 {
     for (int i = Count - 1; i >= 0; --i)
     {
         var w = writer.CreatePartialWriter(this[i].X, this[i].Y, this[i].Width, this[i].Height);
         w.BeginWrite();
         this[i].Draw(w);
         w.EndWrite();
     }
 }
Exemple #4
0
        public override void Draw(Out.ClipWriterAsync writer)
        {
            Background.Width  = Width = writer.Owner.Matrix.Width;
            Background.Height = Height = writer.Owner.Matrix.Height - 2;

            writer = writer.ownerWriter.CreatePartialWriter(0, 0, Width, Height);
            writer.BeginWrite();
            Background.Draw(writer);
            base.Draw(writer);
            Forms.Draw(writer);
            writer.EndWrite();
        }
Exemple #5
0
 public void DrawElements(Out.ClipWriterAsync writer)
 {
     for (int i = 0; i < Count; ++i)
     {
         if (this[i].Visible)
         {
             var w = writer.CreatePartialWriter(this[i].X, this[i].Y, this[i].Width, this[i].Height);
             w.BeginWrite();
             this[i].Draw(w);
             w.EndWrite();
         }
     }
 }
Exemple #6
0
        public override void Draw(Out.ClipWriterAsync writer)
        {
            base.Draw(writer);

            ExtendedConsoleColor tc = TextColor, tb = TextBackground, bc = BoundColor, bb = BoundBackground;

            writer.SetWriterRelPos(0, 0);
            writer.Write(doubleBounds ? '╔' : '┌', bc, bb);
            writer.Write(new string(doubleBounds ? '═' : '─', Width - 2), bc, bb);
            writer.Write(doubleBounds ? '╗' : '┐', bc, bb);
            writer.SetWriterRelPos(0, 1);
            writer.Write(doubleBounds ? '║' : '|', bc, bb);
            writer.Write(new string(' ', (Width - 2 - text.Length) / 2), tc, tb);
            writer.Write(text, tc, tb);
            writer.Write(new string(' ', (Width - 2 - text.Length) - (Width - 2 - text.Length) / 2), tc, tb);
            writer.Write(doubleBounds ? '║' : '|', bc, bb);
            writer.SetWriterRelPos(0, 2);
            writer.Write(doubleBounds ? '╚' : '└', bc, bb);
            writer.Write(new string(doubleBounds ? '═' : '─', Width - 2), bc, bb);
            writer.Write(doubleBounds ? '╝' : '┘', bc, bb);
        }
Exemple #7
0
        public override void Draw(Out.ClipWriterAsync writer)
        {
            base.Draw(writer);
            writer.SetWriterRelPos(0, 0);
            var s = Text.PadRight(Width - 2, ' ');

            if (s.Length > Width - 2)
            {
                s = s.Remove(Width - 2);
            }
            writer.Write(s, ConsoleColor.Black, BackgroundColor);
            writer.Write("X", ConsoleColor.White, ConsoleColor.DarkRed);
            writer.Write(" ", ConsoleColor.White, BackgroundColor);
            for (int i = 1; i < Height - 1; ++i)
            {
                writer.SetWriterRelPos(0, i);
                writer.Write(" ", ConsoleColor.White, BackgroundColor);
                writer.SetWriterRelPos(Width - 1, i);
                writer.Write(" ", ConsoleColor.White, BackgroundColor);
            }
            writer.SetWriterRelPos(0, Height - 1);
            s = baseString.PadRight(Width, ' ');
            if (s.Length > Width)
            {
                s = s.Remove(Width);
            }
            writer.Write(s, ConsoleColor.Black, BackgroundColor);
            for (int i = 1; i < Height - 1; ++i)
            {
                writer.SetWriterRelPos(1, i);
                writer.Write(new string(' ', Width - 2), ConsoleColor.White, ContentColor);
            }
            var w = writer.CreatePartialWriter(1, 1, Width - 2, Height - 2);

            w.BeginWrite();
            Container.DrawElements(w);
            w.EndWrite();
        }
Exemple #8
0
 public override void Draw(Out.ClipWriterAsync writer)
 {
     if (!Opened)
     {
         return;
     }
     base.Draw(writer);
     writer.SetWriterRelPos(X, Y);
     writer.Write(new string(' ', Width), Color.White, Color.Gray);
     for (int i = 0; i < Submenu.Count; ++i)
     {
         writer.SetWriterRelPos(X, Y + i + 1);
         writer.Write((" " + Submenu[i].text + (Submenu[i].Submenu.Count > 0 ? " >" : "")).PadRight(Width, ' '), Color.Black, Color.Gray);
     }
     writer.SetWriterRelPos(X, Y + Submenu.Count + 1);
     writer.Write(new string(' ', Width), Color.White, Color.Gray);
     foreach (var m in Submenu)
     {
         if (m.Opened)
         {
             m.Draw(writer);
         }
     }
 }
Exemple #9
0
 public virtual void Draw(Out.ClipWriterAsync writer)
 {
 }
Exemple #10
0
 public override void Draw(Out.ClipWriterAsync writer)
 {
     base.Draw(writer);
     Elements.DrawElements(writer);
 }