How To Make Menu In Dev C++
Most common quiestion is:
Is there any C++ GUI API?
Jul 31, 2014 How to Make Graphics in Dev C on Windows 10 - Duration: 3:31. Virtualoops 28,477 views. Using Borland graphics.h with Dev-C for Graphics Programming in C - Duration: 6:36. Nov 13, 2005 Hi friends, I want to make menu in my C program For example: Main Menu: (1) Enter Data, (2) Control Variables (3) Exit I want to make this menu to go through the options just pressing numbers. From the main menu, choose File New Project to open the Create a New Project dialog box. At the top of the dialog, set Language to C, set Platform to Windows, and set Project type to Desktop. From the filtered list of project types, choose Windows Desktop Wizard then choose Next. In the next page, enter a name for the project, for example.
My answer is MANY.
There are many API's for making GUI applications.
Here are some.
1. WinAPI: (C based)(MFC is C++ based)
Its a great API and the best solution if you are windows programmer. First code will look a bit difficult, but later (after making few apps.) you will see its not so rusty. I like it, because you can do almost everything with it (in windows). The only bad thing is, that you cannot make applications for Linux with it.
Tutorial:
'>http://www.winprog.org/tutorial/index.html
2. Qt4 / Qt3 (C++ based)
This is a nice API, for making GUI applications. It works under Linux, Windows and Mac OS X. Its really easy to learn and use. But, until you dont buy licenced version, you will need to add tons of -dll s, to run your application. Qt compiler doesnt work in Vista. And, Qt4 API has a bit complicated way, to get buttons to work, if button holds some more complicated operations(actually you have to make your own SLOT's).
Tutorial:
http://sector.ynet.sk/qt4-tutorial/
http://doc.trolltech.com/4.2/examples.html
3.GTK+ (C based)
Sorry, but I never tryed it, so Google might help you.
Tutorial:
http://www.gtk.org/tutorial/
Some examples:
WinAPI
Simple message box:
Simple window:
QT4
Simple Message Box:
How To Make A Menu In Dev C++
Note: Use MsgBox for making message boxes
Simple Window:
GTK+
Simple window:
I hope this post will help anyone!
- 3 Contributors
- forum 3 Replies
- 85,277 Views
- 9 Years Discussion Span
- commentLatest Postby sreenivasulaLatest Post
jan10241887
How To Create Menu In Dev C++
I also think newbies dont know for C++ IDE's. (Developing Enviroviment).
I will make a short description of some
1. Visual Studio 2005 (Visual C++)
This is a beautiful IDE for making console and win32 GUI applications. You can also compile DirectX10 or 9 projects as well. I didn't test it for compiling Qt or GTK+ applications yet.
Affcourse as a Microsoft product isn't free, but it seems to be really safe and stable IDE for Windows Applications.
I really like it, and I recommend it to everyone.
More info '>HERE
2. Code::Blocks
Great for compiling WinAPI, Qt, GTK+, WXWidgets, Ogre, D, C++ console, C console and other projects. I found some bugs, and sometimes there are problems to compile.
It's one of the best FREE IDE's.
Information and download '>HERE
3. Dev-C++
This IDE, written in Delphi is the right place for beginners. It isn't perfect and it allows you 'holes' and 'bugs' in your program.Thats why its good for beginners. VS2005 wouldnt compile most of the code, which Dev-C++ does.
Information and Download '>HERE
SOME LINUX IDE's:
-Code::Blocks
-Anjuta IDE
-QDevelop
Ah, and dont take care about all off my opinions. I prefer VS2005, but If you dont have a money, than choose Code::Blocks or Dev-C++.
I hope moderators will make this topic sticky (read me)
I hope this helps
BTW: Sorry for my grammatic mistakes.
int main()
{
cout << 'Fading Death' << endl;
cout << '1 = Start' << endl;
cout << '2 = Difficulty' << endl;
cout << '3 = Credits' << endl;
cin >> choice;
switch (choice)
{
/*1*/case Start:
{
cout << '1 = New Game' << endl;
cout << '2 = Resume Game' << endl;
cout << '3 = Load Game' << endl;
cout << '4 = Back' << endl;
cin >> choice2;
switch (choice2)
{
/*A*/case NewGame:
cout << 'Starting a new game...' << endl;
cout << 'Select a difficulty.' << endl;
cout << '1 = Easy' << endl;
cout << '2 = Normal' << endl;
cout << '3 = Hard' << endl;
cout << '4 = Back' << endl;
cin >> choice3;
switch (choice3)
{
/*a*/case Easy:
cout << 'Saving...' << endl;
break;
/*b*/case Normal:
cout << 'Saving...' << endl;
break;
/*c*/case Hard:
cout << 'Saving...' << endl;
break;
}
break;
/*B*/case ResumeGame:
cout << 'Choose a file to resume...' << endl;
break;
/*C*/case LoadGame:
cout << 'Choose a file to load...' << endl;
break;
}
break;
/*2*/case Difficulty:
cout << 'Select a difficulty.' << endl;
cout << '1 = Easy' << endl;
cout << '2 = Normal' << endl;
cout << '3 = Hard' << endl;
cout << '4 = Back' << endl;
cin >> choice3;
switch (choice3)
{
/*A*/case Easy2:
cout << 'Saving...' << endl;
break;
/*B*/case Normal2:
cout << 'Saving...' << endl;
break;
/*C*/case Hard2:
cout << 'Saving...' << endl;
break;
}
}
break;
/*3*/case Credits: //Credits done!
{
cout << 'Created by: Daniel Murano' << endl;
cout << '4 = Back' << endl;
cin >> choice2;
break;
}
break;
default:
cout << 'Incorrect input.' << endl;
}
return 0;
}
Note: I don't expect it to actually load or resume a game. I'm just trying to learn how it's done.