Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need help with this assignment! Menu Bar 1. There is currently no way to open the newly created settings dialog. In order to open this
Need help with this assignment!
Menu Bar 1. There is currently no way to open the newly created settings dialog. In order to open this dialog. a menu barwill need to be added to the main window. 2. Two types of menu related objects will be used for this. mMenuElar and wxlvlenu. The wxMe nu Bar is the entire menu bar that goes across the top of the window. The wxMe nu represents one of the drop down menus that is part of that bar. There will only be one wxMe nu Ba r. but there will be multiple mMenu objecls. 3. Create a wxMenuEiar* that will represent the entire menu bar. Cince instantiated. tell the main window that this variable should be used as the menu bar by calling SetMenuBar and passing the wxlvienuElarii as the argument. 4. Create a vocMenu* to represent the Ciptions menu and instantiate it to a new mMenu: 5. An option needs to be added to this menu using the Append method. Append takes two arguments. an ID [which we need to know] and the text for the menu option. 5. Now that an item has been added to the menu. the menu needs to be added to the menu bar. This is also done with the Append method. This append method takes in two arguments. the menu to be added and the text to show in the menu bar. 1 Each item in each menu needs a corresponding event. The event is a EVT_MENU.just like the tool bar button events. Add an E'v'T_lleNU event to the event table and create a corresponding event handler method. Setting Menu Handler 1. In the event handler method that was just created. create an instance of the settings dialog object. Remember to pass in the setting object as a pointer. 2. This window could be opened by calling Show in the same way that the main window was opened in App.cs. but that's not how a dialog box typically works. To open the settings dialog, call Show Modal: 3. Showiv'lodal will return a value based on whether the OK button or CANCEL button was clicked. To check for the OK button being clicked put Showlvlodal in an if statement to see if it equals m|D_CJl{. 4. If OK was clicked. then call the grid initialization method and then tell the drawing panel to refresh. Any change in grid size or color should be visible after clicking UK from the settings dialog. 5. Check where the game board is being cleared. It's possible that it is being cleared in a spot that reset the entire board every time the settings dialog is closed. That can be changed ifit is not the desired behavior. Wrap UpStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started