home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 3.ddi / CHESS.ZIP / INFO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  2.6 KB  |  133 lines

  1. // ObjectWindows - (C) Copyright 1992 by Borland International
  2.  
  3. #ifndef _INFO_H
  4. #define _INFO_H
  5.  
  6. #ifndef __STATIC_H
  7. #include <static.h>
  8. #endif
  9.  
  10. #ifndef __FILEDIAL_H
  11. #include <filedial.h>
  12. #endif
  13.  
  14. #ifndef __INPUTDIA_H
  15. #include <inputdia.h>
  16. #endif
  17.  
  18. #ifndef __STRING_H
  19. #include <string.h>
  20. #endif
  21.  
  22. _CLASSDEF(TNoEraseBkGndStatic)
  23.  
  24. class TNoEraseBkGndStatic : public TStatic
  25. {
  26.       BOOL DoErase;
  27.       int LastLen;
  28.    public:
  29.       TNoEraseBkGndStatic(PTWindowsObject AParent, int AnId, LPSTR ATitle, int X,
  30.          int Y, int W, int H, WORD ATextLen, PTModule AModule = NULL)
  31.          : TStatic(AParent, AnId, ATitle, X, Y, W, H, ATextLen)
  32.       {
  33.          DoErase = TRUE;
  34.          LastLen = 0;
  35.       }
  36.       virtual void WMEraseBkGnd(RTMessage msg) = [WM_FIRST + WM_ERASEBKGND];
  37.       void SetErase() {
  38.          DoErase = TRUE;
  39.          }
  40.       void SetText(LPSTR text)
  41.          {
  42.          int Len = strlen(text);
  43.          if (Len < LastLen)
  44.             SetErase();
  45.          TStatic::SetText(text);
  46.          LastLen = Len;
  47.          }
  48. };
  49.  
  50. _CLASSDEF(TInfoWindow)
  51. class TInfoWindow: public TWindow
  52. {
  53.     PTStatic Color;
  54.     PTStatic WhiteInfo;
  55.     PTStatic BlackInfo;
  56.    PTNoEraseBkGndStatic Timer;
  57.     PTStatic Level;
  58.     PTStatic Iteration;
  59.     PTStatic Value;
  60.     PTStatic Nodes;
  61.     PTStatic Seconds;
  62.    PTNoEraseBkGndStatic Depth;
  63.     PTStatic BestLine;
  64.     PTStatic Message;
  65.    RECT InfoRect;
  66.    void DrawSFrame(HDC, RECT *);
  67.    void DrawStaticFrames(HDC);
  68.   public:
  69.    TInfoWindow(PTWindowsObject AParent, LPSTR ATitle);
  70.     void SetTurnText(LPSTR text)
  71.         {
  72.       Color->SetText(text);
  73.         }
  74.     void SetWhiteInfoText(LPSTR text)
  75.         {
  76.         WhiteInfo->SetText(text);
  77.         }
  78.     void SetBlackInfoText(LPSTR text)
  79.         {
  80.         BlackInfo->SetText(text);
  81.         }
  82.     void SetTimerText(LPSTR text)
  83.       {
  84.       Timer->SetText(text);
  85.       }
  86.     void SetLevelText(LPSTR text)
  87.         {
  88.         Level->SetText(text);
  89.         }
  90.     void SetIterationText(LPSTR text)
  91.         {
  92.         Iteration->SetText(text);
  93.         }
  94.     void SetValueText(LPSTR text)
  95.         {
  96.         Value->SetText(text);
  97.         }
  98.     void SetNodeText(LPSTR text)
  99.         {
  100.         Nodes->SetText(text);
  101.         }
  102.     void SetSecondsText(LPSTR text)
  103.         {
  104.         Seconds->SetText(text);
  105.         }
  106.    void SetDepthText(LPSTR text)
  107.       {
  108.       Depth->SetText(text);
  109.       }
  110.     void SetBestLineText(LPSTR text)
  111.         {
  112.         BestLine->SetText(text);
  113.         }
  114.     void SetMessageText(LPSTR text)
  115.         {
  116.         Message->SetText(text);
  117.         }
  118.    virtual void Paint( HDC PaintDC, PAINTSTRUCT& PaintInfo );
  119.     void DrawInfoFrame(HDC);
  120.    virtual void WMControlColor(TMessage& Msg) 
  121.                                 = [WM_FIRST + WM_CTLCOLOR];
  122.    void Reset();
  123.    void IterReset();
  124. };
  125.  
  126.     
  127.  
  128.  
  129.  
  130.  
  131. #endif // _INFO_H
  132. 
  133.