statusbarex.cpp

来自「一个很好的LFP规约调试器」· C++ 代码 · 共 62 行

CPP
62
字号
// StatusBarEx.cpp: implementation of the CStatusBarEx class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "StatusBarEx.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CStatusBarEx::CStatusBarEx()
{

}

CStatusBarEx::~CStatusBarEx()
{

}

BEGIN_MESSAGE_MAP(CStatusBarEx, CStatusBar)
	//{{AFX_MSG_MAP(CMyStatusBar)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CStatusBarEx::OnPaint() 
{
	Default();
	CClientDC cDC( this );
	CPen pen( PS_SOLID, 1, ::GetSysColor( COLOR_3DSHADOW ) );
	HPEN oldPen = (HPEN)cDC.SelectObject( pen );
	CRect rcItem;
	cDC.SelectObject( ::GetStockObject( NULL_BRUSH ) );
	for( int i = 0; i < m_nCount; i++ ) {
		GetItemRect(i, rcItem );
		cDC.Rectangle( rcItem );
	}
	cDC.SelectObject( oldPen );
}

BOOL CStatusBarEx::SetIndicators(const UINT* lpIDArray, int nIDCount)
{
	if( !CStatusBar::SetIndicators( lpIDArray, nIDCount ) ) {
		return false;
	}
	SendMessage( SB_SETMINHEIGHT, 20 );
	for( int i = 0; i < nIDCount; i++ ) {
		UINT a, b;
		int c;
		GetPaneInfo( i, a, b, c );
		SetPaneInfo( i, a, b | SBPS_NOBORDERS, c );
	}
	return true;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?