Ejemplo n.º 1
0
int vtsend_draw_box(
        vtsend_t *p,
        const int x1, const int y1, const int x2, const int y2)
{
    int i;

    vtsend_cursor_position(p, x1, y1);
    for (i = x1; i <= x2; i++) {
        p->uart_write(" ", 1);
    }
    vtsend_cursor_position(p, x1, y2);
    for (i = x1; i <= x2; i++) {
        p->uart_write(" ", 1);
    }
    for (i = y1; i <= y2; i++) {
        vtsend_cursor_position(p, x1, i);
        p->uart_write(" ", 1);
        vtsend_cursor_position(p, x2, i);
        p->uart_write(" ", 1);
    }
    return 0;
}
Ejemplo n.º 2
0
int vtsend_fill_box(
        vtsend_t *p,
        const int x1, const int y1, const int x2, const int y2)
{
    int i, j;
    for (i = y1; i <= y2; i++) {
        vtsend_cursor_position(p, x1, i);
        for (j = x1; j <= x2; j++) {
            p->uart_write(" ", 1);
        }
    }
    return 0;
}
Ejemplo n.º 3
0
int vtsend_draw_box(
        vtsend_t *p,
        const int x1, const int y1, const int x2, const int y2)
{
    int i;

    vtsend_cursor_position(p, x1, y1);
    for (i = x1; i <= x2; i++) {
        UART_WRITE(p, " ", 1);
    }
    vtsend_cursor_position(p, x1, y2);
    for (i = x1; i <= x2; i++) {
        UART_WRITE(p, " ", 1);
    }
    for (i = y1; i <= y2; i++) {
        vtsend_cursor_position(p, x1, i);
        UART_WRITE(p, " ", 1);
        vtsend_cursor_position(p, x2, i);
        UART_WRITE(p, " ", 1);
    }
    return 0;
}