Assignment 9: OOP for Windows

Object Oriented Programming

In this assignment we want to explore the basic steps necessary to create a Windows program, complete with menu, button, graphics, file input and output, etc.

I have included links to several program segments, one resource file, and one executable file. Please

Create a new directory on your network drive
Download each file into that directory by clicking the on the links

Here are the files to download - simply click on the links. For the first two files, you will be asked to save them to disk. Choose the directory created previously. The next four files will appear inside your Netscape window. You could save them by using CUT and PASTE, or easier, when you click on the links, use the RIGHT mouse button to Save link to disk

Final Program: An example of the (almost) finished program - use left mouse button to click
Resource file: contains menu and window definitions - use left mouse button to click and RENAME THIS FILE TO sample.res instead of sample.exe
Final Program: source code of fields and methods
Linked List: our Linked List unit, modified for the Checkbook Program
Step 1: Basic Windows program, does nothing - use right mouse botton to save link
Step 2: Windows program with menu and one button - use right mouse button to save link
Step 3: Program with menus, buttons, and event handlers - use right mouse button to save link
Step 4: Program with menus, buttons, event handlers, and dialog box - use right mouse button to save link

Your tasks are to produce a four programs, each expanding on the one that I wrote. You will have to determine where in my sample program you should make the appropriate changes to arrive at the desired program. Specifically, please do the following:

Modify the step1.pas program
so that it includes your name in the title bar of the window
Modify the step2.pas program
so that it contains a menu (no changes), your name in the title bar, two buttons labeled HELLO and WELCOME. When you click on 'Hello', a dialog box should appear saying 'Hello', when you click on 'Welcome', a dialog box should appear saying 'Welcome'.
Modify the step3.pas program
so that it includes four buttons at the bottom of the window, labeled 'Insert', 'Delete', 'Edit', and 'Find', respectively. When you click on each button, it should add appropriate text into the list box of the main window. When you select the 'File-New' option on the menu bar, your list box should be cleared of all text.
Modify the step4.pas program
so that the edit button brings up the new dialog box, but containing the highlighted item in your list box so that you can actually edit it (as the button indicates). There is only one line to add to the program, but the question is what, and where. Here are some hints:
To add an item to a text area of a dialog box, you use the method PMyItem^.SetText(pString), where PMyItem is a variable of type PEdit (pointer to editable text area).
The type pString is, for our purposes, equivalent to an array of characters
Make sure you understand the purpose of the global variable gMessage.

You should finish your fourth program as soon as possible, but before next Wed. You do not have to turn it in, though. We will expand on the fourth program to arrive at a program close to the finished example program during the next lab.

If you can write a checkbook program that is 'better' than my program (which does lack several essential features, and contains a few bugs) than you will get extra credit for the final exam. The 'better' your program is, the more extra points you will get ! You must turn in your program no latter than the day of the final exam.

(bgw)