MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / refreshVScrollBar

Method refreshVScrollBar

Components/SamplerDialog.cpp:278–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278void
279SamplerDialog::refreshVScrollBar(void) const
280{
281 unsigned int pageSize = this->getVScrollPageSize();
282 unsigned long lines =
283 (this->ui->symView->getLength() + this->ui->symView->getStride() - 1) /
284 this->ui->symView->getStride();
285 unsigned long max = lines * this->ui->symView->getStride();
286
287 if (max > pageSize) {
288 this->ui->verticalScrollBar->setPageStep(static_cast<int>(pageSize));
289 this->ui->verticalScrollBar->setMaximum(static_cast<int>(max - pageSize));
290 this->ui->verticalScrollBar->setVisible(true);
291 } else {
292 this->ui->verticalScrollBar->setPageStep(0);
293 this->ui->verticalScrollBar->setMaximum(0);
294 this->ui->verticalScrollBar->setVisible(false);
295 }
296
297 this->ui->verticalScrollBar->setSingleStep(
298 static_cast<int>(this->ui->symView->getStride()));
299
300 if (!this->ui->symView->getAutoScroll())
301 this->ui->verticalScrollBar->setEnabled(
302 this->ui->symView->getLength() >= pageSize);
303 else
304 this->ui->verticalScrollBar->setEnabled(false);
305}
306
307
308void

Callers 3

feedSetMethod · 0.95
onOffsetChangedMethod · 0.95
onSymViewZoomChangedMethod · 0.95

Calls 2

getVScrollPageSizeMethod · 0.95
setEnabledMethod · 0.45

Tested by

no test coverage detected