Question: Please help by showing how these steps are done! 5. Since the grid size will now be tracked in the settings object, it will be

Please help by showing how these steps are done!

Please help by showing how these steps are done! 5. Since thegrid size will now be tracked in the settings object, it will

5. Since the grid size will now be tracked in the settings object, it will be necessary to remove all existing references to that variable and replace them with the reference to the settings object. a. The easiest way to do this is to delete the size variable from the main window header le. b. The .cpp file will have many errors at this point. Each error can be xed by referencing the appropriate variable in the settings file. 6. Now that there is a settings object, this can be used to pass data to the drawing panel. Create a variable for a settings pointer to the drawing panel header file. 7. The value of the settings object pointer can either be set in the drawing panel constructor or through a setter. The easiest way is likely to create a setter for the settings pointer. 8. It will again be necessary to remove all existing references to variables in the drawing panel and replace them with the reference to the settings object pointer. 9. To test, change the default values in the settings object file and open the program. The interval, grid size, and colors should change based on the default values. #pragmaonce =#include "wx/wx. h" #include "DrawingPanel.h" #include class MainWindow : public wxFrame public: MainWindow(); ~MainWindow() ; WXDECLARE_EVENT_TABLE() ; private: wxBoxSizer* sizer; void OnSizeChange(wxSizeEvent& event); DrawingPanel* drawingPanel; // Game board std:: vector> gameBoard; // Grid size int gridSize = 15; // Initialize the game board void initGameBoard() ; // Set the grid size void setGridSize(int newSize); void UpdateStatusBar() ; // int generation; int livingCells; wxStatusBar* statusBar; wxToolBar* toolbar; void OnPlayButton (wxCommandEvent& event) ; void OnPauseButton (wxCommandEvent& event) ; void OnNextButton (wxCommandEvent& event) ; void OnTrashButton(wxCommandEvent& event); int countLivingNeighbors(int row, int col); void nextGeneration() ; wxTimer* m_timer; int m_timerInterval; void OnTimer(wxTimerEvent& event); wxButton* m_playButton; wxButton* m_pauseButton

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!