diff --git a/PortabilityLayer/PLScrollBarWidget.cpp b/PortabilityLayer/PLScrollBarWidget.cpp index e4d6018..b0600a6 100644 --- a/PortabilityLayer/PLScrollBarWidget.cpp +++ b/PortabilityLayer/PLScrollBarWidget.cpp @@ -213,6 +213,30 @@ namespace PortabilityLayer DrawControl(m_window->GetDrawSurface()); } + void ScrollBarWidget::SetMin(int32_t v) + { + m_min = v; + if (m_state < m_min) + SetState(m_min); + else + { + RefreshGrip(); + DrawControl(m_window->GetDrawSurface()); + } + } + + void ScrollBarWidget::SetMax(int32_t v) + { + m_max = v; + if (m_state > m_max) + SetState(m_max); + else + { + RefreshGrip(); + DrawControl(m_window->GetDrawSurface()); + } + } + int16_t ScrollBarWidget::Capture(const Point &pos, WidgetUpdateCallback_t callback) { int part = ResolvePart(pos); diff --git a/PortabilityLayer/PLScrollBarWidget.h b/PortabilityLayer/PLScrollBarWidget.h index 5a5bbef..f22a38f 100644 --- a/PortabilityLayer/PLScrollBarWidget.h +++ b/PortabilityLayer/PLScrollBarWidget.h @@ -21,6 +21,9 @@ namespace PortabilityLayer void SetState(int16_t state) override; void OnStateChanged() override; + void SetMin(int32_t v) override; + void SetMax(int32_t v) override; + int16_t Capture(const Point &pos, WidgetUpdateCallback_t callback) override; int ResolvePart(const Point &point) const override;