MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / UpdateScrollRange

Method UpdateScrollRange

UTCP/src/uh_ctrl.cpp:515–543  ·  view source on GitHub ↗

UpdateScrollRange Internal function This function calcs the scrollbar ranges Params none Return none ***********************************/

Source from the content-addressed store, hash-verified

513 none
514***********************************/
515void CUH_Control::UpdateScrollRange(){
516
517 if(m_hWnd == NULL)
518 return;
519
520 //update the vertical scrollbar
521 int offset = m_vScrollRange - m_vScrollPos;
522
523 m_vScrollRange = m_HLEndPos - m_vScrollPageSize +1;
524 if(m_vScrollRange <0)
525 m_vScrollRange = 0;
526
527 m_vScrollPos = m_vScrollRange - offset;
528 if(m_vScrollPos <0)
529 m_vScrollPos = 0;
530
531 SetScrollRange(m_hWnd,SB_VERT,0,m_vScrollRange,FALSE);
532 SetScrollPos(m_hWnd,SB_VERT,m_vScrollPos,TRUE);
533
534 //update the horizontal scrollbar
535 m_hScrollRange = m_maxLineWidth - m_hScrollPageSize+1;
536 if(m_hScrollPos > m_hScrollRange)
537 m_hScrollPos = m_hScrollRange;
538 if(m_hScrollPos <0)
539 m_hScrollPos = 0;
540 SetScrollRange(m_hWnd,SB_HORZ,0,m_hScrollRange,FALSE);
541 SetScrollPos(m_hWnd,SB_HORZ,m_hScrollPos,TRUE);
542
543}
544
545/**********************************
546OnVScroll

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected