📄 interface.h
字号:
////////////////////////////////////////////////////////////////////////////////////
//该头文件用来进行有关界面的设置
#define TRUE 1
#define NULL 0
#define FALSE -1
void setSystem();
void userlog();
void showMenu1();
void showMenu2();
void showMenu3();
void showMenu4();
void welcome(int);
void setSystem()
{
system("title 〖文本编辑器〗 Version[1.0]");//设置应用程序的标题
system("color 1A");//设置应用程的前景和背景
}
void userlog()//登录函数
{
cout<<endl<<endl;
int bell=7;
printf("%c",bell);
cout<<" * * * * "<<endl;
cout<<" ↗ ↘ ↗ ↘ ↗ ↘ ↗ ↘ "<<endl;
cout<<" * 文 ** 本 ∷ ∷ 编 ** 辑 *"<<endl;
cout<<" ↖ ↙ ↖ ↙ ↖ ↙ ↖ ↙ "<<endl;
cout<<" * * * * "<<endl<<endl;
cout<<" ------- 欢迎使用该文本编辑程序,请登录!退出请键入'Q'-------"<<endl<<endl;
cout<<endl<<endl<<" 用户名: ";
char name[5];
while(TRUE)
{
cin>>name;
if(strcmp(name,"sdut")==0)
break;
else if(strcmp(name,"Q")==0||strcmp(name,"q")==0)
exit(0);
else
{
cout<<" 对不起,您输入的用户名有误!请重新输入,退出请键入'Q':\n";
continue;
}
}
system("cls");
}
void showMenu1()//显示主菜单
{
int bell=7;
printf("%c",bell);
system("cls");
cout<<endl;
cout<<" 〓 ☆ 文 本 编 辑 器 ☆ 〓 \n";
cout<<" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n";
cout<<" --------- 欢迎使用该文本编辑程序!请选择菜单!---------\n";
cout<<endl;
cout<<" (A): 输入文本\n\n";
cout<<" (B): 浏览输入文本\n\n";
cout<<" (C): 文本内容统计\n\n";
cout<<" (D): 字符串综合处理(查找、删除……)\n\n";
cout<<" (E): 关于系统信息\n\n";
cout<<" (Q): 退出程序\n";
cout<<" Initial CopyRight: WDD&LHC \n";
cout<<" **********************************************************************\n";
cout<<" 请您键入菜单字母代码:";
}
void showMenu2()//字符串操作菜单
{
system("cls");
cout<<endl;
cout<<" --------- 欢迎使用本程序!请选择字串操作菜单!---------\n";
cout<<endl;
cout<<" (1): 统计该字串在文章中出现的次数\n\n";
cout<<" (2): 删除该字符串\n\n";
cout<<" (3): 回显文章\n\n";
cout<<" (4): 回到初始程序菜单\n\n";
cout<<" (5): 放弃操作并退出程序\n\n";
cout<<" **********************************************************************\n";
cout<<" 请您键入数字字母代码:";
}
void showMenu3()//字符串删除菜单
{
system("cls");
cout<<endl;
cout<<" --------- 欢迎使用本程序!请选择字串操作菜单!---------\n";
cout<<endl;
cout<<" (1): 将模式串从文章中全部删除\n\n";
cout<<" (2): 将模式串从特定的行中删除\n\n";
cout<<" **********************************************************************\n";
cout<<" 请您键入数字字母代码:";
}
void showMenu4()//字符串处理完毕后显示的主菜单
{
int bell=7;
printf("%c",bell);
system("cls");
cout<<endl;
cout<<" 〓 ☆ 文 本 编 辑 器 ☆ 〓 \n";
cout<<" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n";
cout<<" --------- 欢迎使用该文本编辑程序!请选择菜单!---------\n";
cout<<endl;
cout<<" (A): 文本内容统计\n\n";
cout<<" (B): 关于系统信息\n\n";
cout<<" (Q): 退出程序\n";
cout<<" Initial CopyRight: WDD&LHC \n";
cout<<" **********************************************************************\n";
cout<<" 请您键入菜单字母代码:";
}
void welcome(int flag)
{
int bell=7;
printf("%c",bell);
if(int i=flag==0)
cout<<" ------- 欢迎使用该简单文本编辑程序!^_^--------\n\n";
else if(i=flag=1)
cout<<" --------------------------------------------"<<endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -