login.c

来自「在linux平台下模拟超市的收银系统即POS机」· C语言 代码 · 共 79 行

C
79
字号
	while(1)
	{
account_input:
		while(1)
		{
			ch=GetString(account_input_box,0,0,id,14);
			switch(ch)
			{
				case KEY_DOWN:
				case '\n':
					goto passwork_input;
					break;
			}			
		}

		
		while(1)
		{
passwork_input:
			ch=GetString(account_input_box,0,0,id,14);
			switch(ch)
			{
				case KEY_UP:
					goto account_input;
					break;
				case KEY_DOWN:
				case '\n'://转到ok_button下面
					goto ok_button;
					break;
			}
		
		}
		while(1)
		{
			
ok_button:	
			ch=GetChar(ok_button,0,0)
			switch(tempchar)
			{
				case KEY_UP://转上面
					goto passwork_input;
					break;
				case KEY_RIGHT:
				case KEY_DOWN:
					goto exit_button;
					break;
				case '\n':
					DestroyWindow(login_win_top);
					DestroyWindow(login_win_shadow);
					DestroyWindow(login_win_mid);
					DestroyWindow(account_input_box);
					DestroyWindow(password_input_box);
					DestroyWindow(ok_button);
					DestroyWindow(ok_button_shadow);
					DestroyWindow(exit_button);
					DestroyWindow(exit_button_shadow);
					DestroyWindow(login_win_bottom);
					//清除一下stdscr这个标准虚窗口									
					wclear(stdscr);
					return 0;		
			}
		
		}
		while(1)
		{			
exit_button:
			ch=GetChar(exit_button);
			switch(ch)
			{
				case KEY_UP:
				case KEY_LEFT://转上面
					goto ok_button;
					break;
				case '\n':
					return 1;//返回1为退出	
			}		
		}		
	}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?