COP4226, Homework 3
Due Monday, November 10 (late 6am 11/11)
Zip your entire project and upload on the web. Exclude the
Debug and Release directories.
Submitting
Homework Online.
Be sure to include your control library in your uploaded file.
Create a Single Instance, Single Document Interface application.
Avoid long methods. Each method that you create should be short, to promote
encapsulation. If you have a method that is longer than 25 lines, then it
probably needs to be divided into smaller methods.
Do not create a new data structure if one that already exists will
solve the problem.
Encapsulate!!!
Single Instance Application
- Create a single instance application.
- Use an application context that displays a message box every three minutes that the application is running. The message box should indicate the total time that the application has been running.
- Add a status bar that indicates the state of the insert key.
- Allow drag and drop of text. Allow copy of text from the clipboard. In both cases, split the text into words. Add the new text to the document. If the insert key is off, then clear the document of words first. It is not necessary to implement dragging text out of the application, you only have to implement dropping text into the application.
- Display all words so that they fit within the client area and do not overlap each other.
Add a vertical scroll bar, if necessary. Display each word at its location, using its font. Changes to the document should reflect in this view.
- Create a document class to store the words. Use encapsulation so the other classes do not know the implementation details of the document.
- Create a data class for a word. Use encapsulation so that other classes do not know the implementation details of the data class. The data class should have the following properties, at least:
- Text
- Location
- Font (including font size and font family)
- Rotation
- Be able to drag any word to a new location.
- Be able to right click any word and open a modeless dialog.
- Be able to change the text, location, rotation and font.
- Only allow one dialog to be open at a time.
- Only allow one word for the text.
- Use data binding.
- Add next and previous buttons that will navigate through the words in the document.
- Be able to move the dialog by using the arrow keys. Maintain the default handling of the arrow keys, too.
- When the dialog is open, right-clicking on a word in the main form will make that word the current item in the modeless dialog.
- When a new instance of the application is started, add each command line argument to the document. If the insert key is off, then clear the document first.
- Allow serialization and deserialization of the document.
- Use a SaveFileDialog for serializing. Add a default extension of your choice.
- Use an OpenFileDialog for deseraializing. Show only files with your extension. Allow for another option to display all files.
- Add Oath and About dialogs to the application.
- Add appropriate menu items for all the functions in the assignment.
- Add a toolbar for file open, file save, paste from clipboard. It should appear directly below the main menu for the application. You
may need to change the docking order in order to make it appear correctly. Enable/disable the paste icon according to what is in the clipboard.
- Use your control library as in other assignments.
- Make your application as user friendly as possible, using menus, toolstrips, tooltips, error providers, etc.