X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/5b88d390025d7b91d0e0d2c6c63fef166b8d20f1..558540cc250c19c9617a3f3f12a0f5da38c9c84a:/emufs_gui/gui.c diff --git a/emufs_gui/gui.c b/emufs_gui/gui.c index 22475cd..a25ec54 100644 --- a/emufs_gui/gui.c +++ b/emufs_gui/gui.c @@ -8,6 +8,7 @@ #include "form.h" #include "articulos.h" +#include "facturas.h" #include "emufs.h" #define CTRLD 4 @@ -20,11 +21,12 @@ void menu_articulos(); int main(int argc, char *argv[]) { int c, fin=0; - if (argc != 2) { - printf("Modo de uso : %s archivo_de_articulos.xml\n", argv[0]); - return 1; - } +/* art_cargar(argv[1]); + + art_liberar(NULL); + return 1; +*/ /* Inicio Curses */ signal(SIGINT, finish); initscr(); @@ -53,7 +55,11 @@ int main(int argc, char *argv[]) return 1; } - art_cargar(argv[1]); + if (argc == 2) { + art_cargar(argv[1]); + fact_cargar(argv[1]); + } else + art_cargar(NULL); /* Ventana, caracter para linea vertical, caracter para linea horizontal*/ box(stdscr, ACS_VLINE, ACS_HLINE); @@ -83,9 +89,8 @@ int main(int argc, char *argv[]) endwin(); art_liberar(NULL); + fact_liberar(NULL); - - MD_Listar(); return 0; } @@ -114,16 +119,16 @@ void menu_articulos() items[4] = NULL; menu = new_menu((ITEM **)items); - menu_win = newwin(8, 68, 3, 1); + menu_win = newwin(8, COLS-2, 3, 1); keypad(menu_win, TRUE); set_menu_mark(menu, " > "); set_menu_win(menu, menu_win); - set_menu_sub(menu, derwin(menu_win, 5, 66, 3, 1)); + set_menu_sub(menu, derwin(menu_win, 5, COLS-4, 3, 1)); box(menu_win, 0, 0); mvwaddch(menu_win, 2, 0, ACS_LTEE); - mvwhline(menu_win, 2, 1, ACS_HLINE, 67); - mvwaddch(menu_win, 2, 67, ACS_RTEE); + mvwhline(menu_win, 2, 1, ACS_HLINE, COLS-3); + mvwaddch(menu_win, 2, COLS-3, ACS_RTEE); wattron(menu_win, COLOR_PAIR(COLOR_RED)); mvwaddstr(menu_win, 1, 1, "Menu Articulos"); wattroff(menu_win, COLOR_PAIR(COLOR_RED)); @@ -200,16 +205,16 @@ int main_menu() items[5] = NULL; menu = new_menu((ITEM **)items); - menu_win = newwin(9, 68, 3, 1); + menu_win = newwin(9, COLS-2, 3, 1); keypad(menu_win, TRUE); set_menu_mark(menu, " > "); set_menu_win(menu, menu_win); - set_menu_sub(menu, derwin(menu_win, 6, 66, 3, 1)); + set_menu_sub(menu, derwin(menu_win, 6, COLS-4, 3, 1)); box(menu_win, 0, 0); mvwaddch(menu_win, 2, 0, ACS_LTEE); - mvwhline(menu_win, 2, 1, ACS_HLINE, 67); - mvwaddch(menu_win, 2, 67, ACS_RTEE); + mvwhline(menu_win, 2, 1, ACS_HLINE, COLS-3); + mvwaddch(menu_win, 2, COLS-3, ACS_RTEE); wattron(menu_win, COLOR_PAIR(COLOR_RED)); mvwaddstr(menu_win, 1, 1, "Menu Principal"); wattroff(menu_win, COLOR_PAIR(COLOR_RED));