MCPcopy Create free account
hub / github.com/cinience/RedisStudio / TxSetScrollRange

Method TxSetScrollRange

DuiLib/Control/UIRichEdit.cpp:449–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447}
448
449BOOL CTxtWinHost::TxSetScrollRange(INT fnBar, LONG nMinPos, INT nMaxPos, BOOL fRedraw)
450{
451 CScrollBarUI* pVerticalScrollBar = m_re->GetVerticalScrollBar();
452 CScrollBarUI* pHorizontalScrollBar = m_re->GetHorizontalScrollBar();
453 if( fnBar == SB_VERT && pVerticalScrollBar ) {
454 if( nMaxPos - nMinPos - rcClient.bottom + rcClient.top <= 0 ) {
455 pVerticalScrollBar->SetVisible(false);
456 }
457 else {
458 pVerticalScrollBar->SetVisible(true);
459 pVerticalScrollBar->SetScrollRange(nMaxPos - nMinPos - rcClient.bottom + rcClient.top);
460 }
461 }
462 else if( fnBar == SB_HORZ && pHorizontalScrollBar ) {
463 if( nMaxPos - nMinPos - rcClient.right + rcClient.left <= 0 ) {
464 pHorizontalScrollBar->SetVisible(false);
465 }
466 else {
467 pHorizontalScrollBar->SetVisible(true);
468 pHorizontalScrollBar->SetScrollRange(nMaxPos - nMinPos - rcClient.right + rcClient.left);
469 }
470 }
471 return TRUE;
472}
473
474BOOL CTxtWinHost::TxSetScrollPos (INT fnBar, INT nPos, BOOL fRedraw)
475{

Callers

nothing calls this directly

Calls 4

SetScrollRangeMethod · 0.80
GetVerticalScrollBarMethod · 0.45
SetVisibleMethod · 0.45

Tested by

no test coverage detected