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

msgwin.h File Reference

#include "messages.h"

Go to the source code of this file.

Functions

Message MessageWin (int bc, int bkc, char *t, int tc, char **txt, int txtc)


Function Documentation

Message MessageWin int    bc,
int    bkc,
char *    t,
int    tc,
char **    txt,
int    txtc
 

Definition at line 16 of file msgwin.c.

References Display::Add(), ButtonPress, Window::Client(), Message::code, Display::Dispatch(), TextWin::Draw(), Viewport::GetMaxX(), Viewport::GetMaxY(), Window::GetXDim(), PushButton::GetXDim(), Window::GetYDim(), PushButton::GetYDim(), Window::Init(), and Margin.

Referenced by UserInterface::AnnounceWin(), ErrorWin(), UserInterface::GetPlayerMove(), UserInterface::NoLegalMoves(), UserInterface::RevealSpy(), and UserInterface::SpyTurn().

00017 {
00018   TextWin *w;
00019   PushButton *b;
00020 
00021   b = new PushButton (" Ok ", BLACK, 0x01);
00022 
00023   w = new TextWin (b->GetXDim() + (Margin*2), b->GetYDim() + (Margin*2),
00024       bc, bkc, t, tc, txt, txtc);
00025   int wx = (theDisplay.GetMaxX() - w->GetXDim()) / 2;
00026   int wy = (theDisplay.GetMaxY() - w->GetYDim()) / 2;
00027   w->Init (&theDisplay, wx, wy);
00028 
00029   int bx = (w->Client().GetMaxX() - b->GetXDim()) / 2;
00030   int by = (w->Client().GetMaxY() - b->GetYDim()) - Margin;
00031   w->Client().Add (b, bx, by);
00032 
00033   w->Draw ();
00034 
00035   Mouse.Flush ();
00036   Message m;
00037   do {
00038     m = w->Client().Dispatch (Mouse.Event ());
00039   } while (m.code != ButtonPress);
00040 
00041   delete w;
00042   return m;
00043 }


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