home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectInput / DIConfig / flexinfobox.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-08  |  1.7 KB  |  57 lines

  1. //-----------------------------------------------------------------------------
  2. // File: flexinfobox.h
  3. //
  4. // Desc: Implements a simple text box that displays a text string.
  5. //       CFlexInfoBox is derived from CFlexWnd.  It is used by the page
  6. //       for displaying direction throughout the UI.  The strings are
  7. //       stored as resources.  The class has a static buffer which will
  8. //       be filled with the string by the resource API when needed.
  9. //
  10. // Copyright (C) 1999-2001 Microsoft Corporation. All Rights Reserved.
  11. //-----------------------------------------------------------------------------
  12.  
  13. #ifndef __FLEXINFOBOX_H__
  14. #define __FLEXINFOBOX_H__
  15.  
  16. class CFlexInfoBox : public CFlexWnd
  17. {
  18.     TCHAR m_tszText[MAX_PATH];  // Text string of the message
  19.     int m_iCurIndex;  // Current text index
  20.     COLORREF m_rgbText, m_rgbBk, m_rgbSelText, m_rgbSelBk, m_rgbFill, m_rgbLine;
  21.     HFONT m_hFont;
  22.     RECT m_TextRect;
  23.     RECT m_TextWinRect;
  24.     int m_nSBWidth;
  25.  
  26.     CFlexScrollBar m_VertSB;
  27.     BOOL m_bVertSB;
  28.  
  29.     void SetVertSB(BOOL bSet);
  30.     void SetVertSB();
  31.     void SetSBValues();
  32.  
  33.     void SetRect();
  34.     void InternalPaint(HDC hDC);
  35.  
  36.     RECT GetRect(const RECT &);
  37.     RECT GetRect();
  38.  
  39. protected:
  40.     virtual LRESULT WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
  41.     virtual void OnPaint(HDC hDC);
  42.     virtual void OnWheel(POINT point, WPARAM wParam);
  43.  
  44. public:
  45.     CFlexInfoBox();
  46.     virtual ~CFlexInfoBox();
  47.  
  48.     BOOL Create(HWND hParent, const RECT &rect, BOOL bVisible);
  49.     void SetText(int iIndex);
  50.  
  51.     // cosmetics
  52.     void SetFont(HFONT hFont);
  53.     void SetColors(COLORREF text, COLORREF bk, COLORREF seltext, COLORREF selbk, COLORREF fill, COLORREF line);
  54. };
  55.  
  56. #endif
  57.