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

InfoWindow Class Reference

#include <infowin.h>

Inheritance diagram for InfoWindow:

Window ScrnObj List of all members.

Public Methods

 InfoWindow ()
void Init (Display *d, int x, int y)
void Draw ()
Message Dispatch (Message &)

Constructor & Destructor Documentation

InfoWindow::InfoWindow  
 

Definition at line 24 of file infowin.c.

References Window::BkColor, Window::BorderColor, Window::ClientD, Window::CliX1, Window::CliX2, Window::CliY1, Window::CliY2, ScrnObj::Drawn, False, InfoXDim, InfoYDim, Window::Title, Window::TitleColor, Window::TitleD, Window::TX1, Window::TX2, Window::TY1, Window::TY2, Window::XDim, and Window::YDim.

00025 {
00026   XDim = InfoXDim;  YDim = InfoYDim;
00027   CliX1 = CliY1 = CliX2 = CliY2 = 0;
00028   TX1 = TY1 = TX2 = TY2 = 0;
00029   BorderColor = RED;
00030   BkColor = LIGHTGRAY;
00031   TitleColor = WHITE;
00032   Title = NULL;
00033 //  Title = new char [15];
00034 //  assert (Title != 0);
00035 //  strcpy (Title, "Mark's Mind");
00036   ClientD = TitleD = NULL;
00037   Drawn = False;
00038 }


Member Function Documentation

Message InfoWindow::Dispatch Message   [inline, virtual]
 

Reimplemented from Window.

Definition at line 22 of file infowin.h.

00022 { return NullMsg; }

void InfoWindow::Draw   [virtual]
 

Reimplemented from Window.

Definition at line 62 of file infowin.c.

References Viewport::Clear(), Window::ClientD, ScrnObj::Disp, Viewport::Done(), Display::Draw(), Window::DrawBorder(), ScrnObj::Drawn, Window::DrawTitle(), Viewport::FastDraw(), Viewport::GetMaxX(), Viewport::OutTextXY(), Window::PrepScreen(), Viewport::SetColor(), Viewport::SetTextStyle(), Viewport::TextWidth(), and True.

00063 {
00064   char buf[40];
00065 
00066   if (!Drawn)
00067   {
00068     assert (Disp != NULL);
00069     Disp->FastDraw ();
00070     PrepScreen ();
00071     DrawBorder ();
00072     if (TitleD)
00073       DrawTitle ();
00074     ClientD->Clear ();
00075     ClientD->Draw ();
00076     Disp->Done ();
00077     Drawn = True;
00078 
00079     // Add text to window
00080     ClientD->SetColor(BLACK);
00081     ClientD->SetTextStyle(GOTHIC_FONT, HORIZ_DIR, 1);
00082     strcpy(buf, "Scotland Yard");
00083   ClientD->OutTextXY(ClientD->GetMaxX()/2-ClientD->TextWidth(buf)/2,10, buf);
00084     ClientD->SetColor(RED);
00085     strcpy(buf, "London, 1869");
00086   ClientD->OutTextXY(ClientD->GetMaxX()/2-ClientD->TextWidth(buf)/2+4,33, buf);
00087 
00088   }
00089 }

void InfoWindow::Init Display   d,
int    x,
int    y
[virtual]
 

Reimplemented from Window.

Definition at line 40 of file infowin.c.

References Window::BkColor, Window::BorderColor, Window::CalcBorder(), Window::CalcTitle(), Window::ClientD, Window::CliX1, Window::CliX2, Window::CliY1, Window::CliY2, ScrnObj::Disp, Viewport::SetBkColor(), Viewport::SetColor(), Viewport::SetTextJustify(), Viewport::SetTextStyle(), Window::TitleColor, Window::TitleD, TitleFont, TitleFontSize, Window::TX1, Window::TX2, Window::TY1, Window::TY2, ScrnObj::X, and ScrnObj::Y.

00041 {
00042   Disp = d;
00043   X = x;  Y = y;
00044 
00045   CalcBorder ();
00046   if (Title)
00047   {
00048     CalcTitle ();
00049     TitleD = new Display (Disp, TX1, TY1, TX2, TY2);
00050     assert (TitleD != 0);
00051     TitleD->SetBkColor (BorderColor);
00052     TitleD->SetTextJustify (CENTER_TEXT, TOP_TEXT);
00053     TitleD->SetTextStyle (TitleFont, HORIZ_DIR, TitleFontSize);
00054     TitleD->SetColor (TitleColor);
00055   }
00056   ClientD = new Display (Disp, CliX1, CliY1, CliX2, CliY2);
00057   assert (ClientD != 0);
00058   ClientD->SetBkColor (BkColor);
00059 }


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