Пример #1
0
        protected override void RenderOverride(IRenderFrame frame)
        {
            frame.FillRect(0, 0, frame.Width, frame.Height, Foreground, Background, (char)SpecialChars.Fill);

            for (int i = 0; i < Children.Count; i++)
            {
                var location = GetLocation(Children[i]);
                Children[i].Render(frame.GetGraphicsBuffer(location));
            }

            base.RenderOverride(frame);
        }
Пример #2
0
 protected override void RenderOverride(IRenderFrame frame)
 {
     for (int i = 0; i < Children.Count; i++)
     {
         var location = GetLocation(Children[i]);
         if (!location.IntersectsWith(frame.Clip))
         {
             Children[i].Render(null);
             continue;
         }
         Children[i].Render(frame.GetGraphicsBuffer(location));
         if (location.Left > 0)
         {
             frame.FillRect(0, (int)location.Top, (int)location.Left, (int)location.Height, Foreground, Background, (char)SpecialChars.Fill);
         }
         if (frame.Width - location.Right > 0)
         {
             frame.FillRect((int)location.Right, (int)location.Top, (int)(frame.Width - location.Right), (int)location.Height, Foreground, Background, (char)SpecialChars.Fill);
         }
     }
 }
Пример #3
0
        protected override sealed void RenderCore(IRenderFrame frame)
        {
            frame.FillRect(0, 0, Padding.Left, Padding.Top, Foreground, Background, (char)SpecialChars.Fill);
            frame.FillRect(frame.Width - Padding.Right - Padding.Left, 0, Padding.Right, Padding.Top, Foreground, Background, (char)SpecialChars.Fill);
            frame.FillRect(0, frame.Height - Padding.Top - Padding.Bottom, Padding.Left, Padding.Bottom, Foreground, Background, (char)SpecialChars.Fill);
            frame.FillRect(frame.Width - Padding.Right - Padding.Left, frame.Height - Padding.Top - Padding.Bottom, Padding.Right, Padding.Bottom, Foreground, Background, (char)SpecialChars.Fill);

            frame.FillRect(Padding.Left, 0, frame.Width - Padding.Left - Padding.Right, Padding.Top, Foreground, Background, (char)SpecialChars.Fill);
            frame.FillRect(0, Padding.Top, Padding.Left, frame.Height - Padding.Top - Padding.Bottom, Foreground, Background, (char)SpecialChars.Fill);
            frame.FillRect(Padding.Left, frame.Height - Padding.Bottom, frame.Width - Padding.Left - Padding.Right, Padding.Bottom, Foreground, Background, (char)SpecialChars.Fill);
            frame.FillRect(frame.Width - Padding.Right, Padding.Top, Padding.Right, frame.Height - Padding.Bottom - Padding.Top, Foreground, Background, (char)SpecialChars.Fill);

            if (Padding.Left + Padding.Right >= frame.Width || Padding.Top + Padding.Bottom >= frame.Height)
            {
                return; // Not enough Place to draw content.
            }
            RenderOverride(frame.GetGraphicsBuffer(new Rect(Padding.Left, Padding.Top, frame.Width - Padding.Right - Padding.Left, frame.Height - Padding.Bottom - Padding.Top)));
        }
Пример #4
0
 protected override void RenderOverride(IRenderFrame frame)
 {
     RenderBorder(frame);
     if (Child != null)
     {
         var borderThikness = BorderThikness;
         var borderWith     = borderThikness.Left + borderThikness.Right;
         var borderHeight   = borderThikness.Top + borderThikness.Bottom;
         Child.Render(frame.GetGraphicsBuffer(new Rect(borderThikness.Left, borderThikness.Top, frame.Width - borderWith, frame.Height - borderHeight), frame.Clip));
     }
     else
     {
         var borderThikness = BorderThikness;
         var borderWith     = borderThikness.Left + borderThikness.Right;
         var borderHeight   = borderThikness.Top + borderThikness.Bottom;
         frame.FillRect(borderThikness.Left, borderThikness.Top, frame.Width - borderWith, frame.Height - borderHeight, IsDisabled ? ForegroundDisabled : Foreground, IsDisabled ? BackgroundDisabled : Background, (char)SpecialChars.Fill);
     }
 }