X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/881d70c97e3314ad76b7eabefe22e80137fba0c6..91245c4c700e6740b4d00e1f36b02e05ff96dabd:/emufs_gui/form.c diff --git a/emufs_gui/form.c b/emufs_gui/form.c index 9e5cb57..b8907a0 100644 --- a/emufs_gui/form.c +++ b/emufs_gui/form.c @@ -92,7 +92,7 @@ void form_agregar_widget(t_Form *f, t_Campo tipo, const char *nombre, unsigned i void form_ejecutar(t_Form *f, int x, int y) { - int offset = 0, my_y, salida; + int offset = 0, my_y, salida, i; t_Widget *tmp = f->primero; my_y = y-1; @@ -115,8 +115,20 @@ void form_ejecutar(t_Form *f, int x, int y) mvwaddstr(f->win, my_y, x, tmp->nombre); waddch(f->win, ':'); waddch(f->win, ' '); - /* TODO : VER QUE SI ES UNA OPCION ES DISTINTO!! */ - mvwaddstr(f->win, my_y, x+offset, tmp->valor); + if (tmp->tipo == INPUT){ + for(i=0; imax; i++) + mvwaddch(f->win, my_y, x+offset+i, ' '); + mvwaddstr(f->win, my_y, x+offset, tmp->valor); + } else { + wmove(f->win, my_y, x+offset); + for(i=0; imax; i++) { + waddch(f->win, '('); + waddch(f->win, ' '); + waddch(f->win, ')'); + waddstr(f->win, tmp->opciones[i]); + waddch(f->win, ' '); + } + } tmp = tmp->sig; } wrefresh(f->win); @@ -371,3 +383,16 @@ void form_es_modificable(t_Form *f, const char *widget, int b) } } +void form_set_valor(t_Form *f, const char *widget, const char *s) +{ + /* Busco el widget */ + t_Widget *tmp = f->primero; + while (tmp) { + if (strcmp(widget, tmp->nombre) == 0) { + strcpy(tmp->valor, s); + break; + } + tmp = tmp->sig; + } +} +