X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/e44976130072017b4bd9bcb0444887f480d2a7f2..27dcebf2414a7fe37fa130561d14d8bf29e9b12d:/emufs_gui/form.c diff --git a/emufs_gui/form.c b/emufs_gui/form.c index d86d4b1..9e5cb57 100644 --- a/emufs_gui/form.c +++ b/emufs_gui/form.c @@ -80,6 +80,7 @@ void form_agregar_widget(t_Form *f, t_Campo tipo, const char *nombre, unsigned i /* Si se creo wl widget, lo agrego al formulario al final */ if (tmp) { + tmp->modificable = 1; if (f->primero == NULL) { f->primero = f->ultimo = tmp; } else { @@ -126,7 +127,8 @@ void form_ejecutar(t_Form *f, int x, int y) while (tmp) { ++my_y; wmove(f->win, my_y, x+offset); - salida = tmp->ejecutar(f->win, x+offset, my_y, tmp); + if (tmp->modificable) + salida = tmp->ejecutar(f->win, x+offset, my_y, tmp); wrefresh(f->win); tmp = tmp->sig; } @@ -356,3 +358,16 @@ int form_radio(WINDOW *win, int x, int y, t_Widget *w) return 0; } +void form_es_modificable(t_Form *f, const char *widget, int b) +{ + /* Busco el widget */ + t_Widget *tmp = f->primero; + while (tmp) { + if (strcmp(widget, tmp->nombre) == 0) { + tmp->modificable = b; + break; + } + tmp = tmp->sig; + } +} +