Rescope() public method

public Rescope ( int xIncrement, int yIncrement, int w, int h ) : void
xIncrement int
yIncrement int
w int
h int
return void
Ejemplo n.º 1
0
        protected override void OnPaint(ConsoleBitmap context)
        {
            var borderChar = new ConsoleCharacter(' ', Foreground, BorderColor);

            context.DrawRect(borderChar, 0, 0, Width, Height - 1);
            context.DrawLine(borderChar, 1, 1, 1, Height - 1);
            context.DrawLine(borderChar, Width - 2, 1, Width - 2, Height - 1);
            // todo - that minus 3 should be a 2, but I'm not sure why this makes it work.
            // I'm afraid there's an off by 1 somewhere deep in the code that processes rectangles.
            // I'll need to investigate at some point. If I end up fixing that bug then it's likely this line
            // will stop working.  So if it ever looks like the content of this panel is not having it's last line
            // painted then it's likely that I fixed the other bug and this this.Height - 3 needs to be changed to a this.Height - 2.
            context.Rescope(2, 1, this.Width - 4, this.Height - 3);
            base.OnPaint(context);
        }
Ejemplo n.º 2
0
 protected override void OnPaint(ConsoleBitmap context)
 {
     foreach (var control in Controls)
     {
         Rectangle scope = context.GetScope();
         try
         {
             context.Rescope(control.X, control.Y, control.Width, control.Height);
             control.Paint(context);
         }
         finally
         {
             context.Scope(scope);
         }
     }
 }
Ejemplo n.º 3
0
 internal override void OnPaint(ConsoleBitmap context)
 {
     foreach (var control in Controls)
     {
         Rectangle scope = context.GetScope();
         try
         {
             context.Rescope(control.X, control.Y, control.Width, control.Height);
             control.Paint(context);
         }
         finally
         {
             context.Scope(scope);
         }
     }
 }
Ejemplo n.º 4
0
 protected override void OnPaint(ConsoleBitmap context)
 {
     foreach (var control in GetPaintOrderedControls())
     {
         Rectangle scope = context.GetScope();
         try
         {
             context.Rescope(control.X, control.Y, control.Width, control.Height);
             if (control.Width > 0 && control.Height > 0)
             {
                 control.Paint(context);
             }
         }
         finally
         {
             context.Scope(scope);
         }
     }
 }
Ejemplo n.º 5
0
        internal void Paint(ConsoleBitmap context)
        {
            Rectangle scope = context.GetScope();

            if (Background != ConsoleControl.TransparantColor)
            {
                context.Pen = Background;
                context.FillRect(0, 0, Width, Height);
            }

            try
            {
                context.Rescope(this.X, this.Y, this.Width, this.Height);
                context.Pen = this.Foreground;
                OnPaint(context);
            }
            finally
            {
                context.Scope(scope);
            }
        }
Ejemplo n.º 6
0
        internal void Paint(ConsoleBitmap context)
        {
            Rectangle scope = context.GetScope();

            if (Background != ConsoleControl.TransparantColor)
            {
                context.Pen = Background;
                context.FillRect(0, 0, Width, Height);
            }

            try
            {
                context.Rescope(this.X, this.Y, this.Width, this.Height);
                context.Pen = this.Foreground;
                OnPaint(context);
            }
            finally
            {
                context.Scope(scope);
            }
        }