COP4226, Project 2
Due Thursday, 6/20 at the start of class.
Upload a ZIP file of your project. Include several different files that can
be loaded into our application, one of them should contain at least 20 records.
Include the res directory, exclude the debug and release
directories. Hand in copies of your .h files only. Do not hand in
the .cpp files, I will read them from what you upload.
Continue to modify Tutorial 3 to create Project 2.
-
Add the following options to the Student menu. Add toolbars as well.
-
Adding a record to the end of the database.
-
Adding a record to the start of the database.
-
Removing the last record from the database.
-
Removing the first record from the database.
-
When a record is deleted from the database, move the position to the previous
record in the database. Only move to the first record if the second record
is being removed.
-
Add a new panel to the staus bar that indicates the number of records that
are in the database.
-
Enable serialization so that a database can be saved to a file and restored
from a file.
-
When a file is loaded, display the first record from the database.
-
I will call the view from tutorial 3 the Form View. Add a modeless
dialog to the From View that will allow the user to search for a particular
record in the database.
-
There will be a check box and an edit box for each field in a record. If
the check box is checked, then enable the corresponding edit box.
-
There will be Find and Cancel buttons.
-
When Find is clicked, for each check box that is checked, search for
a record that matches all the criteria. If no record is found, then display
a message box using AfxMessageBox.
-
When Cancel is clicked, close the dialog.
-
Add an option to the Edit menu to call this dialog. The option should be
enabled if the data base is not empty. Add an accelerator of CTRL-F for this
option.
-
When creating this dialog in the resource editor, uncheck Visible.
After creating the dialog at runtime, use MoveWindow to move the window to
a better location, then make the window visible.
-
It is possible that the user could switch views while this dialog is displayed.
In this event, close the dialog. Look at the ActivateView method.
-
Add another view to your project. I will refer to it as the List View.
The base class should be CView. It should list all of the records in the
database in a nice table. Line up the fields in columns, include headings
for each column. Add options to the View menu to switch to either the new
view or the old view. The options should only be enabled for the view that
is not the active view.
-
Add printing support for the new view.
-
You will need to add some options to the file menu for printing, add some
handlers, and add the functions for Preparing, Beginning, and Ending printing.
Refer to a previous project that has printing support. Yes, it is the same
excelerator and same menu choice as the ones for the Form View dialog.
-
Print 5 records to a page. Include a nice header and footer on each page.
-
Add a property sheet for the new view. The property sheet will control which
records are displayed in the List View.
-
Add an option to the Edit menu to call the property sheet. The option should
be enabled if the data base is not empty. Add an accelerator of CTRL-F for
this option.
-
There will be four pages in the sheet: one for each field in a record.
-
Each page will have a set of three radio buttons
-
Do not Match
-
Single Match. Associated with this radio button will be
-
An edit box that contains the value to match
-
A radio group with the following options
-
Exact
-
Starts with
-
Contains
-
The edit box and radio group should not be enabled if Single Match is
not selected.
-
Match a Range. Associated with this radio button will be
-
An edit box for the minimum value
-
An edit box for the maximum value
-
The edit boxes should not be enabled if Match a Range is not
selected.
-
When the Apply button is pressed, the view should be updated, but the property
sheet should remain open.
-
Use the selected criteria on each page to choose which records from the data
base will be displayed in the List View.
-
Add a dialog for a clock. The clock will be updated every second and will
display the hours, minutes and seconds that the current instance of the
application has been running.
-
Create it as a modeless dialog.
-
Position it in the lower right corner of the current view.
-
Add an option to the View menu to show or hide the clock.
-
Use a timer to send a message to the clock every second.
-
Add a clock dialog member to the document. Construct it and destroy it in
the document.
-
When a view is initialized, if there is no clock, then create it.
-
Either view should be able to control thge visibility of the clock.
-
The clock dose not have to be fancy. I created a dialog with some static
controls, and just updated them when the timer sent a message. Try the function
SetWindowText for a static control.