
Copy files to your directory, and then rename tempMain.C to
be main.C. When you compile and run, you should get the output 
in test.temp.std.

Your first goal -- while I frantically finish typing the handout :-) -- 
is to read over the given code and understand why you get the output
you do. There is a (Java.awt)-esque inheritance hierarchy here.


		Component
		/    \
               /      \
              /        \
        Container       Button
         /
        /
       /
     Window 


Component and Container are abstract -- i.e. they have pure virtual functions.
Thus you cannot allocate objects of type Component and Container. 
However, they exist so that you can create concrete class that are
more specific versions of the Component and Container classes. That is
what we have done with Button, and with Window. 

Your task in MP3 is going to be to write a first new class that derives
directly from Component, as Button does, and to write a second new claass 
that derives directly from Container, as Window does. So, it's another
one of these MPs where the amount of given code far outweighs the 
amount of code you have to actually write. Which means that even though
*I* have been writing code like mad, your task will actually go quite
quickly, aside from the twin tasks of reading/understanding the given code,
and gaining a full understanding of C++ inheritance syntax. 

So, task #1 for you is to read through the given code, as I finish
the handout so you know what additional two classes to write. 


UPDATE!!!!!!


2/14/99, 9am

 New files:
     main.C
     testfns.*
     simsys.*
     Makefile.given
     Makefile
     test.given.std
     test.1.std
 Updated file that you should download:
     button.C (just altered the button printout line in Draw(); it
               won't affect your code in the slightest but it makes
               output look nicer)
 Don't bother with: 
     tempTest/
     tempTest/tempMain.C
     tempTest/test.temp.std
     forHandin/
     forHandin/testfns.C

              -- tempTest contains the temporary code to run
		  that I gave you yesterday
              -- forHandin contains a version of testfns.C with
	          nothing commented out, so that handin can run. 

What to do:

   Copy all code into your directory. Then, copy Makefile.given 
   into Makefile, so as to run compilation on the given code. 
   Output should be identical to test/test.given.std


   Then, re-copy the regular Makefile, and uncomment the parts
   of the first function in testfns.C that are commented out, 
   plus uncomment the two #include statements. Then, recompile 
   and run, and assumging you did things right, the code will 
   compile and generate output equal to test.1.std. 



UPDATE!!!

2/14/99  2:30pm

   Based on posts in the newsgroup pointing out a problem or two, 
between 1:45pm and 2:30pm:

     1) I replaced the component.h and simsys.C files with new versions
        and clearly marked what code was added (only a line or two in 
        both cases) and why. This corrected a memory leak problem, which 
        slipped past me because I forgot to run the code through purify 
        before releasing it. Sorry!


     2) The permissions on Makefile.given, test/test.given.std, and
	test/test.1.std were now fixed and you should now be able to read 
        them. In addition, this should fix the bizarre "output truncated
        to 0 lines" error that people were getting when they handed in,
        since handin reads (or tries to read, anyway) the above-mentioned 
        test.1.std file while running. 




   

