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

CPanelWindow Class Reference

#include <cpanel.h>

Inheritance diagram for CPanelWindow:

Window ScrnObj List of all members.

Public Methods

 CPanelWindow ()
void Init (Display *d, int x, int y)
Message Dispatch (Message &m)

Constructor & Destructor Documentation

CPanelWindow::CPanelWindow  
 

Definition at line 24 of file cpanel.c.

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

00025 {
00026   XDim = CPanelXDim; YDim = CPanelYDim;
00027   CliX1 = CliY1 = CliX2 = CliY2 = 0;
00028   TX1 = TY1 = TX2 = TY2 = 0;
00029   BorderColor = RED;
00030   BkColor = LIGHTGRAY;
00031   TitleColor = WHITE;
00032   Title = new char[20];
00033   strcpy (Title, "Control Panel");
00034   ClientD = TitleD = NULL;
00035   Drawn = False;
00036 }


Member Function Documentation

Message CPanelWindow::Dispatch Message   m [virtual]
 

Reimplemented from Window.

Definition at line 74 of file cpanel.c.

References Window::ClientD, and Display::Dispatch().

00075 {
00076   if (ClientD)
00077     return ClientD->Dispatch (msg); // Dispatch messages to client area
00078   else
00079     return NullMsg;
00080 }

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

Reimplemented from Window.

Definition at line 38 of file cpanel.c.

References Window::BkColor, Window::BorderColor, Window::CalcBorder(), Window::CalcTitle(), Window::ClientD, Window::CliX1, Window::CliX2, Window::CliY1, Window::CliY2, ScrnObj::Disp, Viewport::GetMaxX(), PushButton::GetXDim(), Window::GetXDim(), PushButton::GetYDim(), Window::GetYDim(), ID_LEGAL, ID_QUIT, ID_REFRESH, ID_SPY, Num_Buttons_In_CPanel, 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.

00039 {
00040   Disp = d;
00041   X = x;  Y = y;
00042 
00043   CalcBorder ();
00044   if (Title)
00045   {
00046     CalcTitle ();
00047     TitleD = new Display (Disp, TX1, TY1, TX2, TY2);
00048     assert (TitleD != 0);
00049     TitleD->SetBkColor (BorderColor);
00050     TitleD->SetTextJustify (CENTER_TEXT, TOP_TEXT);
00051     TitleD->SetTextStyle (TitleFont, HORIZ_DIR, TitleFontSize);
00052     TitleD->SetColor (TitleColor);
00053   }
00054   ClientD = new Display (Disp, CliX1, CliY1, CliX2, CliY2);
00055   assert (ClientD != 0);
00056   ClientD->SetBkColor (BkColor);
00057 
00058   PushButton *pb[Num_Buttons_In_CPanel];
00059   pb[3] = new PushButton ("Legal Stops", BLUE, ID_LEGAL);
00060   pb[1] = new PushButton ("Refresh", BLUE, ID_REFRESH, pb[3]->GetXDim(), pb[3]->GetYDim());
00061   pb[2] = new PushButton ("Quit", BLUE, ID_QUIT);
00062   pb[0] = new PushButton ("Spy", BLUE, ID_SPY, pb[2]->GetXDim(), pb[2]->GetYDim());
00063   for (int i=0; i < Num_Buttons_In_CPanel; i++)
00064      assert (pb[i] != NULL);
00065 
00066   ClientD -> Add(pb[0],25, 2);
00067   ClientD -> Add(pb[1],25, pb[0]->GetYDim()+5);
00068   ClientD -> Add(pb[3],ClientD->GetMaxX()-pb[3]->GetXDim()-25, 2);
00069   ClientD -> Add(pb[2],ClientD->GetMaxX()-pb[2]->GetXDim()-25
00070     ,pb[0]->GetYDim()+5);
00071 }


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