From 4f45bfd08b013c00600a85abde0d0b19884ec430 Mon Sep 17 00:00:00 2001 From: v-rob Date: Fri, 6 Dec 2019 12:51:10 -0800 Subject: Add scrollbaroptions FormSpec element (#8530) --- doc/lua_api.txt | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 697efcdbc..12ab2b4b5 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -2351,16 +2351,40 @@ Elements ### `scrollbar[,;,;;;]` -* Show a scrollbar +* Show a scrollbar using options defined by the previous `scrollbaroptions[]` * There are two ways to use it: 1. handle the changed event (only changed scrollbar is available) 2. read the value on pressing a button (all scrollbars are available) * `orientation`: `vertical`/`horizontal` * Fieldname data is transferred to Lua -* Value this trackbar is set to (`0`-`1000`) +* Value of this trackbar is set to (`0`-`1000`) by default * See also `minetest.explode_scrollbar_event` (main menu: `core.explode_scrollbar_event`). +### `scrollbaroptions[opt1;opt2;...]` +* Sets options for all following `scrollbar[]` elements +* `min=` + * Sets scrollbar minimum value, defaults to `0`. +* `max=` + * Sets scrollbar maximum value, defaults to `1000`. + If the max is equal to the min, the scrollbar will be disabled. +* `smallstep=` + * Sets scrollbar step value when the arrows are clicked or the mouse wheel is + scrolled. + * If this is set to a negative number, the value will be reset to `10`. +* `largestep=` + * Sets scrollbar step value used by page up and page down. + * If this is set to a negative number, the value will be reset to `100`. +* `thumbsize=` + * Sets size of the thumb on the scrollbar. Size is calculated in the number of + units the thumb spans out of the range of the scrollbar values. + * Example: If a scrollbar has a `min` of 1 and a `max` of 100, a thumbsize of 10 + would span a tenth of the scrollbar space. + * If this is set to zero or less, the value will be reset to `1`. +* `arrows=` + * Whether to show the arrow buttons on the scrollbar. `default` hides the arrows + when the scrollbar gets too small, but shows them otherwise. + ### `table[,;,;;,,...,;]` * Show scrollable table using options defined by the previous `tableoptions[]` -- cgit v1.2.3