Пример #1
0
void CRemoteWnd::OnPaint()
{
	CPaintDC dc( this );
	CRect rcClient;

	GetClientRect( &rcClient );

	if ( m_pSkin == NULL )
	{
		dc.FillSolidRect( &rcClient, Colors.m_crSysBtnFace );
		return;
	}

	CSize size = rcClient.Size();
	CDC* pDC = CoolInterface.GetBuffer( dc, size );
	m_pSkin->Prepare( &dc );

	pDC->BitBlt( 0, 0, m_rcBackground.Width(), m_rcBackground.Height(),
		&m_pSkin->m_dcSkin, m_rcBackground.left, m_rcBackground.top, SRCCOPY );

	CFont* pfOld = NULL;

	if ( m_pSkin->m_fnCaption.m_hObject != NULL )
	{
		pfOld = (CFont*)pDC->SelectObject( &m_pSkin->m_fnCaption );
		pDC->SetTextColor( m_pSkin->m_crCaptionText );
	}
	else
	{
		pfOld = (CFont*)pDC->SelectObject( &CoolInterface.m_fntNormal );
		pDC->SetTextColor( RGB( 255, 255, 255 ) );
	}

	pDC->SetBkMode( TRANSPARENT );
	m_bStatus = FALSE;

	PaintHistory( pDC, m_pMonitor->m_pTxItem, m_pMonitor->m_pRxItem, m_pMonitor->m_nMaximumIn );
	PaintFlow( pDC, &m_bsFlowTxDest, &m_rcsFlowTxDest, m_bsFlowTxSrc, m_rcsFlowTxSrc, m_pMonitor->m_pTxItem, m_pMonitor->m_nMaximumOut );
	PaintFlow( pDC, &m_bsFlowRxDest, &m_rcsFlowRxDest, m_bsFlowRxSrc, m_rcsFlowRxSrc, m_pMonitor->m_pRxItem, m_pMonitor->m_nMaximumIn );
	PaintScaler( pDC );
	PaintMedia( pDC );
	PaintStatus( pDC );

	for ( POSITION pos = m_pButtons.GetHeadPosition(); pos; )
	{
		m_pButtons.GetNext( pos )->Paint( pDC, rcClient, m_pSkin, m_pCmdHover, m_pCmdDown );
	}

	pDC->SelectObject( pfOld );
	pDC->SelectClipRgn( NULL );
	dc.BitBlt( 0, 0, rcClient.Width(), rcClient.Height(), pDC, 0, 0, SRCCOPY );
}
Пример #2
0
void CMonitorBarCtrl::DoPaint(CDC* pDC)
{
	CRect rcClient;
	GetClientRect( &rcClient );

	CSize size = rcClient.Size();
	CDC* pMemDC = CoolInterface.GetBuffer( *pDC, size );
	if ( Settings.General.LanguageRTL )
		SetLayout( pMemDC->m_hDC, 0 );

	if ( ! CoolInterface.DrawWatermark( pMemDC, &rcClient, &m_bmWatermark ) )
		pMemDC->FillSolidRect( &rcClient, CoolInterface.m_crMidtone );

	if ( Skin.m_bBordersEnabled )
		DrawBorders( pMemDC, rcClient );
	else
		rcClient.DeflateRect( 2, 3, 2, 1 );

	for ( int nY = rcClient.top + 4 ; nY < rcClient.bottom - 4 ; nY += 2 )
	{
		pMemDC->Draw3dRect( rcClient.left + 3, nY, 4, 1,
			CoolInterface.m_crDisabled, CoolInterface.m_crDisabled );
	}

	DrawIconEx( pMemDC->GetSafeHdc(), rcClient.right - 16, rcClient.bottom - 16, m_hUpDown, 16, 16, 0, NULL, DI_NORMAL );

	m_pTxItem->SetHistory( rcClient.Width(), TRUE );
	m_pRxItem->SetHistory( rcClient.Width(), TRUE );

	CRect rcHistory( rcClient.left + 10, rcClient.top + 2, rcClient.right - 15, rcClient.bottom - 6 );
	PaintHistory( pMemDC, &rcHistory );

	CRect rcCurrent( rcClient.right - 7, rcClient.top + 2, rcClient.right - 2, rcClient.bottom - 6 );
	PaintCurrent( pMemDC, &rcCurrent, m_pRxItem );
	rcCurrent.OffsetRect( -6, 0 );
	PaintCurrent( pMemDC, &rcCurrent, m_pTxItem );

	m_rcTrack.SetRect( rcClient.left + 6, rcClient.bottom - 8, rcClient.right, rcClient.bottom - 2 );
	PaintTab( pMemDC );

	GetClientRect( &rcClient );
	pDC->BitBlt( rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(),
		pMemDC, 0, 0, SRCCOPY );
	if ( Settings.General.LanguageRTL )
		SetLayout( pMemDC->m_hDC, LAYOUT_RTL );
}