COP4226 Assignment 4
Due Thursday , 12/7 at 11:59 pm.
You are to incorporate Assignment 3 into this assignment.
If you did not complete Asisgnment 3, then see me for help ASAP.
Create a Sinlgle Instance MDI Application
-
Create the application as a single instance MDI application. When a new instance
is created with command line arguments, treat the arugments as file names
that were previously saved by the application. Open each file in a new child
window with its own document.
-
Add a new form to the project, select the MDI Parent from the list
of templates. This will create menu options and toolbars items for a typical
MDI application.
-
Set the MDI Parent form as the main form of the application.
-
Handle the actions of the main form menu. The ones that are not mentioned
below should be removed from the main menu; some of them will be added to
the child menu. It is possible to copy menu options from one menu to another
using copy and paste.
-
File
-
New - Create a new child window that creates a new document and opens it
in a draw view.
-
Open - Open a Save File Dialog and open a file that has been saved by this
applicaiton. Open the file in a draw view.
-
Exit - Close all open children and exit the application. If any of the documents
have changed since the last save, give the user the opportunity to save the data.
-
View
-
Toolbar - Use the default behavior.
-
Statusbar - Use the default behavior.
-
Search - Toggle searching for extraterrestrial life. When checked, pause
the search for extraterrestrial life.
-
Cancel Search - Stop the thread that is searching for extraterrstrial life.
-
Disable the Search option when the thread is cancelled.
-
Disable this option after it is clicked.
-
Tools
-
Options - Open a dialog that will set the default values for new data objects.
-
This option should only be enabled when a draw view is the active view.
-
All new data objects will use the values that were entered in the dialog;
data objects that have already been created will not be affected by these
changes.
-
The current default values should be used to initialize the elements in the
dialog.
-
Open the dialog modelessly.
-
Use data binding, so that any changes made to the controls in the dialog
take effect immediately in the view.
-
Help
-
About - Add a short description for the assignment.
-
Add an option for the oath dialog from homework one.
-
Map the toolbar handlers to the corresponding menu handlers.
-
Add your HW3 context/doc/view/main classes to the project. Add other classes
if you need them.
-
I have made a few modifications to SdiBaseSimple. Please get a new copy:
SdiBaseSimple DLL.
-
For each child window
-
Display its own toolbar and statusbar in place of the default toolbar and
statusbar whenever it has focus. It should display the toolbar and statusbar
in the main form, not in the child form. ToolStrip and StatusStrip are marshal
by reference classes. If the toolbar or statusbar are hidden when the view
is deactivated, it should still be hidden when the view is reactivated.
-
The toolbar and statusbar should behave as they did in HW3.
-
Combine its menu with the main menu.
-
File - Merge these items with the File menu options from the parent form.
Make sure that New and Open from the parent menu remain as the first two
options, after the merge. Make the Exit option the last option, after the
merge.
-
Rename the New menu option to Clear. It will erase the current document. If the document
has changed since the last save, give the user the opportunity to save the data.
-
Save - If the current document has already been saved, then save it under
the same name. If it has not been save, then open a Save File Dialog and
save the current document.
-
Save As - Open a Save File Dialog and save the current document.
-
Print - Print the current document.
-
Add a header to each page.
-
Add a footer to each page.
-
On each page, display 5 data objects.
-
The first row on each page should contain column headings.
-
Display the properties of the object on one line.
-
Format the output so that the properties appear in columns.
-
Print Preview - Open a print preview dialog for the current document.
-
Print Setup - Open a page setup dialog for the current document.
-
Close - Close the current view for the current document. If there is another
view for this document, make it active. If the document
has changed since the last save, give the user the opportunity to save the data.
-
Close All - Close all the open views for the current document. If there is
another view for another document that is open, make it the actvie view. If any of the documents
has changed since the last save, give the user the opportunity to save the data.
-
Edit - In the following, the current object is the one that has been added,
dragged or whose dialog has been opened.
-
Cut - Remove the current object from the document, but keep a pointer to
it.
-
Copy - Create a copy of the current object.
-
Paste - Add a cut or copied object into the current view. This could be a
different view than the one that originally contained the cut or copied object.
-
View - Merge these items with the View menu options from the parent form.
Make sure that the options from the parent menu are the last options, after
the merge.
-
Draw - The same as in Hw3.
-
List - The same as in Hw3.
-
New Top Level - Open a new child window using the current document. Open
it in a draw view.
-
Zoom - The same as in Hw3.
-
When the application is created, start a thread
-
The thread will check for radio transmissions from one of Mars (0), Mercury
(1), Venus(2), Jupiter(3) or Saturn(4). In the thread, check for a transmission
every second (use
Thread.Sleep
to pause the thread). In this
thread, a transmission will be simulated as follows: if the current number
of seconds is a perfect square. If it is a perfect square, then determine
the planet that send the transnission as follows: take the square root, as
an integer, and reduce it modulo 5. This will be the index of the planet
that sent the message. Use an enumeration to represent the planets.
-
The search for extraterrestrial life can be paused by View -> Search
menu. If this menu option is checked, then searching for extraterrestrial
life should be enabled. If it is unchecked, then searching should pause.
When paused, the thread is still active, it just isn't doing any calculations;
the thread should check every second if it needs to start searching again.
-
When a transmission is received,
-
If there is an open child, add a new data object to the current document.
Set the text as the planet and the time of the transmission.
-
If there is not an open child, do not display the transimssion.
-
The thread is only allowed to access the background worker that it is running
on; it may not access any other variables or controls that it did not create
or were not passed to it.
-
Be sure that when the application closes that the thread is allowed to terminate
before the application closes.