Lab 3
Handed out: 11/4
Due: 12/9
This final lab builds upon your address book program. We will
introduce a menu bar with 2 menus, File and Help. It should look
like the following:

The application still accepts a command line parameter (an
address book to use).
- If the address book indicated by the command line
parameter exists, use it.
- If the address book does not exist, present a dialog
asking, "Filename does not exist. Create It?"
where the name they entered is substituted for the word
Filename in the text.
- If Yes, pop down the dialog and create the
address book and use it.
- If no is selected, pop down the dialog, but leave
the main window up. Any operations they do will
occur against a newly created address book. They
will need to use Save As to save the book out to
a new file.
- If no address book is provided on the command line, any
operations they do will occur against a newly created
address book. They will need to use Save As to save the
book out to a new file.
The File menu shall have the following options:
- New - Clear out any currently loaded address book data.
If there is any unsaved data, destroy it and clear out
the scrolled list of names.
- Open - Present the FileSelectionDialog for address book
selection. When the user selects an address book, load
the address book into memory and populate the scrolled
list. If the user has made changes to an existing book in
memory, the changes will be lost.
- Save - Save the current address book out to the current
file name
- Save As - Display a prompt dialog asking for the file
name to which the address book should be saved.
- Exit - Exit the application
The Help drop down menu should have 1 option, Application
Help. When selected, a dialog box should pop up with a brief
description of how to use the application.
The Menu bar should be the MenuBar child of the MainWindow of
your lab.
The help dropdown menu should be stuck to the right side of
the main window.
Extra Credit (5 points on the lab)
- If the user is about to do something (New or Open) which
could result in losing data currently not saved, warn
them with a pop up dialog. Give them the option of
continuing with the operation (i.e. losing their changes)
or canceling the operation.
Attached is the header file (called c_if.h)
which contains all of the address book functions you should need,
a sample program which uses the interface to
the address book utilities, as well as the format
of the data file. I recommend you compile the application
using the standard course makefile, which
you can modify if needed.
Please submit this lab to me using the normal Lab Submission Instructions.
Go back to Assignments