

InterviewSolution
Saved Bookmarks
1. |
Solve : shUI builder is a little lost...? |
Answer» shUI is a program built in C++ for those who aren't able to run X window system on linux (and those who can't use anything else than the command prompt in DOS) and to give them a minimal UI-like interface to browse, edit text and whatever. This is the installation program, but I need help for a lot of things, like: 1. how to put color in the program. 2. How to make cin scroll horizontally when the text outbounds the specified limit. 3. how to position text on screen And other things will come over time that my program develops. This is where i'm stuck: Code: [Select]#include <iostream> #include <fstream> #include <conio.h> #include <stdio.h> #include <stdlib.h> #include <dos.h> using namespace std; const unsigned char Key1 = 224; const unsigned char LEFT = 75; const unsigned char RIGHT = 77; const unsigned char UP = 72; const unsigned char DOWN = 80; int main(){ int frm1(); frm1(); }; void frm1(){ int frm2(); cout << " ________________________\n"; cout << "| \\_____Setup______/ |\n"; cout << "| ______________________ |\n"; cout << "|| WELCOME to shUI's ||\n"; cout << "||installation program! ||\n"; cout << "|| ||\n"; cout << "|| ||\n"; cout << "|| ||\n"; cout << "||______________________||\n"; cout << "| <QUIT | | NEXT> |\n"; cout << "`------------------------'"; cout << "";stucked unsigned char choice = getch(); cout << endl; if (choice == Key1) { unsigned char choice2 = getch(); switch(choice2) { case LEFT: system ("CLS"); cout << "ShUI ended."; break; case RIGHT: system ("cls"); frm2(); } } return ; } void frm2(){ int frm1(); cout << " ________________________\n"; cout << "| \\_____Setup______/ |\n"; cout << "| ______________________ |\n"; cout << "||First of all, you ||\n"; cout << "||need to input some ||\n"; cout << "||information and ||\n"; cout << "||settings concerning ||\n"; cout << "||you, your account ||\n"; cout << "||data and your ||\n"; cout << "||computer. ||\n"; cout << "||______________________||\n"; cout << "| <Back | | Next> |\n"; cout << "`------------------------'"; cout << ""; unsigned char choice = getch(); cout << endl; if (choice == Key1) { unsigned char choice2 = getch(); switch(choice2) { case LEFT: system ("cls"); frm1(); } } return ; } |
|