void CBScrollBar::OnDraw(const CEspRect& rect)
{
	IAwsGc* pGc = GetGc();

	if ( ESP_NULL != pGc )
	{
		// »­±³¾°
		DrawBK(pGc, rect);

		// »­¿é
		CEspRect rt;
		if ( ESB_Vertical == m_eDir )
		{
			rt.m_ptLT.m_nX = 0;
			rt.m_ptLT.m_nY = (int)(m_nCurPos * m_fCurScrolldis);
			rt.m_ptRB.m_nX = GetSize()->m_nWidth;
			rt.m_ptRB.m_nY = rt.m_ptLT.m_nY + m_nCurBlockDim;
		}
		else if ( ESB_Horizontal == m_eDir )
		{
			rt.m_ptLT.m_nX = (int)(m_nCurPos * m_fCurScrolldis);
			rt.m_ptLT.m_nY = 0;
			rt.m_ptRB.m_nX = rt.m_ptLT.m_nX + m_nCurBlockDim;
			rt.m_ptRB.m_nY = GetSize()->m_nHeight;
		}

		DrawBlock(pGc, rt);
	}
}
void CBEdit::OnDraw(const CEspRect& rect)
{
	IAwsGc* pGc = GetGc();
	CEspSize size = *GetSize();
	CEspRect rt, rtTemp;

	// Óñ³¾°Ìî³äÇøÓò
	DrawBK(pGc, rect);

	// »æÖƱ߿ò
	if ( 0 == rect.m_ptLT.m_nX || 0 == rect.m_ptLT.m_nY || size.m_nWidth == rect.m_ptRB.m_nX || size.m_nHeight == rect.m_ptRB.m_nY )
	{
		if ( m_bIsFocus )
		{
			pGc->SetPenColor(m_oFocusBorderColor);
		}
		else
		{
			pGc->SetPenColor(m_oBorderColor);
		}
		CEspRect rtTemp(0, 0, size.m_nWidth, size.m_nHeight);
		pGc->DrawRect(rtTemp);
	}

	// »æÖÆÎÄ×Ö
//	rt = rect;
	rt.m_ptLT.m_nX = 3;
	rt.m_ptLT.m_nY = 3;
	rt.m_ptRB.m_nX = size.m_nWidth - 2;
	rt.m_ptRB.m_nY = size.m_nHeight - 2;
	pGc->SetTextColor(m_oTextColor);
	pGc->SetTextAlignment(AWS_TAM_Left);
	m_oFont.CreateFont(0, m_nFontSize);
	pGc->UseFont(m_oFont);

//	CAwsString strSub;
	m_strDrawText.Reset();
	m_strText.GetSubString(m_strDrawText, m_nStartDrawCharIndex, -1);
	pGc->DrawText(m_strDrawText, rt);

	pGc->DiscardFont();

	// »æÖƲåÈë·û
	rt.m_ptLT = m_oCaretPos;
	rt.m_ptRB.m_nX = rt.m_ptLT.m_nX + m_oCaretSize.m_nWidth;
	rt.m_ptRB.m_nY = rt.m_ptLT.m_nY + m_oCaretSize.m_nHeight;
	if ( rect.InterRect(rt, rtTemp) )
	{
		if ( m_bCaretIsVisible )
		{
			pGc->SetPenColor(m_oCaretColor);
			pGc->SetBrushColor(m_oCaretColor);

			pGc->DrawFillRect(rt);
		}
	}
}
Exemple #3
0
void QMyCanvas::paintEvent(QPaintEvent* event)
{
    if( doDraw == 1 )
        DrawFSJL("000001K","20100310");
    else    if( doDraw == 2 )
        DrawFSJL("000002J","20100311");
    else    if( doDraw == 3 )
        DrawFSJL("000012J","20100311");
    else        if( doDraw == 4 )
        DrawFSJL("000001K","20100310");
    else            if( doDraw == 5 )
        DrawFSJL("000002J","20100311");
    else               if( doDraw == 6 )
        DrawFSJL("000012J","20100311");
    else                    if( doDraw == 7 )
        DrawBK();
        DrawLines();
        //drawShape();
            DrawBK();
}
void CMMsgBox::OnDraw(const CEspRect& rect)
{
	IAwsGc* pGc = GetGc();

	if ( ESP_NULL != pGc )
	{
		// »­±³¾°
		DrawBK(pGc, rect);

		// »­ÐÅÏ¢
		DrawInf(pGc, rect);
	}

	CAwsContainer::OnDraw(rect);
}
void CMMenuBar::OnDraw(const CEspRect& rect)
{
//	TRACE("menubar draw, X(%d),Y(%d), Width(%d), Height(%d)\n", rect.m_ptLT.m_nX, rect.m_ptLT.m_nY, rect.GetSize()->m_nWidth, rect.GetSize()->m_nHeight);

    // 画背景
    IAwsGc* pGc = GetGc();

    if ( ESP_NULL != pGc )
    {
        DrawBK(pGc, rect);

        // 调用父类的绘制函数
        CAwsContainer::OnDraw(rect);
    }
}