2015-12-29, 21:09
Hi,
I may be doing this wrong so, correct me if I am.
Using settings.xml I am trying to set the conditional visibility of items based on a previous 'select' control that uses lvalues.
So for me the issue is that although the choices of the 'select' can use localized strings via lvalues, the subsequent lines cannot have conditional visibility without hard-coding the string.
The wiki says to look at the source code for undocumented features, but with my limited amount of c++ knowledge it's like reading a menu only written in Chinese.
I did discover that ldefault works to set the default value of a 'select' using lvalues.
I have tried 'lvisible' which doesn't work. I tried using the index of the lvalue (ie. eq(-4,0)) but this doesn't work as it does if the control is 'lablelenum'.
I thought about just switching to using labelenum, but with 23 choices, that makes for a bad user experience.
FYI I hard coded the other labels for illustration purposes so that I didn't need to give you a whole strings.po file to refer to.
If this is indeed a missing feature, I would love to see a 'labelselect' control added to the API or 'lvisible' and 'lenable' to use conditionals with lvalues.
Before someone replies to just write it myself and submit, believe me I would if I could.
If you wan't to play around with this I put it up on GitHub: https://github.com/KenV99/script.lvalues_example
I may be doing this wrong so, correct me if I am.
Using settings.xml I am trying to set the conditional visibility of items based on a previous 'select' control that uses lvalues.
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<settings>
<category label="lvalues example">
<setting label="The selector below uses lvalues to provide localized choices" type="lsep" />
<setting ldefault="32003" id="myid" label="Selector" type="select" lvalues="32003|32004|32005" />
<setting label="The line below uses visible='eq(-2,Task1)' so you will see it" type="lsep" />
<setting label="You can see me" type="lsep" visible="eq(-2,Task1)" />
<setting label="The line below uses visible='eq(-4,32003)' so you won't see it" type="lsep" />
<setting label="You can't see me" type="lsep" visible="eq(-4,32003)" />
</category>
</settings>
<!--32003 = 'Task1', 32004 = 'Task2', 32005 = 'Task3'-->
So for me the issue is that although the choices of the 'select' can use localized strings via lvalues, the subsequent lines cannot have conditional visibility without hard-coding the string.
The wiki says to look at the source code for undocumented features, but with my limited amount of c++ knowledge it's like reading a menu only written in Chinese.
I did discover that ldefault works to set the default value of a 'select' using lvalues.
I have tried 'lvisible' which doesn't work. I tried using the index of the lvalue (ie. eq(-4,0)) but this doesn't work as it does if the control is 'lablelenum'.
I thought about just switching to using labelenum, but with 23 choices, that makes for a bad user experience.
FYI I hard coded the other labels for illustration purposes so that I didn't need to give you a whole strings.po file to refer to.
If this is indeed a missing feature, I would love to see a 'labelselect' control added to the API or 'lvisible' and 'lenable' to use conditionals with lvalues.
Before someone replies to just write it myself and submit, believe me I would if I could.
If you wan't to play around with this I put it up on GitHub: https://github.com/KenV99/script.lvalues_example