// Project 2
// CS2604 : Data Structures
// Hussein Suleman
// 14 July 1999

// ---------------------------------------------------------------------

#include <iostream.h>

#include "window.h"
#include "windowl.h"

// ---------------------------------------------------------------------

void ShowWindow ( Window * aWin )
{
   cout << aWin->GetData () << " ";
}

void ShowAllWindows ( WindowList * wl )
{
   wl->Traverse (&ShowWindow);
   cout << "\n";
}

int main ()
{
   cout << "Testing AddWindow ...\n\n";
   WindowList wl;
   ShowAllWindows (&wl);
   wl.AddWindow ("Netscape");
   ShowAllWindows (&wl);
   wl.AddWindow ("MicrosoftWord");
   ShowAllWindows (&wl);
   wl.AddWindow ("Notepad");
   ShowAllWindows (&wl);

   cout << "\nTesting NextWindow ... \n\n";
   wl.NextWindow ();
   ShowAllWindows (&wl);

   cout << "\nTesting PrevWindowx2 ... \n\n";
   wl.PrevWindow ();
   wl.PrevWindow ();
   ShowAllWindows (&wl);

   cout << "\nTesting DeleteWindow ... \n\n";
   for ( int i=0; i<5; i++ )
   {
      wl.DeleteWindow ();
      ShowAllWindows (&wl);
   }
}