bsnes/hiro/qt/widget/horizontal-scroll-bar.cpp
Tim Allen 213879771e Update to v094r41 release (open beta).
byuu says:

Changelog (since the last open beta):
- icarus is now included. icarus is used to import game files/archives
  into game paks (folders)
- SNES: mid-scanline BGMODE changes now emulated correctly (used only by
  atx2.smc Anthrox Demo)
- GBA: fixed a CPU bug that was causing dozens of games to have
  distorted audio
- GBA: fixed default FlashROM ID; should allow much higher compatibility
- GBA: now using Cydrak's new, much improved, GBA color emulation filter
  (still a work-in-progress)
- re-added command-line loading support for game paks (not for game
  files/archives, sorry!)
- Qt port now compiles and runs again (may be a little buggy;
  Windows/GTK+ ports preferred)
- SNES performance profile now compiles and runs again
- much more
2015-08-21 20:57:03 +10:00

47 lines
1.1 KiB
C++

#if defined(Hiro_HorizontalScrollBar)
namespace hiro {
auto pHorizontalScrollBar::construct() -> void {
qtWidget = qtHorizontalScrollBar = new QtHorizontalScrollBar(*this);
qtHorizontalScrollBar->setRange(0, 100);
qtHorizontalScrollBar->setPageStep(101 >> 3);
qtHorizontalScrollBar->connect(qtHorizontalScrollBar, SIGNAL(valueChanged(int)), SLOT(onChange()));
pWidget::construct();
_setState();
}
auto pHorizontalScrollBar::destruct() -> void {
delete qtHorizontalScrollBar;
qtWidget = qtHorizontalScrollBar = nullptr;
}
auto pHorizontalScrollBar::minimumSize() const -> Size {
return {0, 15};
}
auto pHorizontalScrollBar::setLength(unsigned length) -> void {
_setState();
}
auto pHorizontalScrollBar::setPosition(unsigned position) -> void {
_setState();
}
auto pHorizontalScrollBar::_setState() -> void {
signed length = state().length + (state().length == 0);
qtHorizontalScrollBar->setRange(0, length - 1);
qtHorizontalScrollBar->setPageStep(length >> 3);
qtHorizontalScrollBar->setValue(state().position);
}
auto QtHorizontalScrollBar::onChange() -> void {
p.state().position = value();
p.self().doChange();
}
}
#endif