00001
00002
00003
00004
00005
00006
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;
00050 y = 0;}
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