CMessageList.h
上传用户:garry_shen
上传日期:2015-04-15
资源大小:45647k
文件大小:1k
源码类别:

游戏引擎

开发平台:

Visual C++

  1. #ifndef __MESSAGELIST
  2. #define __MESSAGELIST
  3. #include <windows.h>
  4. #include <ddraw.h>
  5. struct Segment
  6. {
  7. COLORREF color;
  8. LPTSTR lpstr;
  9. Segment *next;
  10. };
  11. struct RowList
  12. {
  13. Segment *segHead;
  14. RowList *next;
  15. };
  16. class CMessageList
  17. {
  18. private:
  19. HWND hwnd;
  20. RECT rcListPos;
  21. int nBytesOfLine;
  22. int iLineHeight;
  23. int iTotal;
  24. int iMaxLine;
  25. RowList *rowlistHead;
  26. RowList *rowlistTail;
  27. Segment *segTail;
  28. HFONT font;
  29. COLORREF color;
  30. protected:
  31. public:
  32. CMessageList():rowlistHead(NULL),rowlistTail(NULL),segTail(NULL){}
  33. ~CMessageList(){}
  34. void Initiate(HWND hwndParent,int iLineSpace,int iMaxListLine,LPRECT lprcRange,int iFontSize,LPTSTR lpstrFontName,int iFontWeight);
  35. void Release();
  36. void Clear();
  37. int AddMessageList(LPTSTR lpstr);
  38. int AddRow(LPTSTR lpstr,int iStrLen,COLORREF color);
  39. int ShowMessageList(IDirectDrawSurface *pddsBack);
  40. int AddSegment(LPTSTR lpstr,int iStrLen,COLORREF color);
  41. };
  42. #endif