MCPcopy Create free account
hub / github.com/WheretIB/nullc / UpdateScrollBar

Method UpdateScrollBar

GUI/RichTextarea.cpp:1105–1122  ·  view source on GitHub ↗

Update scrollbars, according to the scrolled text

Source from the content-addressed store, hash-verified

1103
1104// Update scrollbars, according to the scrolled text
1105void TextareaData::UpdateScrollBar()
1106{
1107 SCROLLINFO sbInfo;
1108 sbInfo.cbSize = sizeof(SCROLLINFO);
1109 sbInfo.fMask = SIF_RANGE | SIF_PAGE | SIF_POS;
1110 sbInfo.nMin = 0;
1111 sbInfo.nMax = lineCount;
1112 sbInfo.nPage = RichTextarea::charHeight ? (areaHeight) / RichTextarea::charHeight : 1;
1113 sbInfo.nPos = shiftCharY;
1114 SetScrollInfo(areaWnd, SB_VERT, &sbInfo, true);
1115
1116 sbInfo.fMask = SIF_RANGE | SIF_PAGE | SIF_POS;
1117 sbInfo.nMin = 0;
1118 sbInfo.nMax = longestLine + 1;
1119 sbInfo.nPage = RichTextarea::charWidth ? (areaWidth - RichTextarea::charWidth) / RichTextarea::charWidth : 1;
1120 sbInfo.nPos = shiftCharX;
1121 SetScrollInfo(areaWnd, SB_HORZ, &sbInfo, true);
1122}
1123
1124// Function puts longest line size to a global variable
1125// Size is in characters, but the Tab can be represented with more that one

Callers 1

TextareaProcMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected