14 Replies - 1462 Views - Last Post: 03 August 2012 - 10:42 PM Rate Topic: -----

#1 Sinusoidal_Tendencies  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 01-August 12

Terminal based ATM program needs to be full screen

Posted 02 August 2012 - 04:45 AM

Original post lost from yesterday:

Hello. I am working on an ATM project on an Art project for Burning Man called Burn Wall Street, and am seeking help/advice on the code for our ATM (Always Taking Money)Machine.

So far I have only written terminal based programs in C++ and don't know how to use/configure a kiosk style GUI.

Because of this i don't think my code is going to be very useful (and isn't even complete or orderly, almost no tagging on anything, and some IF run on-s should be switches with a default action{hadn't gotten to changing it yet}).
But I'll include it anyways censoring some language content.

As stated in the post title this need to be displayed full screen on a kiosk style GUI. How can i incorporate this into my code? How is it done/configured?

/*
WellsF*ckYou.cpp

code by : J^$#i{ Sterling }%&@
*/

#include <iostream>
#include <conio.h>  // for _kbhit() and _getch()
#include <iomanip> //for file manipulation
#include <cstdlib> //for random number generator
#include <ctime> //clock
#include <fstream> //for ofstream out to file.txt & ifstream fin from file.txt
#include<string> //for filename string
using namespace std;


//Functions
void get_Name(string &name);
void get_Pin(string &pin);
void get_Address(string &address);

int menu1();
int menu2();

void process_menuChoices(int menu1Choice, int menu2Choice);

int generateAccountBalance();

void sh^tTalkinResponses(int menu2Choice);

void gameMenu();


//global spaces
int accountBalance;
string account_Type;

int main()
{
	string name;
	string pin;
	string address;
	int menu1Choice;
	int menu2Choice=3;
	
	while(menu2Choice != 0){
		get_Name(name);
		get_Pin(pin);
		get_Address(address);
		
			
		menu1Choice = menu1();
		menu2Choice = menu2();

		process_menuChoices(menu1Choice, menu2Choice);
	}

	return 0;
}



void get_Name(string &name){

	system("CLS");
	cout << "Please enter your name:";
	cin >> name;

	return;
}

void get_Pin(string &pin){

	system("CLS");
	cout << "Please enter your pin:";
	cin >> pin;

	return;
}
void get_Address(string &address){

	system("CLS");
	cout << "Please enter your BRC address:" <<endl;
	cin >> address;

	return;
}

int menu1(){

    string choice;
	int selection=3;

	while(selection != 1 && selection != 2) {
		system("CLS");
		cout<< "Would you like to:" <<endl;
		cout<< "[1] Deposit" <<endl;
		cout<< "[2] Withdraw" <<endl;
		cout<< "PLease select 1 or 2." <<endl;
		cin>> choice ;

		if(choice == "1"){
			selection = 1;
		}
		if(choice == "2"){
			selection = 2;
		}
	}

	return selection;
}

int menu2(){
	string choice;
	int selection=3;

	while(selection != 1 && selection != 2 && selection != 666 && selection != 0) {
		system("CLS");
		cout<< "From:" <<endl;
		cout<< "[1] Checking" <<endl;
		cout<< "[2] Savings" <<endl;
		cout<< "PLease select 1 or 2." <<endl;
		cin>> choice ;

		if(choice == "1"){
			selection=1;
		}
		if(choice == "2"){
			selection=2;
		}
		if(choice == "666"){
			gameMenu();
		}
		if(choice == "qtfsn"){
			selection=0;
		}
	}

	return selection;
}



void process_menuChoices(int menu1Choice, int menu2Choice){

	if (menu2Choice == 1){
		account_Type = "Checking";
	}
	if (menu2Choice == 2){
		account_Type = "Savings";
	}

	if(menu1Choice == 1 && menu2Choice == 1 || menu1Choice == 1 && menu2Choice == 2){
		accountBalance = generateAccountBalance();
		cout<< account_Type << " balance = " << accountBalance <<endl;
		cout<< "There is an error with this machine at the moment." <<endl;
		cout<< "Please bring your deposit to one of our agents at ....." <<endl;
		system("pause");
	}
	if(menu1Choice == 2 && menu2Choice == 1 || menu1Choice == 2 && menu2Choice == 2){
		sh^tTalkinResponses(menu2Choice);
	}

	return;
}

void sh^tTalkinResponses(int menu2Choice){

	return;
}

int generateAccountBalance(){
	int balance;


	return balance;
}


void gameMenu(){

	return;
}


Is This A Good Question/Topic? 0
  • +

Replies To: Terminal based ATM program needs to be full screen

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3715
  • View blog
  • Posts: 5,972
  • Joined: 08-June 10

Re: Terminal based ATM program needs to be full screen

Posted 02 August 2012 - 04:54 AM

Moved to the C/C++ Help forum. Please don't post questions in the "Challenges" sub-forums.
Was This Post Helpful? 0
  • +
  • -

#3 jimblumberg  Icon User is offline

  • member icon


Reputation: 4002
  • View blog
  • Posts: 12,347
  • Joined: 25-December 09

Re: Terminal based ATM program needs to be full screen

Posted 02 August 2012 - 05:37 AM

Quote

So far I have only written terminal based programs in C++ and don't know how to use/configure a kiosk style GUI.


What exactly do you mean by "kiosk style GUI"? You are going to have to ask much more specific questions and give us much more information.

Jim
Was This Post Helpful? 0
  • +
  • -

#4 Sinusoidal_Tendencies  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 01-August 12

Re: Terminal based ATM program needs to be full screen

Posted 03 August 2012 - 12:21 PM

View PostAtli, on 02 August 2012 - 04:54 AM, said:

Moved to the C/C++ Help forum. Please don't post questions in the "Challenges" sub-forums.


My apologies. Sense i was unable to find this post i assumed it had been lost too and re-posted another today in challenges. Seemed logical at the time as i couldn't find a forum labeled > C and C++ Help. Perhaps though i'm just challenged.


View Postjimblumberg, on 02 August 2012 - 05:37 AM, said:

Quote

So far I have only written terminal based programs in C++ and don't know how to use/configure a kiosk style GUI.


What exactly do you mean by "kiosk style GUI"? You are going to have to ask much more specific questions and give us much more information.

Jim



And by "Kiosk style GUI" I mean a Graphical User Interface like they have in real ATM Kiosks or mall navigation Kiosks..... As i have only ever written code to be displayed in a terminal/prompt window i have no idea how this is done, or how to ask my question any more specific than that (or i could probably google it and i wouldn't be here).

So geeze... I guess how dose one create a graphical interface to display to. How do you configure it(color, size, shape, etc..), and how do you display to it.

Don't really know what i'm talking about though, so perhaps these questions miss the mark they where intended for.
Was This Post Helpful? 0
  • +
  • -

#5 jimblumberg  Icon User is offline

  • member icon


Reputation: 4002
  • View blog
  • Posts: 12,347
  • Joined: 25-December 09

Re: Terminal based ATM program needs to be full screen

Posted 03 August 2012 - 12:52 PM

Are you sure you need a GUI application? Many ATM machines use basic textual screens. If you decide that you need a GUI the you will need to decide if you want to use some kind of GUI library like QT, GTK or stick with the operating system specific API. Unless you are already familiar with C/C++ I recommend you try to stick with the textual presentation, unless you have a lot of time to learn GUI programming.

Jim
Was This Post Helpful? 0
  • +
  • -

#6 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3531
  • View blog
  • Posts: 10,935
  • Joined: 05-May 12

Re: Terminal based ATM program needs to be full screen

Posted 03 August 2012 - 01:00 PM

And if this an art installation for Burning Man 2012, you've got less than 24 days...
Was This Post Helpful? 0
  • +
  • -

#7 Sinusoidal_Tendencies  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 01-August 12

Re: Terminal based ATM program needs to be full screen

Posted 03 August 2012 - 01:08 PM

Unfortunately i do not have the luxury of time this time around.

Although i've been interested in QT i don't think i will have the time to learn it well enough to make good use of it in the next weekish.

What can you tell me about Textual displaying? Are textual screens coordinate based? (x,y grid map)
Was This Post Helpful? 0
  • +
  • -

#8 jimblumberg  Icon User is offline

  • member icon


Reputation: 4002
  • View blog
  • Posts: 12,347
  • Joined: 25-December 09

Re: Terminal based ATM program needs to be full screen

Posted 03 August 2012 - 01:16 PM

They can be, if you use something like ncurses. But I was really just talking about using standard C++ input and output. Possibly using the manipulators in <iomanip> to help place the text in columns.

Jim
Was This Post Helpful? 0
  • +
  • -

#9 Sinusoidal_Tendencies  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 01-August 12

Re: Terminal based ATM program needs to be full screen

Posted 03 August 2012 - 01:36 PM

well for the most part the program is text display anyways, so that's fine.

I have an old compaq intel celeron w/xp and monitor in a wood box as a mock up of an ATM.
And the plan is to have an exe to run on it that will be the ATM program, and i want it to take up the whole screen so you can't see anything else until the program is terminated.

My familiarity with C++ is limited to an intro collage course taken last year.
And i'm confident i can figure this out if given the right information.

I am also going to want to learn about playing video in C++ too so i can call footage to be displayed like i would anything else.
Was This Post Helpful? 0
  • +
  • -

#10 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3531
  • View blog
  • Posts: 10,935
  • Joined: 05-May 12

Re: Terminal based ATM program needs to be full screen

Posted 03 August 2012 - 01:49 PM

Well, if you are running XP, you're first hurdle will be to create a new console window that will take up the entire screen and hopefully not show the CMD window chrome. You may have a little more luck by installing CygWin and telling the CygWin window to be full sized, but it'll still have some window chrome around it.

You may have an easier time installing a Linux distribution that only runs in console mode. (Server version of Ubuntu maybe the least painful to get up and running.) That way you at least have the entire screen to use in console mode and never have to worry about the window chrome.
Was This Post Helpful? 0
  • +
  • -

#11 #define  Icon User is offline

  • Duke of Err
  • member icon

Reputation: 1325
  • View blog
  • Posts: 4,551
  • Joined: 19-February 09

Re: Terminal based ATM program needs to be full screen

Posted 03 August 2012 - 08:49 PM

Which compiler are you using?
Was This Post Helpful? 0
  • +
  • -

#12 Sinusoidal_Tendencies  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 01-August 12

Re: Terminal based ATM program needs to be full screen

Posted 03 August 2012 - 09:49 PM

I could display a picture for all i care, so long as i can take in and pass user input through a switch after. And i actually only have about a week to do the code because we go out to build on playa on the 11th. So not to offend any one but I would be most appreciative if we got past some of the hypothesizing and i could learn some code. Or pointed to an appropriate tut.

Full screen is my main concern... how is it that most every thing else can go full screen at the click of a button with the mouse? I guess i just thought this was a simpler question.
Was This Post Helpful? 0
  • +
  • -

#13 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3531
  • View blog
  • Posts: 10,935
  • Joined: 05-May 12

Re: Terminal based ATM program needs to be full screen

Posted 03 August 2012 - 10:21 PM

It was the addition of the mouse to the computer that screwed everything up for you. With a mouse, the preference was to go with GUI's. With GUIs most programs also became GUIs to take advantage of the mouse. Consoles windows still exist for backward compatibility, but everything in the console now lives in a window... Unfortunately, on Windows platforms from Windows NT and up, console windows always have window chrome to them and never go full screen. If you can find an old Win9x box, or just install DOS, then you can get the full screen console experience that you are looking for.

This post has been edited by Skydiver: 03 August 2012 - 10:21 PM

Was This Post Helpful? 0
  • +
  • -

#14 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3531
  • View blog
  • Posts: 10,935
  • Joined: 05-May 12

Re: Terminal based ATM program needs to be full screen

Posted 03 August 2012 - 10:30 PM

If you don't want to wipe for machine, you can install DOSBox and you can run DOSBox to be full screen. But now you'll have to dig up a 16 bit compiler so that you can write some good old DOS programs.
Was This Post Helpful? 0
  • +
  • -

#15 #define  Icon User is offline

  • Duke of Err
  • member icon

Reputation: 1325
  • View blog
  • Posts: 4,551
  • Joined: 19-February 09

Re: Terminal based ATM program needs to be full screen

Posted 03 August 2012 - 10:42 PM

To use the console window in fullscreen mode try:

Right-click on your Application/Executable and click Create Shortcut.

Right-click on the Shortcut and select Properties.
Choose the Options tab then select Full Screen and apply.

Run from the shortcut. (Edit: running the program may go to fullscreen as well.)
---

Various operating systems handle the graphic displays in different ways. C++ by itself just writes to a console window. To use windows/graphics a library is used. The basic library on Windows is WinAPI.

Winapi (C Win32 API, No MFC) tutorial

This post has been edited by #define: 03 August 2012 - 10:47 PM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1