CMessageList.h
上传用户:garry_shen
上传日期:2015-04-15
资源大小:45647k
文件大小:1k
- #ifndef __MESSAGELIST
- #define __MESSAGELIST
- #include <windows.h>
- #include <ddraw.h>
- struct Segment
- {
- COLORREF color;
- LPTSTR lpstr;
- Segment *next;
- };
- struct RowList
- {
- Segment *segHead;
- RowList *next;
- };
- class CMessageList
- {
- private:
- HWND hwnd;
- RECT rcListPos;
- int nBytesOfLine;
- int iLineHeight;
- int iTotal;
- int iMaxLine;
- RowList *rowlistHead;
- RowList *rowlistTail;
- Segment *segTail;
- HFONT font;
- COLORREF color;
- protected:
- public:
- CMessageList():rowlistHead(NULL),rowlistTail(NULL),segTail(NULL){}
- ~CMessageList(){}
- void Initiate(HWND hwndParent,int iLineSpace,int iMaxListLine,LPRECT lprcRange,int iFontSize,LPTSTR lpstrFontName,int iFontWeight);
- void Release();
- void Clear();
- int AddMessageList(LPTSTR lpstr);
- int AddRow(LPTSTR lpstr,int iStrLen,COLORREF color);
- int ShowMessageList(IDirectDrawSurface *pddsBack);
- int AddSegment(LPTSTR lpstr,int iStrLen,COLORREF color);
- };
- #endif