aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/GUIScrollbar.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-03-20 23:49:37 +0100
committer hop311 <hop3114@gmail.com>2024-03-20 23:49:37 +0100
commit0cd976341792ea30ca41e09d9c238e4e342402cd (patch)
treebb1e7fbe1e9f2c082ca82318911a09191455fd04 /extension/src/openvic-extension/classes/GUIScrollbar.cpp
parent8299a896d7658ffe86272ea0b21b8e5f7c600510 (diff)
GUIListBox rework (internal scrollbar, fixed mode, no child data vector)pop-menu
Diffstat (limited to 'extension/src/openvic-extension/classes/GUIScrollbar.cpp')
-rw-r--r--extension/src/openvic-extension/classes/GUIScrollbar.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/extension/src/openvic-extension/classes/GUIScrollbar.cpp b/extension/src/openvic-extension/classes/GUIScrollbar.cpp
index cdfa2fd..dab74d8 100644
--- a/extension/src/openvic-extension/classes/GUIScrollbar.cpp
+++ b/extension/src/openvic-extension/classes/GUIScrollbar.cpp
@@ -36,6 +36,8 @@ void GUIScrollbar::_bind_methods() {
OV_BIND_METHOD(GUIScrollbar::get_min_value);
OV_BIND_METHOD(GUIScrollbar::get_max_value);
OV_BIND_METHOD(GUIScrollbar::set_value, { "new_value", "signal" }, DEFVAL(true));
+ OV_BIND_METHOD(GUIScrollbar::increment_value, { "signal" }, DEFVAL(true));
+ OV_BIND_METHOD(GUIScrollbar::decrement_value, { "signal" }, DEFVAL(true));
OV_BIND_METHOD(GUIScrollbar::set_value_as_ratio, { "new_ratio", "signal" }, DEFVAL(true));
OV_BIND_METHOD(GUIScrollbar::is_range_limited);
@@ -466,6 +468,14 @@ void GUIScrollbar::set_value(int32_t new_value, bool signal) {
}
}
+void GUIScrollbar::increment_value(bool signal) {
+ set_value(value + 1, signal);
+}
+
+void GUIScrollbar::decrement_value(bool signal) {
+ set_value(value - 1, signal);
+}
+
float GUIScrollbar::get_value_as_ratio() const {
return _value_to_ratio(value);
}