• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 338
  • Last Modified:

Menu creation

How can we create dropdown Menu(like in windows) using C language (not the console menu).
Operating system: DOS
Compiler:TURBO C++
Please give me explanation with appropriate examples.
0
jinogeorge
Asked:
jinogeorge
  • 6
  • 5
  • 5
  • +7
1 Solution
 
makerpCommented:
do you mean console application, not windows

#include <stdio.h>
#include <conio.h>

void main()
{

char choice;
while(true)
{
 printf("1. Add Job\n");
 printf("2. Get Job\n");
 printf("Enter Menu Number : ");
 choice = getch();

 switch(choice)
 {
  case '1': printf("1 was chosen\n");
    break;
  case '2': printf("2 was chosen");  
    break;
  default: printf("\nBad choice\n");
    break
 }
 printf("\n");
}

}
0
 
makerpCommented:
doing it in windows with real menu is much more difficult, and besides you can not do it just in C, you will need to use the API of the OS your are on
0
 
obgCommented:
Do you want mouse interaction as well? You need to tell us what OS and compiler you are using. Borland has pretty good functionality for DOS applications...
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
jinogeorgeAuthor Commented:
I explicitly mention that i want the dropdown menu using C or C++.not the console menu.Please give me the proper example for dropdown menu
0
 
makerpCommented:
use visual C++ MFC then its so easy
0
 
obgCommented:
And I think both makerp and I explicitly mentioned that we need to know what OS and compiler you are using. This can not be done using standard C or C++!
0
 
makerpCommented:
you are asking for a hard time, use a class lib such as mfc or you can use the opertaing systems API to create the window items
0
 
obgCommented:
makerp, who is asking for a hard time...?
0
 
makerpCommented:
the question asker, i no longer see the point of re-inventing the wheel. practically every plaform has a class library and/or visual compilers that automate GUI apps.
0
 
obgCommented:
I agree. That's why I keep asking for OS/compiler... ;-)
0
 
AxterCommented:
>>I agree. That's why I keep asking for OS/compiler... ;-)
The OS an the compiler is stated in the question.
0
 
Ernest022699Commented:
This user also has an open question under the C++ area.

jinogeorge: Forget Turbo C/C++ when using Windows.  Turbo is fine for DOS.  You need to get a serious compiler, such as Visual C++.  Otherwise you'll be trying to reinvent the wheel and asking more questions here than you have points to pay for.
0
 
rd707Commented:
What is it you want to do? Have a menu in a Windows application or have a drop down menu in a box in a console application?
0
 
b_amitCommented:
0
 
b_amitCommented:
wants to use only keyboard or mouse too?
graphical mode or text mode?
amit
0
 
rd707Commented:
He said a drop down window LIKE in Windows - he could mean the pseudo Windows interface programs used to have before Windows OR he could mean he wants a menu in a Windows program.

0
 
makerpCommented:
use the BGI
0
 
Ernest022699Commented:
If you insist on using DOS as your operating system and Turbo C++ as your compiler then you are going to have an extremely large project on your hands.  You may get part way finished and then find out that you have run out of system resources.

As everyone has stated in one way or another, you will be reinventing the Windows GUI.  Not only is that silly but it may get you in warm water with our friends in Redmond.

Do you still want to do this project in Turbo C++ running under DOS, even after being told explicitly that it is A Very Bad Idea?
0
 
t0t0Commented:
it can be done.... yeah, it's gonna be hard work but dropping into graphics mode and using graphics libraries would enable this to be accomplished....

trouble is, i personally don't have time to give an example right now....

interesting request though....

ps. if you ever get to the stage where you completely design a new GUI say, Microhard Doors instead of Windows then i'll back you all the way.... perhaps we can design the bugs first....
0
 
Ernest022699Commented:
Good idea, t0t0!  And when it gets finished, let's put it in the public domain to really irritate you-know-who!
0
 
t0t0Commented:
absolutely!!! i'll go along with that Ernest....perhaps we can draw upon your field of expertise and employ you to design the voice activated GUI bit so that we don't have to use 'ergonomic' mice....

i think the first lines of code should be....

#include<platform.h>
.
.
speech main(speech){

  if (system.platform == INTEL_640K_LIMIT)
    system.crash;

  if (system.hardware_interrupts < 32)
    system.crash;

  if (system.software == MICROSOFT)      //may not be necessary
    system.crash;

  if (system.addressing == SEGMENTED_ADDRESSING)
    system.crash;

  if (system.processing != TRUE_MULTITASKING)
    system.crash;

  return AI.greet(IndetifyUser(argv[1]))

  .
  .
}



0
 
Ernest022699Commented:
Easier than that.  We'll use the Psychic Interface.  Then the user will just have to THINK of what they want to do.  The Psychic Interface will be available in the second quarter.  Reserve yours now by sendng USD 999.99 to ...
0
 
b_amitCommented:
hi jinogeorge
you didn't responding?
how can we know what you exactly want?
keep in touch...
0
 
Ernest022699Commented:
jinogeorge may have decided that everyone is right.  If I were he I'd request that the question be deleted.  But that's just me.
0
 
t0t0Commented:
nonsense jinogeorge, the guy is looking for an algorithm....

the actual method for drawing the lines will obviously differ across different hardware platforms, be it character-based or in graphics mode....

naturally, any such algorithm should work on the PC say, in DOS character-base mode, which could then be ported across to the target hardware....


0
 
t0t0Commented:
hmmm.... seems you're the originator of this question....

i'll have to give you an answer to your query.  at the moment though, i can't seem to focus on the theory part so i'll hold off for a day or so....
0
 
t0t0Commented:
SORRY, WRONG COMMENT FOR THE WRONG QUERY.... THIS WAS MEANT FOR ANOTHER QUESTION AND POSTED HERE ACCIDENTALLY....

IGNORE THESE LAST THREE COMMENTS....

:)
0
 
srithiCommented:
use FAR Pointers get the VDU Address
where in each character has two bytes ,one byte for the char and the other for background color....

so write your own functions to generate the menu....

its all logic,
0
 
sunnycoderCommented:
No comment has been added lately and this question is therefore classified abandoned.

If asker wishes to close the question, then refer to
http://www.experts-exchange.com/help/closing.jsp

Otherwise, I will leave a recommendation in the Cleanup topic area that this question is:
PAQed with A grade to makerp

Please leave any comments here within the next seven days. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Sunny
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 5
  • 5
  • +7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now