COP4226 Assignment 5
Due Friday, 4/13 at 11:59 pm.
Create a Single Instance MDI Application
-
Create a Single Instance MDI Application. You mat start with the example
from the end of Chapter 14.
-
A new child form should be the main form from HW3, which used a rich text
box.
-
From the project, add exising items. Select the items that you need from
HW3.
-
It is alright if some of the features from HW3 do not work.
-
It is important that you have the menu and toolbars defined from HW3.
-
It is important that File Open and File New work from HW3.
MainForm
-
Add a main menu with these options.
-
File
-
New - Open a new child window. The child should be the top level form from
HW3.
-
Open - Open a file dialog to select a text file. Open the text file in a
new child window. The child should be the top level form from HW3.
-
Exit - Close the application.
-
Thread
-
Pause - If the thread is running, then this option should be unchecked. When
the thread is paused, this option should be checked. When this option is
clicked, toggle the state of the item and pause or un-pause the thread, as
appropriate.
-
Stop - Stop the thread and disable both the Stop item and the Pause item.
If the Pause item is checked, then uncheck it.
-
Window - Hide this item. This item is only used as a placeholder for an open
child.
-
Add a toolbar with these icons.
-
File New - Same as File New menu.
-
File Open - Same as File Open menu.
-
When the application starts, start a thread that will search the hard drive.
-
Be able to pause the thread.
-
Be able to stop the thread.
-
Here is a file that contains methods that can search the hard drives on your
system: SearchMethods.txt. You need to modify
them to work with the thread. When an RTF file is found, print its name in
the active child window. If there is no active child, then do nothing with
the filename.
-
The thread may only change variables that it creates.
-
When a child is active, merge the menus and toolbars. Merging the menus can
be done from the property window. Merging the toolbars requires a little
more work.
-
When a child is activated, merge its toolbar with the parent's toolbar.
-
When a child is deactivated, restore the parent to its default toolbar (or
unmerge the child's toolbar).
Child Form
-
The child form class should be the top level form class from HW3.
-
Implement printing and print preview. Use the information from the
additional
readings and print the text as rich text.
-
Menus and Toolbars
-
Merge the child's File and Window menus with the parent's.
-
The File New menu option and toolbar should clear the text in the current
rich text box. This should replace File New in the parent's menu and toolbar.
-
Hide the parent's New icon in the toolbar when a child is open. Use the same icon to
implement the Clear option in the child.
-
The File Open menu option and toolbar should open a file in the current rich
text box. This should replace File Open in the parent's menu and toolbar.
-
The Window menu should
replace merge with the Window menu in the parent.
Only show the window menu when there is an open child.
Use the parent's toolstrip property, MdiWindowListItem, to generate the list of open windows, do
not use your application context from HW3 to do this.
-
All other items in the menu and toolbar should be added to the parent's menu
and toolbar.
-
When no child windows are open, then the main menu and toolbar should revert
to the simple menu and toolbar that were defined for the parent form.
-
Hide the toolbar for the child. Its items should be merged with the parent
toolbar.