📄 cmux_man.bak
字号:
/* ┌───────────────────────┐
** │ AMC V 3.0 多级弹出菜单自动生成工具 │
** └───────────────────────┘
** 变量和使用说明:
** wflag 菜单重写状态, 为 0 则重写, 为 1 则不重写
*/
#include <conio.h>
#include <graphics.h>
#include <stdlib.h>
#include "tcutil.H"
#define Maxx 639
#define Maxy 479
#define OUT 255
MENUSTRU menu00 = {0, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0x71, 0x74, 4, 0, 80, 0};
MENUSTRU menu11 = {1, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0x71, 0x24, 0, 2, 80, 0};
MENUSTRU menu21 = {1, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0x71, 0x24, 0,14, 80, 0};
MENUSTRU menu22 = {1, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0x71, 0x24, 0,14, 80, 0};
MENUSTRU menu12 = {1, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0x71, 0x24, 0, 2, 80, 0};
MENUSTRU menu13 = {1, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0x71, 0x24, 0, 6, 80, 0};
MENUSTRU menu14 = {1, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0x71, 0x24, 0, 1, 80, 0};
main()
{
setmode(0); /* 设显视方式 */
cursor(0); /* 隐藏光标 */
fpoly(0,0,Maxx,Maxy-47,9,0x7f);
sub_menu_00(); /* 主菜单 */
cursor(1); /* 显示光标 */
closegraph();
return 0;
}
/*=======================================*/
int sub_menu_00()
{
char *pp[4] =
{
"端 口 选 择 ",
"监 控 系 统 ",
"系 统 设 定 ",
"初 始 配 置 "
};
char *pps[4] =
{
" Select:→ ← ↑ ↓ Enter Esc 选择站点",
" Select:→ ← ↑ ↓ Enter Esc 设备操作",
" Select:→ ← ↑ ↓ Enter Esc 控制系统硬件设定",
" Select:→ ← ↑ ↓ Enter Esc 端口网络表设定"
//Right→
//Left←
//Up↑
//Down↓
// "选择站点:西关、曙光、北门、东四、青年街、宏伟、光华、东京陵、弓长岭、首山、灯塔",
// "设备操作",
// "控制系统硬件设定",
// "端口网络表设定"
};
int c = 0,wflag = 0;
int x[4] = { 1, 20, 39, 58 };
int y[4] = { 1, 1, 1, 1 };
WINDOWSTRU winp = { 1, 1, 80, 3, 0x7f, 6, 0, 1, NULL };
WINDOWSTRU winps = { 1, 24, 80, 25, 0x74, 1, 0, 0, NULL };
menu00.win = &winp; menu00.winp = &winps; menu00.pp = pp;
menu00.x = x; menu00.y = y; menu00.pps = pps;
save_win(&winp); save_win(&winps);
for(;;)
{ if(c == OUT)
{ fpoly(0,0,Maxx,Maxy-47,9,0x7f);
wflag = 0;
menu00.status = 0;
}
window(40,19,80,19);
printf("辽阳本地网传输监测系统 Ver1.0");
window(50,21,80,21);
printf("辽阳市电信局 P.C.M.");
c = menu_run(&menu00,c,wflag);
wflag = 1;
if(c == Esc && menu00.status == 0){
rest_win(&winp); rest_win(&winps);
return c;
}
switch(menu00.ch){
case 0 : /*端 口 选 择 */
c = sub_menu_11();
break;
case 1 : /*监 控 系 统 */
c = sub_menu_12();
break;
case 2 : /*系 统 设 定 */
c = sub_menu_13();
break;
case 3 : /*初 始 配 置 */
c = sub_menu_14();
break;
}
if(c == Esc) menu00.status = 0;
}
}
/*=======================================*/
int sub_menu_11()
{
char *pp[2] =
{
" 1) 西关局",
" 2) 曙光局",
};
char *pps[2] =
{
" Select:→ ← ↑ ↓ Enter Esc 选择本地局--> 西关局 (SELECT LOCAL STATION:212)",
" Select:→ ← ↑ ↓ Enter Esc 选择本地局--> 曙光局 (SELECT LOCAL STATION:412)",
};
int c = 0,wflag = 0;
int x[2] = { 1, 1 };
int y[2] = { 1, 2 };
WINDOWSTRU winp = { 1, 3, 12, 6, 0x7f, 6, 0, 1, NULL };
WINDOWSTRU winps = { 1, 24, 80, 25, 0x74, 1, 0, 0, NULL };
menu11.win = &winp; menu11.winp = &winps; menu11.pp = pp;
menu11.x = x; menu11.y = y; menu11.pps = pps;
save_win(&winp); save_win(&winps);
do{
c = menu_run(&menu11,c,wflag);
wflag = 1;
if(c == LEFT || c == RIGHT || c == Esc){
rest_win(&winp); rest_win(&winps);
return c;
}
switch(menu11.ch){
case 0 : /*西关站 */
c = sub_menu_21();
break;
case 1 : /*曙光站 */
c = sub_menu_22();
break;
}
if(c == Esc) menu11.status = 0;
}while(c != OUT);
rest_win(&winp); rest_win(&winps);
return c;
}
/*=======================================*/
int sub_menu_21()
{
char *pp[14] =
{
"--西关局",
"--曙光局",
"--北门局",
"--东四局",
"--青年街",
"--宏伟区",
"--光华局",
"--东京陵",
"--弓长岭",
"--辽阳县",
"--灯塔县",
"--辽化厂",
"--长途局",
"--移动局"
};
char *pps[14] =
{
" Select:→ ← ↑ ↓ Enter Esc 西关--西关局 (212)",
" Select:→ ← ↑ ↓ Enter Esc 西关--曙光局 (412)",
" Select:→ ← ↑ ↓ Enter Esc 西关--北门局 (313)",
" Select:→ ← ↑ ↓ Enter Esc 西关--东四局 (314)",
" Select:→ ← ↑ ↓ Enter Esc 西关--青年街 (230)",
" Select:→ ← ↑ ↓ Enter Esc 西关--宏伟区 (516)",
" Select:→ ← ↑ ↓ Enter Esc 西关--光华局 (530)",
" Select:→ ← ↑ ↓ Enter Esc 西关--东京陵 (316)",
" Select:→ ← ↑ ↓ Enter Esc 西关--弓长岭 (511)",
" Select:→ ← ↑ ↓ Enter Esc 西关--辽阳县 (717)",
" Select:→ ← ↑ ↓ Enter Esc 西关--灯塔县 (818)",
" Select:→ ← ↑ ↓ Enter Esc 西关--辽化厂 (511)",
" Select:→ ← ↑ ↓ Enter Esc 西关--长途局 (ATS)",
" Select:→ ← ↑ ↓ Enter Esc 西关--移动局 (MOV)"
};
unsigned int c = 0,wflag = 0;
int x[14] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
int y[14] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 };
WINDOWSTRU winp = { 13, 4, 24, 19, 0x7f, 6, 0, 1, NULL };
WINDOWSTRU winps = { 1, 24, 80, 25, 0x74, 1, 0, 0, NULL };
menu21.win = &winp; menu21.winp = &winps; menu21.pp = pp;
menu21.x = x; menu21.y = y; menu21.pps = pps;
save_win(&winp); save_win(&winps);
do{
c = menu_run(&menu21,c,wflag);
wflag = 1;
if(c == LEFT || c == RIGHT || c == Esc){
rest_win(&winp); rest_win(&winps);
return c;
}
switch(menu21.ch){
case 0 : /*--西关*/
if( (c == Enter)||( c == UEnter) ){
cmux_cmd("1\x00\x0d");
system("mode co80"); system("wsmenu.exe"); cursor(0);
c = OUT;
}
else
c = 0;
break;
case 1 : /*--曙光*/
if(c == Enter || c == UEnter){
cmux_cmd("1\x01\x0d");
system("mode co80");system("wsmenu.exe"); cursor(0);
c = OUT;
}
else
c = 0;
break;
case 2 : /*--北门*/
if(c == Enter || c == UEnter){
cmux_cmd("1\x02\x0d");
system("mode co80");system("wsmenu.exe"); cursor(0);
c = OUT;
}
else
c = 0;
break;
case 3 : /*--东四*/
if(c == Enter || c == UEnter){
cmux_cmd("1\x03\x0d");
system("mode co80");system("wsmenu.exe"); cursor(0);
c = OUT;
}
else
c = 0;
break;
case 4 : /*--201 */
if(c == Enter || c == UEnter){
cmux_cmd("1\x04\x0d");
system("mode co80");system("wsmenu.exe"); cursor(0);
c = OUT;
}
else
c = 0;
break;
case 5 : /*--宏伟*/
if(c == Enter || c == UEnter){
cmux_cmd("1\x05\x0d");
system("mode co80");system("wsmenu.exe"); cursor(0);
c = OUT;
}
else
c = 0;
break;
case 6 : /*--光华*/
if(c == Enter || c == UEnter){
cmux_cmd("1\x06\x0d");
system("mode co80");system("wsmenu.exe"); cursor(0);
c = OUT;
}
else
c = 0;
break;
case 7 : /*--东京陵*/
if(c == Enter || c == UEnter){
cmux_cmd("1\x07\x0d");
system("mode co80");system("wsmenu.exe"); cursor(0);
c = OUT;
}
else
c = 0;
break;
case 8 : /*--弓长岭*/
if(c == Enter || c == UEnter){
cmux_cmd("1\x08\x0d");
system("mode co80");system("wsmenu.exe"); cursor(0);
c = OUT;
}
else
c = 0;
break;
case 9 : /*--辽阳县*/
if(c == Enter || c == UEnter){
cmux_cmd("1\x09\x0d");
system("mode co80");system("wsmenu.exe"); cursor(0);
c = OUT;
}
else
c = 0;
break;
case 10 : /*--灯塔县*/
if(c == Enter || c == UEnter){
cmux_cmd("1\x0a\x0d");
system("mode co80");system("wsmenu.exe"); cursor(0);
c = OUT;
}
else
c = 0;
break;
case 11 : /*--辽化厂*/
if(c == Enter || c == UEnter){
cmux_cmd("1\x0b\x0d");
system("mode co80");system("wsmenu.exe"); cursor(0);
c = OUT;
}
else
c = 0;
break;
case 12 : /*--长途局*/
if(c == Enter || c == UEnter){
cmux_cmd("1\x0c\x0d");
system("mode co80");system("wsmenu.exe"); cursor(0);
c = OUT;
}
else
c = 0;
break;
case 13 : /*--移动局*/
if(c == Enter || c == UEnter){
cmux_cmd("1\x0d\x0d");
system("mode co80");system("wsmenu.exe"); cursor(0);
c = OUT;
}
else
c = 0;
break;
}
if(c == Esc) menu21.status = 0;
}while(c != OUT);
rest_win(&winp); rest_win(&winps);
return c;
}
/*=======================================*/
int sub_menu_22()
{
char *pp[14] =
{
"--西关局",
"--曙光局",
"--北门局",
"--东四局",
"--青年街",
"--宏伟区",
"--光华局",
"--东京陵",
"--弓长岭",
"--辽阳县",
"--灯塔县",
"--辽化厂",
"--长途局",
"--移动局"
};
char *pps[14] =
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -