• 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

    • - What's your salary? Is it more than $100k a year? - Nah, it's $100 mil a year.
    • Compared to my ear buds which are the size of a matchbox, cover a much broader frequency range, and work everywhere without setup? Yeah, still not buying this as a replacement.
    • Meta's Superintelligence team staffed by 50% Chinese talent, 40% ex-OpenAI by Hamid Ganji Mark Zuckerberg's latest big bet at Meta involves building a team of the best AI superstars in the market to lead the so-called Superintelligence Labs. The goal of this team is to develop AI models that will ultimately lead to Artificial General Intelligence (AGI). AGI refers to an AI model with capabilities comparable to, or even beyond, those of the human brain. Achieving human-level cognitive abilities with an AI model requires substantial investments, as well as hiring the best talent to build such a system. That's why Meta is throwing hundreds of millions of dollars at AI researchers from OpenAI, Apple, and other companies to recruit them for its Superintelligence team. A user on X has now shared a spreadsheet that provides us with some unique insights into Meta's Superintelligence team and the origins of its 44 employees. The leaker claims this information comes from an anonymous Meta employee. The listing claims that 50 percent of the staff at the Superintelligence team are from China, which demonstrates the significant role of Chinese or Chinese-origin researchers in Met's AI efforts. Additionally, 75 percent of these staff hold PhDs, and 70 percent of them work as researchers. Interestingly, 40 percent of the staff are ex-OpenAI employees whom Mark Zuckerberg poached from the maker of ChatGPT. Additionally, 20 percent of Meta's Superintelligence team members come from Google DeepMind, and another 15 percent come from Scale AI, a startup that Meta recently acquired in a $15 billion deal. Another interesting point is that 75 percent of the Superintelligence team are first-generation immigrants. The leaker claims that each of these employees is now earning between $10 million and $100 million per year, although Meta still needs to confirm these substantial figures. However, it has already been reported that Meta is offering up to $100 million in signup bonuses to poach the best AI talent from OpenAI and other rivals. The revelation that half of Meta's Superintelligence team consists of Chinese nationals could trigger concerns within the Trump administration and Congress.
    • From a quick Google it seems 6GHz is optional on 802.11be. Ubiquiti has one, Unifi U7 Lite.
    • Disagreed, I feel it’s going somewhere and his role served a purpose - and moreover with maybe what 10 mins of screen time - he had a bit of character development also.
  • Recent Achievements

    • First Post
      nobody9 earned a badge
      First Post
    • One Month Later
      Ricky Chan earned a badge
      One Month Later
    • First Post
      leoniDAM earned a badge
      First Post
    • Reacting Well
      Ian_ earned a badge
      Reacting Well
    • One Month Later
      Ian_ earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      504
    2. 2
      ATLien_0
      207
    3. 3
      Michael Scrip
      205
    4. 4
      Xenon
      140
    5. 5
      +FloatingFatMan
      115
  • Tell a friend

    Love Neowin? Tell a friend!