MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / scrollUp

Method scrollUp

src/Interface/TextList.cpp:772–794  ·  view source on GitHub ↗

* Scrolls the text in the list up by one row or to the top. * @param toMax If true then scrolls to the top of the list. false => one row up * @param scrollByWheel If true then use wheel scroll, otherwise scroll normally. */

Source from the content-addressed store, hash-verified

770 * @param scrollByWheel If true then use wheel scroll, otherwise scroll normally.
771 */
772void TextList::scrollUp(bool toMax, bool scrollByWheel)
773{
774 if (!_scrolling)
775 return;
776 if (_rows.size() > _visibleRows && _scroll > 0)
777 {
778 if (toMax)
779 {
780 scrollTo(0);
781 }
782 else
783 {
784 if (scrollByWheel)
785 {
786 scrollTo(_scroll - std::min((size_t)(Options::mousewheelSpeed), _scroll));
787 }
788 else
789 {
790 scrollTo(_scroll - 1);
791 }
792 }
793 }
794}
795
796/**
797 * Scrolls the text in the list down by one row or to the bottom.

Callers 5

moveSoldierUpMethod · 0.80
mousePressMethod · 0.80
scrollMethod · 0.80
mousePressMethod · 0.80
mouseClickMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected