Question: 1. Now that there is an object that can be used to store sellings, it makes sense to have The ability to change those sellings.

1. Now that there is an object that can be used to store sellings, it makes sense to have The ability to change those sellings. 2. This will require the use of a new control type called a wxDialog. 3. Create a new class that inherits from wxDialog. The wxWindow* will need to be passed in to this object so that is can be used by the waDialog base class. The base class will need the parent, an ID (doesnis 't matter what it is), and a window title. 4. Since the point of this window is to configure settings, passing in a pointer to the dialog window would make sense. This can be done in the constructor or via a seller. 5. The main content of the dialog is going to be a box sizer that will stack controls vertically. 6. The controls that will be stored in this main box sizer will be a series of box sizers that will stack controls horizontally. Cach of these boxes will contain a label and a control to set the value of the selling. 7. Create a walBox Sizer pointer for the main box and set it to a new wxBoxSizer. Pass in wxVertical as an argument for the new object. Using SetSizer, set the main sizer of the window to this sizer. B. There are two types of child box sizers that will be created. a. Both types will be a waBoxSizer that uses wxHorizontal as an argument. b. Both types will contain a label, which will be the wxStaticText control. The wxStaticText control takes in a parent (this], an ID (wxID ANY], and the text to be displayed. L. One type of the child box will use a wxSpinCurl. This is a special type of text box that is used to select numbers. It is initialized like the label, but the ID is important because it will be used for selling up events. i. wxSpinCurl will require a new import. The file is "wx/spincurlh" ii. For more help with the wxSpinCurl, check out the documentation at https //docs.wxwidgets.org/stable/classwx spin curl.html d. The other type of child box will use a wxColourPickerCurl. This is a control that allows the user to select a color. It is initialized with a parent and an ID, which needs Lo be tracked. i. wxColourPicker Curl will require a new import. The file is "wx/clrpicker.h" ii. For more help with the wxColourPicker Curl, check out the documentation at https //docs.wxwidgets.org/trunk/classwx colour picker curLhtml e. The wxSpinCurl and wxColourPicker Curl objects will need to be declared in the dialog header file so that other methods can interact with them. 9. Create the child boxes for each of the settings that will be configured in this dialog box. It is not necessary to have all settings configured in one dialog box. Multiple dialogs can be used. 10. The final box to be added is a special box that contains buttons for OK and CANCEL. This is such a common item that waWidgets provided a special function for create this Sizer. Create a wxSizer* and set it equal to Create ButtonSizer(wxOK | wxCANCEL 11. After creating all of the boxes in the constructor with the spinner and color picker controls, the values of the controls should be set from the settings object painter. Settings Dialog Events 1. An event table will be used for the events related to the spin control and the color picker control. 2. Add wxDECLARE EVENT TABLOCK to the settings dialog header file. 3. Cach spin control will need an event that takes in a wxSpinEvent as its parameter. Add an event method to the header file for each spin control. 4. Cach color picker control will need an event that takes in a wxColourPicker Event as its parameter. Add an event method to the header file for each color picker control. 5. In the implementation of each event method, the value from the event needs to be Saved back to the sellings object so it can be used outside of this window. 6. Following the syntax from the main window, add an evenit table to the settings dialog .cpp file. 7. The event table will need to handle two kinds of event CVT SPINCTRL and CVT COLOURPICKER CHANGED. Connect those events to the appropriate IDs and event methods

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 Mathematics Questions!