Menu based console applications

Jun 12, 2011 at 10:02am
Any good tutorials or books for menu based console application?
Thanks Janlan
Jun 12, 2011 at 2:41pm
Just leave the console. If you want a GUI, use qt, gtk, wxwidgets, etc.
Jun 12, 2011 at 3:01pm
I have project to make application with menu in console :)
Jun 12, 2011 at 6:22pm
If you must..
Though I don't understand what exactly you are looking for. The best way to structure console menu? Tools you can use when abusing the console?
Jun 12, 2011 at 7:32pm
Below is what I think you are looking for, which is a menu that can be integrated into a console application. Setup a loop in your main function that lasts forever and constantly calls this menu and then customize the menu however you want.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
void PrintMenu()
{
	int myChoice = 0;
	
	std::cout << "********** Main Menu **********" << std::endl;
	std::cout << "(1): Option 1" << std::endl;
	std::cout << "(2): Option 2" << std::endl;
	std::cout << "(3): Option 3" << std::endl;
	std::cin >> myChoice;
	
	switch(myChoice)
	{
	case 1:
		FunctionOne();
		break;
	case 2:
		FunctionTwo();
		break;
	case 3:
		FunctionThree();
		break;
	default:
		std::cout << "ERROR! You have selected an invalid choice." << std::endl;
		break;
	}
}
Last edited on Jun 12, 2011 at 7:35pm
Jun 12, 2011 at 10:00pm
Is it something like the BIOS menu on your computer or the menu whether to boot in safe mode or not you want to copy the idea of?

Like in this image?
http://www.cooperation-iws.org/wiki/images/6/64/Bios-menu.gif
Jun 12, 2011 at 10:43pm
@GisleAune Yep, exactly like that :)) any good tutorials or books? :)
Jun 12, 2011 at 10:51pm
you could definitely use ncurses to generate something like that on a *nix box, but I wonder what's the standard library for a Windoze box - is there something in the DOS API?

but this is BIOS - something even lower level must be used - assembly? what's embedded onto the ROM?

got me all curious now...
Last edited on Jun 12, 2011 at 10:54pm
Jun 12, 2011 at 11:11pm
Both curses -- ncurses and PDcurses -- are available for Windows, IIRC. At the very least, I know PDcurses is.
The WinAPI has console-specific functions.

He said he wants something like the BIOS menu in his program, not that he's going to overwrite the BIOS with his own code.
Jun 12, 2011 at 11:13pm
yup, I know... ...I was just curious what code most BIOS actually use 8')
Jun 14, 2011 at 9:03am
Nobody huh? :)
Topic archived. No new replies allowed.