Project
Due Thursday, April 17 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.
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 and
show all the error icons, 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.
Add a data class to your project
-
Make the class serializable and implement IDisposable.
-
Add protected variables to the class to store 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
-
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.
-
Define a
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. Use the simplified, drag-and-drop method from Chapter
17 to create the input elements for the class.
-
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.
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 dashed border (explained below), then
set a solid border for all the 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 dashed border.
-
After changing the borders, erase the dotted rectangle.
-
When a new dotted rectangle is started, reset the border to solid for all
data elements that had a dashed border.
-
When the user left-clicks in a data element that has a dashed border,
then all dagta elements with dashed borders will be dragged by
the same amount.
-
Mutliple dragging will work on all data elements with dashed borders, 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.
-
The grid view will display all the data from the document.
-
Be able to modify the data in the DataGridView and have it change the data
stored in the document.
Thread - 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 transmission 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,
-
Add a new data object to the current document. Set the text as the planet
and the time of the transmission.
-
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.
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.
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 border to a dashed border. 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.
Oath and About - Add Oath and About dialogs to the application.