Solved

Menu creation

Posted on 2001-07-16
29
310 Views
Last Modified: 2008-02-01
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
Comment
Question by:jinogeorge
  • 6
  • 5
  • 5
  • +7
29 Comments
 
LVL 10

Accepted Solution

by:
makerp earned 50 total points
ID: 6284993
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
 
LVL 10

Expert Comment

by:makerp
ID: 6284995
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
 
LVL 2

Expert Comment

by:obg
ID: 6293191
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
 

Author Comment

by:jinogeorge
ID: 6296941
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
 
LVL 10

Expert Comment

by:makerp
ID: 6297384
use visual C++ MFC then its so easy
0
 
LVL 2

Expert Comment

by:obg
ID: 6297390
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
 
LVL 10

Expert Comment

by:makerp
ID: 6297400
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
 
LVL 2

Expert Comment

by:obg
ID: 6297417
makerp, who is asking for a hard time...?
0
 
LVL 10

Expert Comment

by:makerp
ID: 6297428
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
 
LVL 2

Expert Comment

by:obg
ID: 6297436
I agree. That's why I keep asking for OS/compiler... ;-)
0
 
LVL 30

Expert Comment

by:Axter
ID: 6304631
>>I agree. That's why I keep asking for OS/compiler... ;-)
The OS an the compiler is stated in the question.
0
 
LVL 1

Expert Comment

by:Ernest022699
ID: 6310917
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
 
LVL 4

Expert Comment

by:rd707
ID: 6322013
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
 

Expert Comment

by:b_amit
ID: 6323388
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Expert Comment

by:b_amit
ID: 6323855
wants to use only keyboard or mouse too?
graphical mode or text mode?
amit
0
 
LVL 4

Expert Comment

by:rd707
ID: 6325869
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
 
LVL 10

Expert Comment

by:makerp
ID: 6326280
use the BGI
0
 
LVL 1

Expert Comment

by:Ernest022699
ID: 6327622
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
 
LVL 16

Expert Comment

by:t0t0
ID: 6346526
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
 
LVL 1

Expert Comment

by:Ernest022699
ID: 6347461
Good idea, t0t0!  And when it gets finished, let's put it in the public domain to really irritate you-know-who!
0
 
LVL 16

Expert Comment

by:t0t0
ID: 6349944
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
 
LVL 1

Expert Comment

by:Ernest022699
ID: 6354446
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
 

Expert Comment

by:b_amit
ID: 6367152
hi jinogeorge
you didn't responding?
how can we know what you exactly want?
keep in touch...
0
 
LVL 1

Expert Comment

by:Ernest022699
ID: 6369909
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
 
LVL 16

Expert Comment

by:t0t0
ID: 6370473
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
 
LVL 16

Expert Comment

by:t0t0
ID: 6370482
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
 
LVL 16

Expert Comment

by:t0t0
ID: 6370495
SORRY, WRONG COMMENT FOR THE WRONG QUERY.... THIS WAS MEANT FOR ANOTHER QUESTION AND POSTED HERE ACCIDENTALLY....

IGNORE THESE LAST THREE COMMENTS....

:)
0
 
LVL 1

Expert Comment

by:srithi
ID: 6790445
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
 
LVL 45

Expert Comment

by:sunnycoder
ID: 9376634
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now