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

window.h

Go to the documentation of this file.
00001 /*************************************************************************
00002 *   FILE: window.h
00003 * AUTHOR: CAL
00004 * DATE: 25 April 1993
00005 * PURPOSE:
00006 *   A window is a rectangular screen object which has a border and
00007 *   may have a title bar.  The area contained inside the border and
00008 *   title bar is called the client area.  The client area of a window
00009 *   is, itself, a Display.  This means that you can draw on it
00010 *   and it can contain ScreenObjects, such as buttons and windows.
00011 **************************************************************************/
00012 
00013 #ifndef _WINDOW_H
00014 #define _WINDOW_H
00015 
00016 #include "display.h"
00017 
00018 
00019 /**********************************************************************
00020 * Constants
00021 ***********************************************************************/
00022 
00023 const int BorderWidth   = 2;
00024 const int TitleWidth  = 11;
00025 const int TitleFont   = SMALL_FONT;
00026 const int TitleFontSize = 4;
00027 
00028 
00029 /**********************************************************************
00030 * Window class
00031 ***********************************************************************/
00032 
00033 class Window : public ScrnObj
00034 {
00035 protected:
00036   int XDim, YDim;     // Dimensions of window
00037   int CliX1, CliY1, CliX2, CliY2; // Client area dimensions
00038   int BorderColor, BkColor;
00039   Display *ClientD;     // Client area of window
00040 
00041   int TitleColor;     // Title stuff
00042   int TX1, TY1, TX2, TY2;
00043   char* Title;
00044   Display *TitleD;
00045 
00046   Window ();
00047 public:
00048   Window (int dx, int dy, int bc, int bkc); // Normal window
00049   Window (int dx, int dy, int bc, int bkc, char* t, int tc);  // Title
00050   virtual ~Window ();
00051 
00052   int GetXDim (void) { return XDim; }
00053   int GetYDim (void) { return YDim; }
00054 
00055   Display& Client (void) { return (*ClientD); }
00056 
00057   void CalcBorder (void);
00058   void CalcTitle (void);
00059 
00060   virtual void PrepScreen (void) { }
00061   void DrawBorder (void);
00062   void DrawTitle (void);
00063 
00064   virtual void Init (Display *d, int x, int y);
00065   virtual void Draw ();
00066   virtual void Erase ();
00067 
00068   virtual Message Dispatch (Message& msg);
00069 };
00070 
00071 
00072 #endif

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