Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3026

[RESOLVED] Need help fixing faulty CScrollView zoom

$
0
0
I have been unable to solve this problem. An SDI CScrollView app displays a displaced view with double set of scroll bars when user zooms window. This can be corrected by iconizing, then restoring the app, but I cannot figure out how to fix the problem programatically. After many months of searching and experimenting, I turn to you for help.

You can view the problem interface here as it's too big to upload.

http://www.pliatech.com/backoffice/scrollviewprob.jpg

FWIW, zoom in code is:
Code:

void CLineGraphView::OnZoomIn()
{
        if (m_fXScale >= 30 && m_fYScale >= 30)
                return;

        m_ZoomDrag = ZOOMIN;
        CSize size = GetTotalSize();
        size.cx    = (int)(size.cx * m_fDelta);
        size.cy    = (int)(size.cy * m_fDelta);
        m_fXScale *= m_fDelta;
        m_fYScale *= m_fDelta;

        SetScrollSizes(m_nMapMode, size);
        Redraw();  CenterWindow();

}// OnZoomIn(CCmdUI *pCmdUI)

Manually resizing the window also corrects the aberration.

Viewing all articles
Browse latest Browse all 3026

Trending Articles