I have a request for LUA a little strange, but necessary.
I need to invert the table that defines the items of a popup, so that the first value is the last one. The popup should return everything in reverse, not only the item, but also the value.
Can anyone do some LUA magic for this?
the table
pht_chd_root = { --99
" C-0"," C#0"," D-0"," D#0"," E-0"," F-0"," F#0"," G-0"," G#0"," A-0"," A#0"," B-0",
" C-1"," C#1"," D-1"," D#1"," E-1"," F-1"," F#1"," G-1"," G#1"," A-1"," A#1"," B-1",
" C-2"," C#2"," D-2"," D#2"," E-2"," F-2"," F#2"," G-2"," G#2"," A-2"," A#2"," B-2",
" C-3"," C#3"," D-3"," D#3"," E-3"," F-3"," F#3"," G-3"," G#3"," A-3"," A#3"," B-3",
" C-4"," C#4"," D-4"," D#4"," E-4"," F-4"," F#4"," G-4"," G#4"," A-4"," A#4"," B-4",
" C-5"," C#5"," D-5"," D#5"," E-5"," F-5"," F#5"," G-5"," G#5"," A-5"," A#5"," B-5",
" C-6"," C#6"," D-6"," D#6"," E-6"," F-6"," F#6"," G-6"," G#6"," A-6"," A#6"," B-6",
" C-7"," C#7"," D-7"," D#7"," E-7"," F-7"," F#7"," G-7"," G#7"," A-7"," A#7"," B-7",
" C-8"," C#8"," D-8"
}
The popup
vb:popup {
id = "PHT_PP_ROOT_1",
height = 25,
width = 60,
value = 49,
items = pht_chd_root,
--notifier = ,
--midi_mapping = ,
--tooltip =
},
The result I want is exactly that the mouse wheel behaves exactly the other way around with this popup. When rolling up, start at the end of the table and vice versa, Thus, the behavior with the mouse wheel will be identical to a valuebox.
Any ideas? Thanks!
Edit: The problem is that as it is now, when rolling the wheel up, the values of the notes decrease and vice versa. And I want it the other way around.