09.05.2006, 11:09
общий
это ответ
Здравствуйте, W4rmonger!
Не хочешь мыло давать, вот в приложении смотри. Правда кодировка изменена, придется самостоятельно тебе символы всевдографики переопределить.
Приложение:
#ifndef mymenu#define mymenu#include <conio.h>#include <bios.h>const char head[17] = " Меню";inline void textbkcolor(int tclr,int bkclr) { textbackground(bkclr); textcolor(tclr);}void graphcap(int cap) { switch(cap) { case 1:cprintf("г=============================┐");return; case 2:cprintf("│=============================│");return; case 3:cprintf("L=============================-");return; }}int Menugui(const char *menu[],const ITEMS,const char *header = head, const BKCLR = 0, const TXTCLR = 7, const shifth = 24,int shiftv = 2) { register i, item = 1; int temp = shiftv; union keys { int i; char ch[2]; } key; textbkcolor(TXTCLR, BKCLR); clrscr(); do { shiftv = temp; gotoxy(shifth, shiftv++); graphcap(1); gotoxy(shifth, shiftv++); cprintf("│%-29s│", header); gotoxy(shifth, shiftv++); graphcap(2); if (key.ch[1] == 72) item--; else if (key.ch[1] == 80) item++; else if (key.ch[0] > 48 && key.ch[0] <= ITEMS+48) item = key.ch[0] - 48; if (item <= 0) item = ITEMS; else if (item > ITEMS) item = 1; for (i = 0; i < ITEMS; i++) { gotoxy(shifth, shiftv++); cprintf("│"); if (item == i + 1) textbkcolor(BKCLR, TXTCLR); cprintf("%1d.%-27s", i+1, menu[i]); textbkcolor(TXTCLR, BKCLR); cprintf("│"); } gotoxy(shifth, i+5); textbkcolor(TXTCLR, BKCLR); graphcap(2); gotoxy(shifth, i+6); cprintf("│ Ваш выбор:%-18d│", item); gotoxy(shifth, i+7); graphcap(3); gotoxy(shifth+12, i+6); key.i = bioskey(0); } while (key.ch[0] != 13); gotoxy(1, i + 8); return item;}#endif