COP4226, Assignment 6
Due Monday, 10/3 (late 10/4 at 6 AM)
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.
Multi-SDI Application
This application will be an example of a Multiple - Single Document Interface (Multi-SDI)
application. It will create a better notepad that can open multiple windows.
Implement encapsulation. Separate the view from the document.
Application Context
Use the Visual Basic application context.
- Create a multiple document - single instance application. This is not an MDI application, each new document will have its own top level form.
- Maintain the window menu for all open documents.
- Instead of having the main class register the window menu with the application context using a method, implement an interface for the main form that has a property for the window menu. When the main form registers with the application class, use the interface to access the window menu from the main form.
Main Application
The main application will handle editing of the document. Just handle plain text. Do not do anything special for rich text.
- Allow the user to select the font and font color to display the text in the window. Each window can have its own font and color. Open a preferences dialog for color and font.
- Initialize the preferences with the current color and font.
- The user may select a color by using a color dialog, but then display the red, blue and green components of the color. Allow the user to change these values. Build the new color from the preferences.
- The user may select a font by using a font dialog, but then display the font name, font size and possible styles. Allow the user to change these values. Build the new font from the preferences.
- Allow drag and drop of text.
- Allow copy and paste of text in the clipboard.
- Allow serialization and deserialization of each 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.
- For both open and save, limit the visible files to those with a specific extension for your application.
- If an extension is not included when saving, have the extension added automatcially.
- In additon to the text, each document should save the font and font color that is used in the window.
- Allow the active window to be moved while using the control key with the arrow keys.
- Add a menu bar for all the options in the application.
- Add a toolbar for file new, file open, file save, file save as, file exit, edit copy, edit paste, edit cut. 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.
- Add a text box (not a rich text box) that fills the remaining area. A rich text box has many methods that make life easy. You may use any method in text box.
- Make your application as user friendly as possible, using menus, toolstrips, tooltips, error providers, etc.
- Add a status bar with relevant information about the current form. Include the state of the CapLock key in the status bar.
- Add a help menu with About and Oath dialogs.
- Add a notify icon whose context menu shows the Window menu. Change the default icon for the component.