X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/8f84e53bb26e345469f615091701a2d8f2c92273..af17bf78b31b1cdb1ed6823344bb945add1700e2:/gui/form.c diff --git a/gui/form.c b/gui/form.c index d6a13bb..21e7d48 100644 --- a/gui/form.c +++ b/gui/form.c @@ -90,23 +90,33 @@ void form_ejecutar(t_Form *f, int x, int y) /* Pongo las etiquetas de los campos, y me fijo el mayor offset */ while (tmp) { my_y++; - mvwaddstr(f->win, my_y, x, tmp->nombre); - waddch(f->win, ':'); - waddch(f->win, ' '); if (strlen(tmp->nombre) > offset) offset = strlen(tmp->nombre); tmp = tmp->sig; } /* Agrego el ": " al offset*/ - x += offset + 2; + offset += 2; tmp = f->primero; my_y = y-1; while (tmp) { ++my_y; - wmove(f->win, my_y, x); - salida = tmp->ejecutar(f->win, x, my_y, tmp); + mvwaddstr(f->win, my_y, x, tmp->nombre); + waddch(f->win, ':'); + waddch(f->win, ' '); + mvwaddstr(f->win, my_y, x+offset, tmp->valor); + tmp = tmp->sig; + } + wrefresh(f->win); + + tmp = f->primero; + my_y = y-1; + while (tmp) { + ++my_y; + wmove(f->win, my_y, x+offset); + salida = tmp->ejecutar(f->win, x+offset, my_y, tmp); + wrefresh(f->win); tmp = tmp->sig; } } @@ -208,12 +218,13 @@ int form_input(WINDOW *win, int x, int y, t_Widget *w) char *tmp = w->valor; int current = 0, c; mvwaddstr(win, y, x, w->valor); - + curs_set(1); while ((*tmp) != '\0') { tmp++; current++; } + wrefresh(win); while ((c=getch()) != 13) { /* Verifico si se apreto basckspace */ if (c == KEY_BACKSPACE) { @@ -224,6 +235,7 @@ int form_input(WINDOW *win, int x, int y, t_Widget *w) waddch(win, ' '); /* Este va para dejar el cursor bien, ya que addch mueve el cursor*/ wmove(win, y, x+current); + wrefresh(win); continue; } /* Si no entra mas, ignoro toda entrada */ @@ -232,6 +244,7 @@ int form_input(WINDOW *win, int x, int y, t_Widget *w) wmove(win, y, x+current); waddch(win, c); w->valor[current++] = c; + wrefresh(win); } /* Cierro el string con el \0 */ w->valor[current+1] = '\0'; @@ -263,6 +276,7 @@ int form_radio(WINDOW *win, int x, int y, t_Widget *w) wmove(win, y, xs[actual]); waddch(win, 'X'); + wrefresh(win); while ((c=getch()) != 13) { if (c == KEY_LEFT) { wmove(win, y, xs[actual]); @@ -280,6 +294,7 @@ int form_radio(WINDOW *win, int x, int y, t_Widget *w) wmove(win, y, xs[actual]); waddch(win, 'X'); } + wrefresh(win); } w->actual = actual;