Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Menu.hpp"
- using namespace std;
- void gotoxy( const int x, const int y )
- {
- COORD coord = { x, y };
- SetConsoleCursorPosition( GetStdHandle( STD_OUTPUT_HANDLE ), coord );
- }
- int OpcjaA()
- {
- return 0;
- }
- int OpcjaB()
- {
- return 0;
- }
- int main()
- {
- int wybor;
- int poprzedniWybor;
- bool wykonujPetle;
- while( 1 )
- {
- wybor = 0;
- poprzedniWybor = wybor;
- wykonujPetle = true;
- system( "cls" );
- gotoxy( 3, 1 );
- cout << "Opcja A";
- gotoxy( 3, 3 );
- cout << "Opcja B";
- gotoxy( 3, 5 );
- cout << "Exit";
- while( wykonujPetle )
- {
- gotoxy( 1, wybor * 2 + 1 );
- cout << static_cast < char >( 16 );
- poprzedniWybor = wybor;
- switch( getch() )
- {
- case 224:
- switch( getch() )
- {
- case 72:
- if( 0 < wybor ) wybor--;
- else wybor = 2;
- break;
- case 80:
- if( wybor < 2 ) wybor++;
- else wybor = 0;
- break;
- case 77:
- switch( wybor )
- {
- case 0:
- OpcjaA();
- break;
- case 1:
- OpcjaB();
- break;
- case 2:
- return 0;
- }
- }
- break;
- }
- gotoxy( 1, poprzedniWybor * 2 + 1 );
- cout << " ";
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment