Reply To: Value liste as text instead of numbers?

Home Forums General discussions Value liste as text instead of numbers? Reply To: Value liste as text instead of numbers?

#4536
Péter Baksa
Keymaster

Hi all,

a more flexible way is to use the VALUES{2} command.

set parameter “iVal” as integer

master script:
dim aVal[], sVal[], picVal[] ! parameter value, string shown on UI, icon index shown on UI
aVal[1] = 1 : sVal[1] = “Option 1” : picVal[1] = 2
aVal[2] = 2 : sVal[2] = “Option 2” : picVal[2] = 1

param script:
values{2} “iVal” aVal, sVal

ui script:
ui_infield{3} iVal, x, y, w, h,
2, ! pop-up with icons
picture_name,
images_number,
rows_number, cell_x, cell_y,
image_x, image_y,

picVal, sVal, aVal

This way you can easily re-organize the strings in the popup, by re-ordering the aVal, sVal, picVal arrays. You can rename the strings or swap icons by changing just one line in the master script.

Péter Baksa
Library Platform, Software Engineer
GRAPHISOFT SE