Exemple #1
0
void CmusikTrackCtrl::DrawVerticalThumb( CDC* pDC, const CRect& rect )
{
	CMemDC pMemDC( pDC, &rect );

	pMemDC.FillSolidRect( rect, m_Prefs->MUSIK_COLOR_BTNFACE );
	pMemDC.Draw3dRect( rect, m_Prefs->MUSIK_COLOR_BTNSHADOW, m_Prefs->MUSIK_COLOR_BTNSHADOW );
}
void CColorProgressCtrl::OnPaint()
{
    CPaintDC dc(this); // device context for painting
    // TODO: Add your message handler code here
    // Do not call CProgressCtrl::OnPaint() for painting messages
    CMemDCPointer pMemDC(&dc);

    CRect rectClient;
    CRect rectBar;
    GetClientRect(rectClient);
    rectBar = rectClient;
    float right = (float)m_nCurrentPosition / (float)(m_nUpper) * (float)rectClient.right;
    rectBar.right = right ;
    DrawBar(pMemDC,rectClient,rectBar);

}
Exemple #3
0
void CmusikTrackCtrl::DrawChannel( CDC* pDC, const CRect& rect, BOOL bHoriz )
{
	CRect rcChannel = rect;

	if ( bHoriz )
	{
		rcChannel.top += 1;
		rcChannel.bottom += 1;
		rcChannel.InflateRect( 0, 1, 0, 1 );
	}
	else
	{
		rcChannel.left += 1;
		rcChannel.right += 1;
		rcChannel.InflateRect( 1, 0, 1, 0 );
	}

	CMemDC pMemDC( pDC, &rcChannel );

	pMemDC.FillSolidRect( rcChannel, m_Prefs->MUSIK_COLOR_BTNHILIGHT );
	pMemDC.Draw3dRect( rcChannel, m_Prefs->MUSIK_COLOR_BTNSHADOW, m_Prefs->MUSIK_COLOR_BTNHILIGHT );

	int nMax = GetRangeMax();
	int nPos = GetPos();
	float fPercent = (float)GetPos() / (float)GetRangeMax();

	if ( bHoriz )
	{
		float fWidth = ( (float)rcChannel.Width() * fPercent ) + 1;
		pMemDC->FillSolidRect( CRect( rcChannel.left + 1, rcChannel.top + 1, rcChannel.left + (int)fWidth, rcChannel.bottom - 1 ), m_Prefs->MUSIK_COLOR_ACTIVECAPTION );
	}
	else
	{
		float fHeight = ( (float)rcChannel.Height() * fPercent ) + 1;
		pMemDC->FillSolidRect( CRect( rcChannel.left + 1, rcChannel.top + (int)fHeight, rcChannel.right - 1, rcChannel.bottom - 1 ), m_Prefs->MUSIK_COLOR_ACTIVECAPTION );
	}

	Invalidate( false );
}