COP4226, Assignment 2
Due Tuesday, February 13, at 11:59 PM.
Zip your entire project and upload it on the web. Exclude all of the
Debug and Release directories.
Submitting
Homework Online.
Create a windows forms application.
-
Add the DLL for the control library from Homework 1 to your application.
-
Add a reference to your control library.
-
Add the Oath from HW1 to this application.
-
Add a main menu to the application.
-
Add a Help menu.
-
Add an Oath item. Open the oath dialog.
-
Add an About item. Add an about dialog that explains the homework.
-
Do not change the namespace from Homework 1 for the Oath dialog. It
should use a different namespace than the one for the current assignment.
-
Add a panel to the form.
-
Dock the panel to the top of the form.
-
Add two buttons to the panel.
-
One button will open the input dialog (explained below) modally.
-
When the dialog closes, display the data from the dialog in a mulitline label
in the panel.
-
One button will open the input dialog modelessly.
-
When the dialog closes, display the data from the dialog in a mulitline label
in the panel.
-
When the dialog sends a message that the data has changed, read the data
from the dialog and display the data from the dialog in a mulitline label.
-
Add a splitter to the form. Dock it to the top. Change its color.
-
Add another panel to the form. Dock it to the left.
-
When the user clicks a point in this panel, save the point in a generic list
of points and redraw the panel.
-
If there is more than one point in the collection, draw curves between all
the points, in the order that they were added to the collection.
-
Use a pen with a width greater than 4.
-
If there is only one point, then draw a small circle whose diameter is the
width of the pen used to draw the lines.
-
Add a context menu to this panel with one option named Clear Points. When
clicked, it will clear the list of points.
-
Add another splitter to the form. Dock it to the left. Change its color.
-
Add another panel to the form. Have it fill the remaining form area.
-
Add a radio group to this panel to set the tension of the curve for the
neighboring panel.
-
Anchor this group to the bottom right corner.
-
Choose three different tension values.
-
When an option is clicked, change the tension value used to draw the curve
in the neighboring panel and redraw that panel.
-
Add another radio group to this panel to set the dash pattern for the pen
in the neighboring panel.
-
Anchor this group to the bottom right corner.
-
Choose three different dash patterns.
-
When an option is clicked, change the dash pattern of the pen used to draw
the curve in the neighboring panel and redraw that panel.
-
Create a new dialog form for data input.
-
Enable help for the dialog. Make the question mark appear in the control
bar.
-
Add tooltips and help information for all the controls, including the buttons.
-
If the dialog is opened modally, do the following.
-
Paint the background with a linear gradient brush that has three colors.
Make the dimensions of the brush no more than a few inches wide and a few
inches high.
-
Hide and disable the Apply button.
-
Be sure that the brush is replecated and paints the entire panel.
-
If the dialog is opened modelessly, do the following.
-
Paint the background with a path gradient brush that has three colors and
a center color. Make the dimensions of the brush equal to the client rectangle
-
Set the ControlStyle for ResizeRedraw to true for this dialog.
-
Change the focus of the brush to something other than the default.
-
When the form is deactivated, change the background to a hatching pattern.
When the form is activated, redraw with the path gradient brush.
-
Add three text boxes to the form.
-
Make up appropriate labels for the text boxes. Be creative, do not use names
like string, int, double.
-
One text box will contain only letters and spaces. There must be at least
two words in the string.
-
One text box will contain an integer within a range.
-
Pick a minimum value for the range.
-
Pick a maximum value for the range.
-
The number must be an integer and must be in the range.
-
One text box will contain a double within a range.
-
Pick a minimum value for the range.
-
Pick a maximum value for the range.
-
The number must be a double and must be in the range.
-
Add three buttons to the dialog: OK, Cancel, Apply.
-
OK and Cancel have their normal functions.
-
Apply is used to send a message that the data in the dialog has changed.
Do not close the dialog when this button is clicked.
-
When OK and Apply are clicked, validate that the text boxes meet the given
requirements.
-
Display an icon next to each control that is invalid. The icon should have
a tooltip that explains what the error is.
-
If all of the boxes are invalid, then all three should have an icon.
-
Only perform the action of the button if all the boxes are valid.