📄 cexitframe.cpp
字号:
#include "CExitFrame.h"
#include "interface.h"
#include "check_char.h"
#include "CPrintMessage.h "
#include "conio.h"
#include "data_cmp.h"
#include <iostream>
#include <string>
using namespace std;
void CExitFrame:: printExitFrame()
{
system("cls");
string str[3]={"are you sure to exit?","1.yes,exit system now","0.no,return"};
int num;
printTitle("Exit System");
printOption(str,3);
while( !(num=inputctrl(1)));
switch(num)
{
case 2:
exit(0);
case 1:
break;
default:
break;
}
}
/////////////////////////////////////////////////////
int CExitFrame::inputctrl(int n)
{
cout<<" please make a choice 0-"<<n<<":";
char ch_input = getche();
if(!(C_check_char::checkChar(ch_input)==1))
{
CPrintMessage::printMessage(C_check_char::checkChar(ch_input));
system("pause");
return 0;
}
else
{
if(!(C_check_cmp::check_char(ch_input,n)==1))
{
CPrintMessage::printMessage(C_check_cmp::check_char(ch_input,n));
system("pause");
return 0;
}
else
{
if(ch_input=='0')
{
return 1;
}
if(ch_input=='1')
{
return 2;
}
}
}
return -1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -