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); }
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); } }
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); } }
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; }