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
87 lines
1.8 KiB
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ====
|
|
//
|
|
// Purpose:
|
|
//
|
|
//=============================================================================
|
|
|
|
#ifndef MESSAGEWND_H
|
|
#define MESSAGEWND_H
|
|
#pragma once
|
|
|
|
#include <afxtempl.h>
|
|
#include "GlobalFunctions.h"
|
|
|
|
const int MAX_MESSAGE_WND_LINES = 5000;
|
|
|
|
enum
|
|
{
|
|
MESSAGE_WND_MESSAGE_LENGTH = 150
|
|
};
|
|
|
|
|
|
class CMessageWnd : private CMDIChildWnd
|
|
{
|
|
public:
|
|
|
|
static CMessageWnd *CreateMessageWndObject();
|
|
void CreateMessageWindow( CMDIFrameWnd *pwndParent, CRect &rect );
|
|
|
|
void ShowMessageWindow();
|
|
void ToggleMessageWindow();
|
|
bool IsVisible();
|
|
|
|
void Activate();
|
|
|
|
void Resize( CRect &rect );
|
|
|
|
DECLARE_DYNCREATE(CMessageWnd)
|
|
|
|
protected:
|
|
CMessageWnd(); // protected constructor used by dynamic creation
|
|
|
|
struct MWMSGSTRUCT
|
|
{
|
|
MWMSGTYPE type;
|
|
TCHAR szMsg[MESSAGE_WND_MESSAGE_LENGTH];
|
|
int MsgLen; // length of message w/o 0x0
|
|
} ;
|
|
|
|
// Attributes
|
|
public:
|
|
void AddMsg(MWMSGTYPE type, TCHAR* msg);
|
|
|
|
// Operations
|
|
public:
|
|
|
|
// Overrides
|
|
// ClassWizard generated virtual function overrides
|
|
//{{AFX_VIRTUAL(CMessageWnd)
|
|
//}}AFX_VIRTUAL
|
|
|
|
// Implementation
|
|
protected:
|
|
virtual ~CMessageWnd();
|
|
|
|
void CalculateScrollSize();
|
|
CArray<MWMSGSTRUCT, MWMSGSTRUCT&> MsgArray;
|
|
|
|
CFont Font;
|
|
int iCharWidth; // calculated in first paint
|
|
int iNumMsgs;
|
|
bool bDestroyed;
|
|
|
|
// Generated message map functions
|
|
//{{AFX_MSG(CMessageWnd)
|
|
afx_msg void OnPaint();
|
|
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
|
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
|
afx_msg void OnSize(UINT nType, int cx, int cy);
|
|
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
|
afx_msg void OnClose();
|
|
afx_msg void OnDestroy();
|
|
//}}AFX_MSG
|
|
DECLARE_MESSAGE_MAP()
|
|
};
|
|
|
|
|
|
#endif // MESSAGEWND_H
|