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

Display Class Reference

#include <display.h>

Inheritance diagram for Display:

Viewport List of all members.

Public Methods

 Display (void)
 Display (Viewport *parent, int x1, int y1, int x2, int y2)
 ~Display (void)
virtual void Add (ScrnObj *a, int x, int y)
virtual void Draw (void)
virtual void Erase (void)
virtual Message Dispatch (Message &)

Private Attributes

ScrnObjList list

Constructor & Destructor Documentation

Display::Display void    [inline]
 

Definition at line 20 of file display.h.

00020 { }

Display::Display Viewport   parent,
int    x1,
int    y1,
int    x2,
int    y2
[inline]
 

Definition at line 21 of file display.h.

00022     : Viewport (parent, x1, y1, x2, y2) { }

Display::~Display void    [inline]
 

Definition at line 23 of file display.h.

References Erase().

00023 { Erase (); }


Member Function Documentation

void Display::Add ScrnObj   a,
int    x,
int    y
[virtual]
 

Definition at line 13 of file display.c.

References ScrnObjList::Append(), ScrnObj::Init(), and list.

Referenced by UserInterface::AboutButton(), MapWindow::AllocNodes(), KeyWindow::Init(), UserInterface::Intro(), MessageWin(), UserInterface::ShowSpyMoves(), UserInterface::TransPop(), and UserInterface::UFWOOM().

00014 {
00015   list.Append (a);
00016   a->Init (this, x, y);
00017 }

Message Display::Dispatch Message   [virtual]
 

Definition at line 37 of file display.c.

References Message::d1, Message::d2, ScrnObj::Dispatch(), ScrnObjList::GetCurrent(), list, MouseMsg, ScrnObjList::Next(), Message::origin, ScrnObjList::Reset(), Viewport::TransX(), and Viewport::TransY().

Referenced by Window::Dispatch(), CPanelWindow::Dispatch(), UserInterface::Intro(), MessageWin(), UserInterface::ShowSpyMoves(), and UserInterface::UFWOOM().

00038 {
00039   if (! list.Reset ())        // if list is empty
00040     return NullMsg;         //   return
00041   else
00042   {
00043 
00044     Message m = msg;
00045     switch (msg.origin)
00046     {
00047       case MouseMsg:      // Do d1,d2 represent coordinates?
00048   m.d1 = TransX (msg.d1);   // Translate them.
00049   m.d2 = TransY (msg.d2);
00050 //  if (!InBounds (m.d1, m.d2))
00051 //    return NullMsg;
00052   break;
00053     }
00054 
00055     Message ret;
00056     do {
00057       ret = list.GetCurrent()->Dispatch (m);  // pass to next scrnobj
00058     } while ((ret == NullMsg) && list.Next ());
00059 
00060     return ret;
00061   }
00062 }

void Display::Draw void    [virtual]
 

Definition at line 20 of file display.c.

References ScrnObj::Draw(), ScrnObjList::GetCurrent(), list, ScrnObjList::Next(), and ScrnObjList::Reset().

Referenced by UserInterface::AboutButton(), Window::Draw(), TextWin::Draw(), PlayerWindow::Draw(), MapWindow::Draw(), KeyWindow::Draw(), InfoWindow::Draw(), UserInterface::Intro(), and UserInterface::UFWOOM().

00021 {
00022   if (list.Reset ())
00023     do {
00024       list.GetCurrent()->Draw ();
00025     } while (list.Next ());
00026 }

void Display::Erase void    [virtual]
 

Definition at line 28 of file display.c.

References ScrnObj::Erase(), ScrnObjList::GetCurrent(), list, ScrnObjList::Next(), and ScrnObjList::Reset().

Referenced by PlayerWindow::Clear(), Window::Erase(), PopUpWin::Erase(), and ~Display().

00029 {
00030   if (list.Reset ())
00031     do {
00032       list.GetCurrent()->Erase ();
00033     } while (list.Next ());
00034 }


Member Data Documentation

ScrnObjList Display::list [private]
 

Definition at line 18 of file display.h.

Referenced by Add(), Dispatch(), Draw(), and Erase().


The documentation for this class was generated from the following files:
Generated on Sun Jul 6 23:07:17 2003 for Scotland Yard by doxygen1.2.15