Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
1.8 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ====
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef MESSAGEWND_H
  7. #define MESSAGEWND_H
  8. #pragma once
  9. #include <afxtempl.h>
  10. #include "GlobalFunctions.h"
  11. const int MAX_MESSAGE_WND_LINES = 5000;
  12. enum
  13. {
  14. MESSAGE_WND_MESSAGE_LENGTH = 150
  15. };
  16. class CMessageWnd : private CMDIChildWnd
  17. {
  18. public:
  19. static CMessageWnd *CreateMessageWndObject();
  20. void CreateMessageWindow( CMDIFrameWnd *pwndParent, CRect &rect );
  21. void ShowMessageWindow();
  22. void ToggleMessageWindow();
  23. bool IsVisible();
  24. void Activate();
  25. void Resize( CRect &rect );
  26. DECLARE_DYNCREATE(CMessageWnd)
  27. protected:
  28. CMessageWnd(); // protected constructor used by dynamic creation
  29. struct MWMSGSTRUCT
  30. {
  31. MWMSGTYPE type;
  32. TCHAR szMsg[MESSAGE_WND_MESSAGE_LENGTH];
  33. int MsgLen; // length of message w/o 0x0
  34. } ;
  35. // Attributes
  36. public:
  37. void AddMsg(MWMSGTYPE type, TCHAR* msg);
  38. // Operations
  39. public:
  40. // Overrides
  41. // ClassWizard generated virtual function overrides
  42. //{{AFX_VIRTUAL(CMessageWnd)
  43. //}}AFX_VIRTUAL
  44. // Implementation
  45. protected:
  46. virtual ~CMessageWnd();
  47. void CalculateScrollSize();
  48. CArray<MWMSGSTRUCT, MWMSGSTRUCT&> MsgArray;
  49. CFont Font;
  50. int iCharWidth; // calculated in first paint
  51. int iNumMsgs;
  52. bool bDestroyed;
  53. // Generated message map functions
  54. //{{AFX_MSG(CMessageWnd)
  55. afx_msg void OnPaint();
  56. afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  57. afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  58. afx_msg void OnSize(UINT nType, int cx, int cy);
  59. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  60. afx_msg void OnClose();
  61. afx_msg void OnDestroy();
  62. //}}AFX_MSG
  63. DECLARE_MESSAGE_MAP()
  64. };
  65. #endif // MESSAGEWND_H