Project
Due Thursday, April 19 at 11:59 pm.
Make sure your application is object oriented!
If you have written a helper method that has many references to the members
of a class, then perhaps there should be a method for this operation in your
class. I will be looking for object oriented design when I grade the assignment.
Create a Multi-SDI Application
-
Create a new project. Add my
SdiTemplate.dll
into the application
directory and add a reference to it. Also add SdiTemplate.pdb
into the application. The application directory is the location of your main
form. ZIP of SdiTemplate.
-
Create two empty classes. Extend each one from
SdiTemplate.SdiView
. These will be two different views of the
same data. One view will display text drawn on the screen (drawing
view), the other view will show the corresonding data in a
DataGridView
(grid view).
-
Create a document that extends
SdiTemplate.SdiDoc
.
-
Extend the main form class from
SdiTemplate.SdiMainForm
.
-
Do not change my files. All changes should be in your extended classes.
-
Only one view needs to be visible at a time. Be sure there are menu options
for switching views.
Feautures
Tooltip - Everything that can have a tooltip should have a tooltip. This
includes all input elements, buttons, menu items, toolbar icons. Everything.
Help - Everything that can have help should have help. This includes all
input elements, buttons, menu items, toolbar icons. Everything. Any element
that can obtain focus should be able to have help appear when F1 is pressed.
Dialogs - Each dialog should have the help button enabled and help active.
All dialogs should validate input before proceeding with a button action,
except for the cancel button and the close button (the X in the title bar).
In those cases, no validation should be done. When invalid data is present,
use an error provider to display an icon. Validate all data in a dialog,
at the same time.
Menus - It is your responsibility to create the main menu for this assignment.
Add options for each part of the assignment. Organize the items appropriately.
Throughout the previous assignments, menu items were often checked or disabled;
it is your responsibility to make your menu items as user-friendly as possible.
-
Use check marks on menu items, as appropriate.
-
Disable menu items, as appropriate.
-
For each menu item, when the mouse enters the item, update the status bar
with help information.
-
When the mouse leaves the item, clear the information in the status bar.
Top Level Form - Be able to perform the following tasks for the top level
forms.
-
Display a menu that lists all the open top level forms.
-
Close the current form.
-
Close all the forms and exit the application.
-
Tile the open forms. Set the forms to a predefined minimum size before tiling.
All windows must be at least partially visible on the desktop.
-
Cascade the open forms. Set the forms to a predefined minimum size before
cascading. All windows must be at least partially visible on the desktop.
-
Add a toolstrip that contains new, open, close, exit, paste, print, print
preview, help. Also include a search button that is only visible when the
view is in a draw view.
Add a data class to your project
-
Make the class serializable.
-
Add variables to the class to store a the location, text, scale and rotation.
-
Add properties to access these variables.
-
Add a method that can be called with a graphics object to draw the text.
Draw the text with any font and brush that you choose. Draw the text at the
point specified by location property, scale the text by the amount of the
scale property (both x and y are scaled the same amount), rotate the text
by the amount of the rotation property.
-
Add any other variables that you need.
-
Add any other methods that you need.
Document
-
Extend your document class from
SdiTemplate.SdiDoc
.
-
Create a generic
BindingList
(from
System.ComponentModel) for instances of your new data class.
-
Add a data element that will store the default values to be used when adding
new data elements to the document.
-
Add other members as needed. Any variable that needs to be saved, must be
in the document.
-
Add helper methods as needed, including accessors and mutators for accessing
data in the document.
-
Override the
DeleteContents
method. This method in the base
class already calls UpdateAllViews
.
-
Use the
Modified
property to keep track of when the document
needs to be saved.
-
Whenever a document is being erased or overwritten, allow the user the option
to save the data before it is lost.
-
Be able to serialize and deserialize the document.
Data Dialog
-
Create a dialog that has text boxes for the location, scale, rotation and
text for a data element.
-
Add OK and Cancel buttons.
-
Validate that the scale is between 0.25 and 5.
-
Validate that the rotation is between 0.0 and 360.0.
-
Validate that the location is within the client area of the view.
Command-line Arguments - Treat all command line arguments as the names of
files that have already been saved by this application.
-
Open each of them in a new top level window.
-
You must be able to open all the files that are contained in the arguments.
Draw View
-
When the user right-clicks within the bounding rectangle of a data element,
open a modal data dialog that displays its current values. Allow the user
to change the values in the data element.
-
When the user right-clicks in any other area, open a modal data dialog to
set the default values that should be used for new elements that are added
to the document. In this case, do not show the location box. Store the default
values in the document.
-
When the user left-clicks in the bounding rectangle of a data element, drag
the data element.
-
The data element should follow the mouse. When the drag is complete, the
mouse should be in the same relative position in the rectangle as it was
when the drag started.
-
Use double buffering to redraw the view when dragging. Only use double buffering
when dragging.
-
If the data element does not have a hatched background (explained below),
then reset the background of all data elements.
-
When the user left-clicks in any other area, then draw a rectangle with a
dotted pen that grows as the mouse is dragged.
-
When the mouse is released, draw all data elements that are within the dotted
rectangle with a hatched background.
-
After changing the backgrounds, erase the dotted rectangle.
-
When a new dotted rectangle is started, reset the background of all data
elements.
-
When the user left-clicks in a rectangle that has a hatched background, then
all rectangles with hatched backgrounds will be dragged by the same amount.
-
Mutliple dragging will work on all data elements with hatched backgrounds,
whether they are selected by the dotted rectangle or selected by the
Find dialog (as described below).
Grid View
-
Add a DataGridView to the view.
-
Do not implement the details of the DataGridView, yet. After this is covered
in class, it will take you five minutes to configure the DataGridView.
-
Be able to modify the data in the DataGridView and have it change the data
stored in the document.
Thread - Search the local hard drive, in a separate thread, looking for files
with the .txt extension. When one is found, add it to a list in the document.
-
SearchMethods.txt contains methods that can
be used to search the local drives for text files. These methods need to
be modified to be used in a thread that can be paused and cancelled.
-
Be able to start, pause and cancel the thread.
-
Create a modeless dialog that will display the contents of the list in a
ListView.
-
Be able to select a file from the list and add the contents of the file to
the document.
Printing - Print the document with a header and a footer on each page. Place
the page number at the bottom right corner of each page.
Drag and Drop - Enable text to be dragged into either view.
-
When text is dragged into either view, split the data into words.
-
Add each word as a new data element in the document.
-
Give each word the default scale and rotation.
-
Be sure that new words are placed at different locations from each other.
Paste - Enable text to be pasted into either view.
-
When text is pasted into either view, split the data into words.
-
Add each word as a new data element in the document.
-
Give each word the default scale and rotation.
-
Be sure that new words are placed at different locations from each other.
Notify Icon
-
Add a context menu to the notify icon
-
Tile - tile all the open top level forms.
-
Cascade - cascade all the open top level forms.
-
Exit - close all the open top level forms and close the application.
-
Create or add three icons in the application resources.
-
One icon will represent that the open windows were just tiled.
-
One icon will represent that the open windows were just cascaded.
-
One icon will represent that the windows have not been tiled or cascaded,
or that a window has been opened, moved or closed since the last tile or
cascade.
-
Change the icon for the notify icon to reflect the correct state.
Find Dialog - Modeless Dialog. Search through all the data elements looking
for criteria. For each data element that matches the search criteria, draw
its background with a hatched brush. When the dialog is reopened, reset the
background of each data element. Only allow one Find dialog to be
open at a time.
-
Text - Be able to search for text.
-
Text box to enter the value to search for.
-
Radio group to indicate the type of search: contains or equals.
-
Checkbox to indicate if search should use the text criteria. If this is not
checked, then the value of the text will not be used to limit the search.
-
Scale - Search based on the value of the scale.
-
Two text boxes - one for the min range and one for the max range. If exact
match is selected, then the max box should be hidden and only the min box
will be visible. Change the label appropriately.
-
Radio group to indicate the type of search: exact match or range.
-
Checkbox to indicate if search should use the scale criteria. If this is
not checked, then the value of the scale will not be used to limit the search.
-
Search button in the dialog.
-
Validate that one of the checkboxes is selected.
-
Validate that the min scale is greater than or equal to 0.25 and less than
or equal to 5.
-
Validate that the max scale is greater than or equal to 0.25 and less than
or equal to 5, if it is visible.
-
Validate that the max scale is greater than the min scale, if it is visible.
-
Search for the data elements that match the criteria. For all matching data
elements, change the background to a hatched brush. If none are found, show
a message box.
-
The dialog may access the document, via the parent, but may not access anything
else from the parent or other forms.
-
Close button.
-
Do not perform any validation when this button is clicked.