Example #1
0
//系统的初始进入界面
static void start_menu(){
	int index=1;
	char commend[1];
	erase();
	cbreak();
	noecho();
	mvprintw(3 ,25, "%s", " 欢迎访问模拟铁路订票系统!");
	mvprintw(8, 35, "%s", "1. 登录");
	mvprintw(9, 35, "%s", "2. 注册");
	mvprintw(10, 35, "%s", "3. 退出");
	refresh();
	while(index){
		commend[0]=getch();
		switch(commend[0]){
			case '1': 
				echo();
				nocbreak();
				login_menu(); 
				index=0; 
				break;
			case '2':
				echo();
				nocbreak();
				register_menu();
				index=0;
				break;
			case '3': index=0; break;
			default: mvprintw(13, 35, "%s", "无效的命令!"); break;
		}
	}
}
Example #2
0
//Allows the user to log in to their personal account
void Bank::login_menu() {
	cout << "Before viewing your information we need you to login." << endl;
	cout << "Note: Password is case-senstive" << endl << endl;
	int customer_id;
	string customer_password;
	cout << "Please enter your customer number: "; 	cin >> customer_id;
	cout << "Please enter your password: "******"Invalid customer number/password" << endl;
		login_menu();
	}
}
Example #3
0
//LoginIn button that takes you to mainWindow
void MainWindow::on_pushButton_login_clicked()
{
    login_menu();
}
Example #4
0
/*Description - Prints the menu tht appears after login in a new window using ncurses library*/
void login_menu() {
	system("clear");
	WINDOW *menu_win;
	int highlight = 1;
	int choice = 0;
	int c;
	initscr();
	clear();
	noecho();
	cbreak();	/* Line buffering disabled. pass on everything */
	startx = (80 - WIDTH) / 2;
	starty = (24 - HEIGHT) / 2;
	menu_win = newwin(HEIGHT, WIDTH, starty, startx);
	keypad(menu_win, TRUE);
	mvprintw(0, 20, "***************WELCOME****************");
	mvprintw(2, 7, "Use arrow keys to go up and down, Press enter to select a choice");
	refresh();
	print_menu2(menu_win, highlight);
	while(1)
	{	c = wgetch(menu_win);
		switch(c)
		{	case KEY_UP:
				if(highlight == 1)
					highlight = n_choices2;
				else
					--highlight;
				break;
			case KEY_DOWN:
				if(highlight == n_choices2)
					highlight = 1;
				else 
					++highlight;
				break;
			case 10:
				choice = highlight;
				break;
			default:
				mvprintw(24, 0, "Charcter pressed is = %3d Hopefully it can be printed as '%c'", c, c);
				refresh();
				break;
		}
		print_menu2(menu_win, highlight);
		if(choice != 0)	/* User did a choice come out of the infinite loop */
			break;
	}
	clrtoeol();
	endwin();
	switch(choice) {
		case 1: /*Guide*/
			guide();
			login_menu();
			break;
		case 2: /*Play Game*/
			play_game();
			break;
		case 3: /*Buy*/
			buy_chips();
			login_menu();
			break;
		case 4: /*Sell*/
			sell_chips();
			login_menu();
			break;
		case 5: /*Check bal*/
			disp_bal();
			login_menu();
			break;
		case 6: /*Change_info*/
			change_info();
			login_menu();
			break;
		case 7: /*Log out*/
			logout();
			menu();
			break;
		default:
			login_menu();
			break;
	}
}