2025-05-13 11:13 AM
Hi all,
I have a problem in my interface script.
I have a table that can have a range [0,10], in UI there is a UI_BUTTON (GLOB_UI_BUTTON_ID=11 and GLOB_UI_BUTTON_ID=12) that adds and subtracts a table by one (+ and - in the pic) there is also a UI_BUTTON with text "Simbol 1,2,3...10", (GLOB_UI_BUTTON_ID=j) when the UI_BUTTON is pressed you get a selection of symbols that you can choose, however the problem starts when you choose a symbol the infield disappears become GLOB_UI_BUTTON_ID becomes 0 i also have a specific text input field that shows specifically when some symbols are selected. My question is can I "force" AC to store the current value of GLOB_UI_BUTTON_ID?
picX=50
picY=50
for j = 1 to numberOfTabs
if GLOB_UI_BUTTON_ID = j then
ui_infield{4} simbolSelectionPosText[j],330,0,350,uiDimY,
1, "",
7,
2, picX+50, picY+70,
picX, picY,
simbolSelectionPosPic, simbolSelectionPosText, simbolSelectionPosIndex
endif
next j
Solved! Go to Solution.
2025-05-16 11:51 PM
This is the solution. But if you use a parameter to store this information its funnily even easier to have the buttons correspond to the parameter directly, like e.g. an ui_infield{3} with method = 4.
Either way it will work.
2025-05-16 04:03 AM
Hi,
I still don't understand your purpose for doing those things. If it's just to select the desired symbol type, why don't you create a "type" variable and use UI_INFIELD{4} to display the image for easier selection? If you have a different purpose, it's best to upload the object so it's easier to visualize.
2025-05-16 09:31 PM
Could you create a parameter for the button id and update it in the parameter script whenever the GLOB_UI_BUTTON_ID is different from 0? Then use the parameter instead of GLOB_UI_BUTTON_ID in the ui script.
2025-05-16 11:51 PM
This is the solution. But if you use a parameter to store this information its funnily even easier to have the buttons correspond to the parameter directly, like e.g. an ui_infield{3} with method = 4.
Either way it will work.
2025-05-19 01:56 PM
Hi all,
thank you all for the suggestions, and yes this works.
I added a condition in parameter script:
if GLOB_UI_BUTTON_ID >= 1 and GLOB_UI_BUTTON_ID <= brojSimbola then
parameters activeSimbol = GLOB_UI_BUTTON_ID
endif
and added a parameter activeSimbol int 1
and replaced the conditions inside the loop with that variable.
once again thank you all for the replay and suggestions.
2025-05-21 09:46 AM
BUTTON_ID kind of never worked as suposed (or better words as I imagined it should work),
The proper way to go is the UI_PICT_RADIOBUTTON/ UI_PICT_RADIOBUTTON{2} - it is with picture or text depending on if the picture is defined.