X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/e5b2b618bddda6961cfaa7c8af844245f240b300..fa2ca26bfc143d13fd444628480dd7512a9a7bb9:/gui/form.c diff --git a/gui/form.c b/gui/form.c index 38d9373..21e7d48 100644 --- a/gui/form.c +++ b/gui/form.c @@ -90,23 +90,32 @@ 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; + 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); - salida = tmp->ejecutar(f->win, x, my_y, tmp); + wmove(f->win, my_y, x+offset); + salida = tmp->ejecutar(f->win, x+offset, my_y, tmp); wrefresh(f->win); tmp = tmp->sig; } @@ -209,7 +218,7 @@ 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++; @@ -226,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 */