Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

spywin.c

Go to the documentation of this file.
00001 /**********************************************************************
00002 * FILE: spywin.c
00003 * AUTHOR: SRW
00004 * DATE: May 1, 1993
00005 * PURPOSE:
00006 *   Houses the rest of the user interface
00007 ***********************************************************************/
00008 
00009 #include "ui.h"
00010 
00011 #include <stdio.h>
00012 #include <assert.h>
00013 #include "msgwin.h"
00014 #include "popupwin.h"
00015 #include "keybd.h"
00016 #include "button.h"
00017 #include "moves.h"
00018 
00019 
00020 
00021 void UserInterface::ShowSpyMoves (MoveList& moves)
00022 {
00023   PopUpWin *SMWindow = new PopUpWin(200, 170, BLUE, WHITE, "Spy Moves", WHITE);
00024   assert (SMWindow != NULL);
00025   SMWindow->Init(&theDisplay, 100, 100);
00026   PushButton *pb = new PushButton (" OK ", BLUE, 0xF0);
00027   assert (pb != NULL);
00028   SMWindow->Client().Add (pb, (SMWindow->Client().GetMaxX()/2) - (pb->GetXDim()/2), SMWindow->Client().GetMaxY() - pb->GetYDim() - 5);
00029   SMWindow->Draw();
00030   SMWindow->Client().SetColor (BLACK);
00031 
00032   Move *current;
00033   char info[20];
00034   moves.Reset();
00035   int i = 1,AddlX = 0, y = 0;
00036   if (moves.Reset())
00037   {
00038     do {
00039       current = moves.GetCurrent();
00040       if (current->Trans==SubwayMask)
00041    {sprintf (info, "%2d: Subway", i);}
00042       else
00043       if (current->Trans==TaxiMask)
00044    {sprintf (info, "%2d: Taxi", i);}
00045       else
00046       if (current->Trans==BusMask)
00047    {sprintf (info, "%2d: Bus", i);}
00048       if (i == 13)
00049   {AddlX = 100; // puts text in second column
00050    y = 0;}      // puts text in first row
00051       SMWindow->Client().OutTextXY(5 + AddlX, 5 + (8*y), info);
00052       i++;
00053       y++;
00054     } while (moves.Next());
00055   }
00056   Message m;
00057   do
00058   {
00059     m = SMWindow->Client().Dispatch (Mouse.Event());
00060   } while (m.code != ButtonPress);
00061   delete SMWindow;
00062 }
00063 

Generated on Sun Jul 6 23:07:16 2003 for Scotland Yard by doxygen1.2.15