COP4226, Assignment 2
Due Friday, February 24 at 6 PM.
Zip your entire project and upload it on the web. Exclude all of the
Debug and Release directories.
Submitting
Homework Online.
This is an extension of HW1. Fix any errors that you had in HW1.
-
Add File, View, and Help menus to the main menu.
-
Under the File drop down, add Exit.
-
Under the View drop down, add Display, Close All, and Colors.
-
Colors will have a submenu of Background and Foreground.
-
Under the Help drop down, add About and Initials.
-
Add a notify icon.
-
Add a context menu with the options of Tile, Cascade, Close All, and Exit.
Place a separator between Close All and Exit.
-
Implement context sensitive help for all controls on the main form: input,
output, buttons. Enable context sensitive help so that the question mark
appears in the title bar.
-
The main form should implement the exchange interface described below.
-
Create a data exchange method that has two arguments of the
exchange interface type. Use this method to exchange data between the
main form and a display dialog, and vice versa.
-
When the main form is moved, it should also move the initials dialog described
below, by the same amount.
-
When the delegate for the display dialog is fired, initilize the main form
with the data and settings from the display dialog. Also, display the ID
from the display dialog in the title bar of the main form, along with the
name of the application.
Exchange Interface
-
Create an interface that will contain properties for all the data that is
being exchanged between the main form and the display dialog.
-
The main form and display dialog classes should implement this interface.
-
If you create a custom event args class, it should implement this interface.
Display Dialog
-
Create a new form that will display the current values and settings from
the main form.
-
Display the Distance, Angle, Size, Output, Planet, Firing Method as read-only.
-
Add a field for an ID.
-
Turn on default error validation for this field.
-
When the form opens, this field should have the focus.
-
Validate that the ID has the format of three to five letters followed by
a period, followed by a date in the format yy-mm-dd, yy:mm:dd, or yy/mm/dd.
-
The two digit year can only be for 90-99, or 00-09.
-
The two digit month can only be 01-12.
-
The two digit day can only be 01-31.
-
When the ID changes, set it as the title of its form.
-
Add an Apply button to the form. It should cause validation.
-
When the apply button is clicked, fire a delegate.
-
Add a Cancel button to the from. It should not cause validation.
-
This class should implement the exchange interface.
-
This form may not access any properties or methods of the main form. It should
know nothing about the main form.
-
Implement context sensitive help for this dialog. Enable context sensitive
help so that the question mark appears in the title bar.
-
Do not show this forms icon in the taskbar.
-
These forms should always display above the main form in the Z-order
-
I will refer to these dialogs as display dialogs.
Initials Dialog
-
Create a form whose region is your initials. Refer to the GraphicsPath.AddString
to make a path based on a string.
-
Do not display a title bar, nor a frame for this form.
-
When the form is double-clicked, close it. Fire a delegate when the dialog
closes.
-
Be able to drag this form with the mouse.
-
Open the form to the right of the main form.
-
This form may not access any properties or methods of the main form. It should
know nothing about the main form.
-
Do not show this forms icon in the taskbar.
-
This form should always display above the main form in the Z-order
-
I will refer to this as the initials dialog.
Main Form Main Menu
-
File Exit: close the application.
-
View Display: open a display dialog modelessly.
-
View Close All: close all the display dialogs that are open.
-
View Colors Background: open a color dialog and change the background color
of the main form and all the open display dialogs. New display dialogs will
use the current background color of the main form.
-
View Colors Foreground: open a color dialog and change the foreground color
of the main form and all the open display dialogs. New display dialogs will
use the current foreground color of the main form.
-
Help About: open the oath dialog from HW1.
-
Help Initials: display an initials dialog modelessly. Only allow one initials
dialog to display at a time. Disable this menu option when one is open. Reneable
this option when the dialog closes.
Notify Context Menu
-
Tile: tile the open display dialogs on the desktop. Resize each display dialog
to the minimum size so that all the controls are visible. Starting in the
upper left corner place each dialog next to each other. When the first row
is full, start a new row directly below the first row. Continue in this way
until all the dialogs are arranged. If there are too many to fit on one screen,
then start over again at the upper left corner. Be sure that the tiling does
not cover the title bar of the main form.
-
Cascade: cascade all the open display dialogs starting from the upper left
corner of the desktop. Resize each display dialog to the minimum size so
that all the controls are visible. Overlap the dialogs so that the next dialog
is located directly below the the title bar of the previous form. Offset
the next dialog to the right of the previous dialog by the height of the
title bar. If there are too many to fit on one screen, then start over again
at the upper left corner. Be sure that the cascade does not cover the title
bar of the main form.
-
Close All: this will perform the same action as the menu item View Close
All.
-
Exit: this will perform the same action as the menu File Exit.