hi,
My English is not good, if the problem can not be Bunderstood please reply to me.
I ran into a problem.
I insert a picture into my richedit,than Scroll bars are displayed.
I move the scroll bar until Image the lower half of the display,
than i call the function "ITextHost::SetClientRect",i found that The scroll bar will automatically scroll to make sure the picture all visible.
if i do not call the function "ITextServices::TxDraw",Scroll bar does not automatically scroll.
Is there a way to disable the scrollbar rollback??
the function "ITextHost::SetClientRect"
void CTxtWinHost::SetClientRect(RECT *prc, BOOL fUpdateExtent)
{
LONG lTestExt = DYtoHimetricY(
(rcClient.bottom - rcClient.top) - 2 * HOST_BORDER, yPerInch);
if (fUpdateExtent
&& (sizelExtent.cy == lTestExt))
{
sizelExtent.cy = DXtoHimetricX((prc->bottom - prc->top) - 2 * HOST_BORDER,
xPerInch);
sizelExtent.cx = DYtoHimetricY((prc->right - prc->left) - 2 * HOST_BORDER,
yPerInch);
}
rcClient = *prc;
}
the function "ITextServices::TxDraw"
void CxRichEdit::OnPaint(GDIPlus& gp, const CxRect& rcPaint)
{
RECT rcTemp = { 0 };
if( !::IntersectRect(&rcTemp, &rcPaint, &m_rcItem) ) return;
if( m_pTwhost&&m_pTwhost->pserv )
{
RECT rc={0,0,0,0};
m_pTwhost->GetControlRect(&rc);
RECT rcNeedUpdate = rc;
if(pPaintCenter)
rcNeedUpdate = pPaintCenter->GetRectUpdate(rc);
if(::IsRectEmpty(&rcNeedUpdate))return;
RECT *prc = NULL;
LONG lViewId = TXTVIEW_ACTIVE;
{
prc = &rc;
}
m_pTwhost->GetTextServices()->TxDraw(
DVASPECT_CONTENT, 0, NULL, NULL, gp.m_hDC, NULL, (RECTL *) prc, NULL, (RECT*)&rcNeedUpdate, NULL, NULL, lViewId);
}
}