/* MENU.C */ #include #include #include #include "aman.h" void menu_Enable(char, int, char[], int); char menu_Main(char *File) { char s[2]; char c[5]; int i; scr_draw_logo (" "); scr_lang (HEBREW); scr_goto(70, 8); menu_Enable (1, 0, c, 0); scr_out(" "); if (*File) scr_out(" (%s : ) ", File); scr_goto(70, 10); menu_Enable (*File, 1, c, 1); scr_out(""); scr_goto(70, 12); menu_Enable (FileExists(File, "DSK") && is_file_later(change_file_ext(File, "DSK"), File), 2, c, 2); scr_out(""); scr_goto(70, 14); menu_Enable (1, 9, c, 3); scr_out(" "); l1: scr_goto(60, 19); scr_attrib(SCR_NORMAL); scr_prompt_input(" ", s, 1, HEBREW, ENGLISH, YES); i = s[0] - '0'; if (i == 9) return MENU_EXIT; if (i >= 0 && i <= 2) if (c[i] == YES) switch (i) { case 0: return MENU_FILE; case 1: return MENU_EDIT; case 2: return MENU_PRINT; } scr_error(NO, " %s%s%s%s : ", c[4] ? " 9 " : "", c[2] ? " 2 " : "", c[1] ? " 1 " : "", c[0] ? " 0 " : ""); goto l1; } void menu_File(char *File) { scr_draw_logo (" "); scr_lang (HEBREW); scr_goto(70, 6); if (*File) scr_out("(%s : ) ", File); scr_goto(70, 8); scr_prompt_input(" ", File, 20, HEBREW, ENGLISH, NO); } void menu_Enable(char cond, int i, char c[], int j) { if (cond) { scr_attrib(SCR_BOLD); scr_out(" .%1d", i); scr_attrib(SCR_NORMAL); c[j] = YES; } else { scr_out(" "); c[j] = NO; } }