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

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
fabvit2
Posts: 42
Joined: 05 Sep 2014 11:01

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

Post 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

highend
Posts: 14993
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

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

Post 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.
One of my scripts helped you out? Please donate via Paypal

fabvit2
Posts: 42
Joined: 05 Sep 2014 11:01

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

Post 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

highend
Posts: 14993
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

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

Post 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?
One of my scripts helped you out? Please donate via Paypal

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

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

Post 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.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

fabvit2
Posts: 42
Joined: 05 Sep 2014 11:01

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

Post by fabvit2 »

> Should I say, have fun?

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

Post Reply