Page 1 of 1

How to check for the state of a Command ID toggle?

Posted: 03 Sep 2015 10:12
by fabvit2
Say I want to toggle on some Command ID via a custom button, so I edited its On left click:
#401; #403; #405; #406; #407; #408; #413; #415

Now, each time I press this button, each Command ID is toggled On or Off depending of its current state.

Each time I press that button I want to toggle *all* the Command IDs either all On or all Off.

How can I check the current state of a Command ID that is a toggle?

thanx
--
fabio vitale

Re: How to check for the state of a Command ID toggle?

Posted: 03 Sep 2015 10:18
by highend
There are only a few #commands where the sc get() can retrieve the current state. None of the ones you're using...

There is not much to do apart from bringing all your #commands in a consistent state (e.g. all off). You're lost if you switch one of them to a different state and then use your button again.

Re: How to check for the state of a Command ID toggle?

Posted: 03 Sep 2015 10:28
by fabvit2
Anyway if I use a permanent variable I can get in a situation where one of the toggle Command ID was modified outside my script (i.e. from menu Tools -> Customize Lists)...
So I need something to toggle them either *all* On or *all* Off
--
fabio vitale

Re: How to check for the state of a Command ID toggle?

Posted: 03 Sep 2015 10:46
by highend
There is probably only one way to do what you want:

In your script, save settings first, read out
<xydata>\Panes\1\t\pane.ini
and evtl.
<xydata>\Panes\2\t\pane.ini

find out, how "Style=<number>"
in all sections is build (or at least how your #commands influence it),
deduct your settings from and and depending on the value,
toggle different ones.

Should I say, have fun?

Re: How to check for the state of a Command ID toggle?

Posted: 03 Sep 2015 10:47
by bdeshi
highend wrote:find out, how "Style=<number>"
in all sections is build (or at least how your #commands influence it),
deduct your settings from and and depending on the value,
toggle different ones.
and then reload the tabsets.

edit: btw,
find out, how "Style=<number>"
in all sections is build (or at least how your #commands influence it),
for this step, this pane.ini breakdown might help. Fair warning: this might've become obsolete.

Re: How to check for the state of a Command ID toggle?

Posted: 03 Sep 2015 10:56
by fabvit2
> Should I say, have fun?

I'll avoid to modify any value through the menu ;-)))