• 0

[C++] How to code a menu that lets user highlight?


Question

I have an assignment coming up for a C++ class at my university. Its an extra credit assignment so I want to do something a bit different than everyone else.

Basically I want to:

Create the usual switch menu to select an option.

Instead of having the user input a # to select an option, I want the user to be able to use the up and down arrow to highlight their choice.

Once that choice is highlighted, I want the user to be able to press enter to select it.

This is a beginner C++ class, so if this does seem to advanced, let me know. Thanks :)

3 answers to this question

Recommended Posts

  • 0
  -}x0{- said:
I have an assignment coming up for a C++ class at my university.  Its an extra credit assignment so I want to do something a bit different than everyone else. 

Basically I want to:

Create the usual switch menu to select an option.

Instead of having the user input a # to select an option, I want the user to be able to use the up and down arrow to highlight their choice.

Once that choice is highlighted, I want the user to be able to press enter to select it.

This is a beginner C++ class, so if this does seem to advanced, let me know.  Thanks :)

585586861[/snapback]

Seems a bit advanced. First off, is this just a regular console app? If so to do that you'd have to either do:

a) capture the arrow input and keep a counter. Increment when up arrow is hit and decrement when down arrow is hit, of course making sure it doesn't go past the max and min menu indexes.

b) use some sort of console display library like ncurses to make it a more graphical menu where it actually highlights the item.

  • 0

Yes, this is specifically a console app. I dont really know how to do any of what you said. Basically I want to make a menu like the F8 menu screen (the one where you can choose to be in safe mode) before the XP startup. If you could supply an example thatd be great as I have searched all over google and cant find what I am looking for. I think im using the wrong search terms.

Thanks!

  • 0
  -}x0{- said:
Yes, this is specifically a console app.  I dont really know how to do any of what you said.  Basically I want to make a menu like the F8 menu screen (the one where you can choose to be in safe mode) before the XP startup.  If you could supply an example thatd be great as I have searched all over google and cant find what I am looking for.  I think im using the wrong search terms.

Thanks!

585587880[/snapback]

http://www.tldp.org/HOWTO/NCURSES-Programm...tml#MENUWINDOWS

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.