home *** CD-ROM | disk | FTP | other *** search
/ Instant Doom Levels / Instant.Doom.Levels.-.Level.Master.II.iso / EDITORS / ZIPPED / WSCDEU52.ZIP / INCLUDE / INFOCONT.H < prev    next >
C/C++ Source or Header  |  1995-03-05  |  3KB  |  106 lines

  1. /*----------------------------------------------------------------------------*
  2.  | This file is part of WinDEU, the port of DEU to Windows.                   |
  3.  | WinDEU was created by the DEU team:                                        |
  4.  |  Renaud Paquay, Raphael Quinet, Brendon Wyber and others...                |
  5.  |                                                                            |
  6.  | DEU is an open project: if you think that you can contribute, please join  |
  7.  | the DEU team.  You will be credited for any code (or ideas) included in    |
  8.  | the next version of the program.                                           |
  9.  |                                                                            |
  10.  | If you want to make any modifications and re-distribute them on your own,  |
  11.  | you must follow the conditions of the WinDEU license. Read the file        |
  12.  | LICENSE or README.TXT in the top directory.  If do not  have a copy of     |
  13.  | these files, you can request them from any member of the DEU team, or by   |
  14.  | mail: Raphael Quinet, Rue des Martyrs 9, B-4550 Nandrin (Belgium).         |
  15.  |                                                                            |
  16.  | This program comes with absolutely no warranty.  Use it at your own risks! |
  17.  *----------------------------------------------------------------------------*
  18.  
  19.     Project WinDEU
  20.     DEU team
  21.     Jul-Dec 1994, Jan-Mar 1995
  22.  
  23.     FILE:         infocont.h
  24.  
  25.     OVERVIEW
  26.     ========
  27.     Class definition for TInfoControl (TControl).
  28. */
  29. #if !defined(__infocont_h)              // Sentry, use file only if it's not already included.
  30. #define __infocont_h
  31.  
  32. #ifndef __common_h
  33.     #include "common.h"
  34. #endif
  35.  
  36. #ifndef __gfx_h
  37.     #include "gfx.h"    // Colors
  38. #endif
  39.  
  40. #ifndef __OWL_CONTROL_H
  41.     #include <owl\control.h>
  42. #endif
  43.  
  44.  
  45. #define DEF_COLOR    LIGHTBLUE
  46. #define DEF_ALIGN    TA_LEFT
  47.  
  48. //{{TControl = TInfoControl}}
  49. class TInfoControl : public TControl
  50. {
  51. public:
  52.     static TFont *StaticFont;
  53.     static int FontHeight;
  54.     static int NbObjects;
  55.  
  56. private:
  57.     UINT curAlign;
  58.     int curColor;
  59.     BOOL Inserting;            // Inserting text in control ?
  60.     unsigned NumLines;        // Maximum number of lines
  61.     unsigned LinePos;       // Next line number
  62.     struct TextLine
  63.     {
  64.         int Color;
  65.         UINT Align;
  66.         char *Text;
  67.     };
  68.     TextLine **TextLineTab;
  69.  
  70. public:
  71.     TInfoControl (TWindow* parent, int id, unsigned _NumLines, const char far* title,
  72.                   int x=100, int y=100, int w=200, int h=50,
  73.                   TModule* module = 0);
  74.     virtual ~TInfoControl();
  75.  
  76.     void SetStyle (UINT align = DEF_ALIGN, int color = DEF_COLOR)
  77.     {
  78.         curAlign = align;
  79.         curColor = color;
  80.     }
  81.     void BeginInsert();
  82.     void Insert( const char *text, ...);
  83.     void InsertAt (int linePos, const char *text, ...);
  84.     void Cleanup();
  85.     void EndInsert();
  86.  
  87. //{{TInfoControlVIRTUAL_BEGIN}}
  88. public:
  89.     virtual void SetupWindow();
  90.     virtual void Paint( TDC& dc, BOOL erase, TRect& rect);
  91.     virtual char far* GetClassName ();
  92.     virtual void GetWindowClass (WNDCLASS& wndClass);
  93. //{{TInfoControlVIRTUAL_END}}
  94.  
  95. //{{TInfoControlRSP_TBL_BEGIN}}
  96. protected:
  97.     UINT EvNCHitTest (TPoint& point);
  98.     BOOL EvSetCursor (HWND hWndCursor, UINT hitTest, UINT mouseMsg);
  99. //{{TInfoControlRSP_TBL_END}}
  100. DECLARE_RESPONSE_TABLE(TInfoControl);
  101. };    //{{TInfoControl}}
  102.  
  103.  
  104. #endif                                      // __infocont_h sentry.
  105.  
  106.