📄 复件 login.c
字号:
WINDOW *Get_Cash_Face()
{
char title[] = "欢迎来到XXX超市";
WINDOW *win = Create_Win(25,80,0,0,YES,title,WHITE_BLACK);
Print_Line(win,2);
Product_Message(win,3);
Print_Line(win,4);
wrefresh(win);
return win;
}
void Get_Login_Face()
{
char title1_1[] = " 超市收银系统";
char title1_2[] = " Linux POS version 1.0 Author:CN070503--Shimmergloom";
char title4_1[] = "欢迎进入登录窗口";
char title4_2[] = "帐号:";
char title4_3[] = "密码:";
char title7[] = "确定";
char title8[] = "退出";
int i = 0,j = 0,k = 0;
char name[20] = "",pwd[20] = "",pwd1[20] = "";
int tempchar;
WINDOW *bottom1 = Create_Win(25,80,0,0,NO,NULL,BLACK_WHITE);
mvwprintw(bottom1,0,0,title1_1);
mvwprintw(bottom1,24,0,title1_2);
wrefresh(bottom1);
WINDOW *bottom2 = Create_Win(23,80,1,0,NO,NULL,RED_BLUE);
WINDOW *bottom3 = Create_Win(11,42,8,20,NO,NULL,WHITE_BLACK);
WINDOW *bottom4 = Create_Win(11,42,7,19,YES,title4_1,BLACK_WHITE);
mvwprintw(bottom4,3,12,title4_2);
mvwprintw(bottom4,5,12,title4_3);
wrefresh(bottom4);
WINDOW *bottom5 = Create_Win(1,15,10,37,NO,NULL,BLACK_RED);
WINDOW *bottom6 = Create_Win(1,15,12,37,NO,NULL,BLACK_RED);
WINDOW *bottom7 = Create_Win(3,8,14,31,YES,NULL,WHITE_RED);
mvwprintw(bottom7,1,2,title7);
wrefresh(bottom7);
WINDOW *bottom8 = Create_Win(3,8,14,43,YES,NULL,WHITE_RED);
mvwprintw(bottom8,1,2,title8);
wrefresh(bottom8);
while(1)
{
for(;i < 6;)
{
NAME_INPUT: tempchar = Get_Char(bottom5,0,0,&i);
switch(tempchar)
{
case KEY_DOWN:
case '\n':
goto PWD_INPUT;
break;
case '\a':
name[i] = '\0';
break;
default :
if (isdigit(tempchar))
{
i++;
name[i-1] = tempchar;
name[i] = '\0';
mvwprintw(bottom5,0,0,name);
wrefresh(bottom5);
}
}
}
for(;j < 12;)
{
PWD_INPUT: tempchar = Get_Char(bottom6,0,0,&j);
switch(tempchar)
{
case KEY_UP:
goto NAME_INPUT;
break;
case KEY_DOWN:
case '\n'://转去下面
goto SURE_INPUT;
break;
case '\a':
pwd[j] = '\0';
pwd1[j] = '\0';
break;
default :
j++;
pwd[j - 1] = tempchar;
pwd[j] = '\0';
pwd1[j - 1] = '*';
pwd1[j] = '\0';
mvwprintw(bottom6,0,0,pwd1);
wrefresh(bottom6);
}
}
while(1)
{
SURE_INPUT: wattron(bottom7,A_REVERSE);
mvwprintw(bottom7,1,2,title7);
wrefresh(bottom7);
wattroff(bottom7,A_REVERSE);
tempchar = Get_Char(bottom7,1,6,&k);
switch(tempchar)
{
case KEY_UP://转上面
mvwprintw(bottom7,1,2,title7);
wrefresh(bottom7);
goto PWD_INPUT;
break;
case KEY_RIGHT:
case KEY_DOWN:
mvwprintw(bottom7,1,2,title7);
wrefresh(bottom7);
goto CANCEL_INPUT;
break;
case '\n':
return;
}
}
while(1)
{
CANCEL_INPUT:wattron(bottom8,A_REVERSE);
mvwprintw(bottom8,1,2,title8);
wrefresh(bottom8);
wattroff(bottom8,A_REVERSE);
// wmove(bottom8,1,5);
// wrefresh(bottom8);
// keypad(bottom8,TRUE);
// tempchar = wgetch(bottom8);
// keypad(bottom8,FALSE);
tempchar = Get_Char(bottom8,1,6,&k);
switch(tempchar)
{
case KEY_UP:
case KEY_LEFT://转上面
mvwprintw(bottom8,1,2,title8);
wrefresh(bottom8);
goto SURE_INPUT;
break;
case '\n':
exit(0);
}
}
}
Delete_Window(bottom3);
Delete_Window(bottom2);
Delete_Window(bottom1);
Delete_Window(bottom4);
Delete_Window(bottom5);
Delete_Window(bottom6);
Delete_Window(bottom7);
Delete_Window(bottom8);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -