void CFPAnalysisView::SetFPScrollInfo() { CSize sizeTotal(currentimage.GetWidth() * m_nNum / m_nDen, currentimage.GetHeight() * m_nNum / m_nDen) ; CSize sizePage(sizeTotal.cx / 2, sizeTotal.cy / 2); CSize sizeLine(sizeTotal.cx / 50, sizeTotal.cy / 50); SetScrollSizes(MM_TEXT, sizeTotal, sizePage, sizeLine); }
/////////////////////////////////////////// ////初始化 void CChooseOperation::OnInitialUpdate(){ CScrollView::OnInitialUpdate(); //设置为无效 //GetDlgItem(IDC_ENCRYPT_INFO)->EnableWindow(FALSE); CMainFrame *pMain=(CMainFrame *)AfxGetMainWnd(); //设置初始化大小 CRect rc1; pMain->GetClientRect(&rc1); //CString S1; //S1.Format("w=%d::h=%d",rc1.Width(),rc1.Height()); //AfxMessageBox(S1); //CView* pView=(CView*)pMain->m_splitter.GetPane(0,1); CSize sizeTotal(0,0); // CSize sizePage(sizeTotal.cx , sizeTotal.cy); //当点击Scrollbar空白条时,视区移动得大小 CSize sizeLine(sizeTotal.cx , sizeTotal.cy); //点击SCrollbar的上下左右按钮 SetScrollSizes(MM_TEXT, sizeTotal, sizePage, sizeLine); }
void CJevView::UpdateScrollSizes() { TRACE( "Entering UpdateScrollSizes()\n" ); CJevDoc* pDoc = GetDocument(); ASSERT_VALID( pDoc ); TRACE( "m_cyChar=%d m_cyClient=%d\n", m_cyChar, m_cyClient ); m_njePrevRecordCount = pDoc->m_JEArray.GetSize(); m_njePrevActiveRecord = pDoc->njeGetActiveRecord(); m_njePrevLastSelectedRecord = pDoc->njeGetLastSelectedRecord(); CSize sizeTotal( m_cxChar * JE_VIEW_WIDTH, m_cyChar * pDoc->GetTotalDisplayLines() ); CSize sizePage( m_cxChar * JE_VIEW_WIDTH / 5, max( m_cyChar, ((m_cyClient/m_cyChar)-1)*m_cyChar)); CSize sizeLine( m_cxChar * JE_VIEW_WIDTH / 20, m_cyChar ); SetScrollSizes( MM_TEXT, sizeTotal, sizePage, sizeLine ); TRACE( "Leaving UpdateScrollSizes()\n" ); }