| 276 | } |
| 277 | |
| 278 | void |
| 279 | SamplerDialog::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 | |
| 308 | void |
no test coverage detected