📄 chathistory.h
字号:
//////////////////////////////////////////////////////////////////////
// FileFury
// Copyright (c) 2000 Tenebril Incorporated
// All rights reserved.
//
// This source code is governed by the Tenebril open source
// license (http://www.tenebril.com/developers/opensource/license.html)
//
// For more information on this and other open source applications,
// visit the Tenebril OpenSource page:
// http://www.tenebril.com/developers/opensource
//
//////////////////////////////////////////////////////////////////////
#ifndef CCHATHISTORY_DEFINE
#define CCHATHISTORY_DEFINE
class CHistoryColors
{
public:
CHistoryColors();
~CHistoryColors();
BOOL Dereference();
BOOL Reference();
COLORREF Background;
COLORREF Text;
CDC *Border;
private:
int m_nRefCount;
};
class CHistoryStatement
{
public:
CHistoryStatement * Next();
CHistoryStatement();
~CHistoryStatement();
CString m_cszMessage;
CString m_cszSpeaker;
CString m_cszIP;
int m_nTime, m_nWidth, m_nHeight;
void *m_pNext;
CHistoryColors *m_pColors;
};
class CChatHistory : public CWnd
{
public:
void SetDefaultFont();
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
CHistoryStatement * HitTest(POINT pt);
BOOL AddStatement(LPCTSTR czMessage, LPCTSTR czSpeaker, LPCTSTR czIP, COLORREF crBack, COLORREF crText);
CChatHistory();
~CChatHistory();
BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
void SetFont(CFont* pFont, BOOL Redraw = TRUE);
BOOL SetWindowPos(const CWnd* WndInsertAfter,
int x, int y, int cx, int cy,
UINT Flags);
void InvalidateRect(LPCRECT Rect, BOOL Erase = TRUE);
void SetFont(LOGFONT Logfont);
void MoveWindow( int x, int y, int nWidth, int nHeight, BOOL bRepaint = TRUE );
protected:
afx_msg void OnDrawItem(int IDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
afx_msg void OnMeasureItem(int IDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
afx_msg int OnCompareItem(int IDCtl, LPCOMPAREITEMSTRUCT lpCompareItemStruct);
afx_msg void OnDeleteItem(int IDCtl, LPDELETEITEMSTRUCT lpDeleteItemStruct);
afx_msg void OnPaint();
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnVScroll(UINT SBCode, UINT Pos, CScrollBar* ScrollBar);
afx_msg UINT OnNcHitTest(CPoint point);
private:
BOOL m_bCreated;
WORD m_wParseStyle;
CFont *ControlFont;
bool MySizing;
CHistoryStatement *StHead;
int TimeOffset, ScrollPos, EntryHeight, DrawingWidth;
CScrollBar ScrollBar;
CFont *HistoryFont;
void ComputeMessageHeight(CHistoryStatement *State, int width);
int LastEntryTime(LPCTSTR czSpeaker);
void CreateMemBorders(CDC *DC, CHistoryColors *pColors);
void AddStatement(LPCTSTR czMessage, LPCTSTR czSpeaker, LPCTSTR czIP,
CHistoryColors *pColor);
CHistoryColors *FindColors(COLORREF crBack, COLORREF crText);
CHistoryColors *CompileColors(COLORREF back, COLORREF text);
void CalculateEntryHeight();
int MinBoxWidth(char *message);
void Render(CDC *DC);
void RenderStatement(CDC *DC, CRect DrawRect, CHistoryStatement *CurStatement);
void DrawBmpBorder(CDC *DC, CRect Rect, CHistoryStatement *CurStatement);
bool ConvertBitmapColors(CDC *Bitmap, CRect PaintingRect, COLORREF DestinationBasis);
DECLARE_MESSAGE_MAP()
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -