Example #1
0
        public static int Draw(Widget widget, string str, int x, int y, int w, int h, out int endx, out int endy)
        {
            int xi = 0, yi = 0;
            int length = Each(str, delegate(char ch) {
                widget.Set(xi + x, yi + y, ch);

                xi++;
                if (xi >= w)
                {
                    xi = 0;
                    yi++;
                    if (yi >= h)
                    {
                        return(false);
                    }
                }
                return(true);
            });

            endx = xi + x;
            endy = yi + y;
            return(length);
        }
Example #2
0
 public static void DrawV(Widget widget, int x, int y, int height)
 {
     for (int i = 0; i < height; i++) {
         widget.Set(x, y + i, ACS.VLINE);
     }
 }
Example #3
0
 public static void DrawH(Widget widget, int x, int y, int width)
 {
     for (int i = 0; i < width; i++) {
         widget.Set(x + i, y, ACS.HLINE);
     }
 }
Example #4
0
		public static int Draw(Widget widget, string str, int x, int y, int w, int h, out int endx, out int endy)
		{
			int xi = 0, yi = 0;
			int length = Each(str, delegate (char ch) {
				widget.Set(xi + x, yi + y, ch);

				xi++;
				if (xi >= w) {
					xi = 0;
					yi++;
					if (yi >= h) {
						return false;
					}
				}
				return true;
			});
			endx = xi + x;
			endy = yi + y;
			return length;
		}