#include #include #include #include "loginscreen.h" using namespace std; LoginScreen::LoginScreen() { } bool LoginScreen::exec() { initscr(); /* Start curses mode */ keypad(stdscr, TRUE); // Listen to function keys printw("ComunicTerm"); /* Print Hello World */ refresh(); /* Print it on to the real screen */ // Get screen size int row, col; getmaxyx(stdscr, row, col); const string msg = "Light client"; mvprintw(0, (col-static_cast(msg.length())), msg.c_str()); refresh(); int startX = (row-4*2)/2; int startY = (col-50)/2; mvprintw(startX, startY, "Please login to your Comunic account:"); // Ask for email wattron(stdscr, A_REVERSE); mvprintw(startX+2, startY, "Email address:"); wattroff(stdscr, A_REVERSE); // Ask for password wattron(stdscr, A_REVERSE); mvprintw(startX+4, startY, "Password:"); wattroff(stdscr, A_REVERSE); // Validate button wattron(stdscr, A_REVERSE); mvprintw(startX+6, startY, "Login"); wattroff(stdscr, A_REVERSE); refresh(); getch(); /* Wait for user input */ endwin(); /* End curses mode */ }