• 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.
  • Posts

    • The first link on the github page gives me a very, very red page warning me about phishing........
    • Hey Nick! 👋 No worries at all — you're not alone in this, and it's great you're asking for help. Let me walk you through a simple, step-by-step fix using the tool mentioned on that AOMEI Partition Assistant guide — it really does the trick for many people with this exact issue! ✅ Here’s how to restore your USB back to full 256GB on Windows 11: Download & Install AOMEI Partition Assistant Go to the link you shared: AOMEI Partition Assistant and click the Download Freeware button. Insert your USB stick (Sandisk Ultra 256GB) Make sure it's properly connected. Wait for the system to detect it. Launch AOMEI Partition Assistant Once open, you'll see all your connected drives listed. Locate your USB Drive Look for the one that says something like Disk X – Removable and shows only 3.1GB or so. Right-click on your USB Drive’s Partition Then select Delete Partition → confirm the deletion. Now, right-click on the unallocated space (it should now show full unallocated capacity) Choose Create Partition → format it as FAT32 or exFAT (recommended for larger drives) → click OK. Click “Apply” in the top left corner Then hit Proceed to execute the pending operations. Wait a bit... and boom! 🎉 Your USB should now be restored to its full 256GB capacity!
    • When Facebook bought Beat Saber, they promised exactly this would never happen. Facebook can’t not lie.
    • Depends on what you mean by "this data". Nvidia can show you quite a few of those as well in their performance overlay, and I guess they might've assumed that if anyone wants to see more, they'll just use Afterburner as the de facto standard. As for real framerate vs framegen framerate, I don't think they exactly want you to know, given that their marketing has been strongly focused on hiding the real framerate and pretending the generated one is all that matters...
  • Recent Achievements

    • First Post
      Fuzz_c earned a badge
      First Post
    • First Post
      TIGOSS earned a badge
      First Post
    • Week One Done
      slackerzz earned a badge
      Week One Done
    • Week One Done
      vivetool earned a badge
      Week One Done
    • Reacting Well
      pnajbar earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      713
    2. 2
      ATLien_0
      279
    3. 3
      Michael Scrip
      209
    4. 4
      +FloatingFatMan
      201
    5. 5
      Steven P.
      131
  • Tell a friend

    Love Neowin? Tell a friend!