mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-16 21:53:01 +00:00
1
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
//========= Copyright 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;
|
||||
|
||||
// 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
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
|
||||
#endif // MESSAGEWND_H
|
||||
Reference in New Issue
Block a user