Instant Color Filter - toggle

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
neil9090
Posts: 64
Joined: 28 Jun 2014 00:09

Instant Color Filter - toggle

Post by neil9090 »

If I put the follow command address bar into the address bar, it sets the instant filter appropriately.

::colorfilter("dir:del >,FF11FF")

This works, if I press return again in the address bar or send the same setting command again it toggles it off, is there a tweak to stop the toggle if the same value is set (is it a bug)?

If I make a change to the value it sets ok as expected, but when the exact same command is used it toggles off. I have written a vb app to create the instantcolor filter string and then send this to xy via WM_COPYDATA, but if I send the same command it toggles it off.

I am fixing it by setting something before the real value I want;
::colorfilter(""); //deactivate any color filter
::colorfilter("dir:del >,FF11FF")

For anyone using WM_COPYDATA to control xy, if you are naming the color filter with "name of filter"
you need to send ::colorfilter(' "name of filter" dir:del >,FF11FF ' )
the string being sent needs to be a single quoted string e.g. ' mycolorfilterstring'
aka double double quotes like " "" don't work

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Instant Color Filter - toggle

Post by highend »

is there a tweak to stop the toggle if the same value is set (is it a bug)?
This is by design
Instant Color Filters
Usage
· If you activate the same filter again it is deactivated (toggle).
aka double double quotes like " "" don't work
Are you sure you did quote it correctly for the string to send?
XY would expect something like this:

Code: Select all

"""name of filter"" dir:del >,FF11FF"
This would be resolved to

Code: Select all

"name of filter" dir:del >,FF11FF
One of my scripts helped you out? Please donate via Paypal

neil9090
Posts: 64
Joined: 28 Jun 2014 00:09

Re: Instant Color Filter - toggle

Post by neil9090 »

Thanks highend for your response.

I have re-checked the double quote replacement and it was my error, it wasn't doubling the quotes in the message being sent, I was doubling the first and last ones in the color filter.

By Design, normal procedures are called to set a value, not to toggle if the same procedure and value is called but if that is the design that's ok.
The help says :
If empty ("") any color filters are deactivated.

I was a little surprised that it toggles.

The toggle feature isn't mentioned in the help, but I can see the UI works in a similar way on the dropdown, selecting the same dropdown item toggles the instant colouring off/on.

I guess if I wanted to toggle it I would use the command #1077
maybe the scripting command should have an extra parameter
colorfilter([filters], [separator=||],[option])
[options]
turn off instant filter
turn on instant filter
toggle instant filter #1077
set instant filter to (filters)
set instant filter to (filters) and save in list
use saved filter [filter name] provided in [filters]
delete filter

There doesn't appear to be a way to save the color filter into the list via scripting, unless I am missing something.

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Instant Color Filter - toggle

Post by highend »

The toggle feature isn't mentioned in the help, but I can see the UI works in a similar way on the dropdown, selecting the same dropdown item toggles the instant colouring off/on.
icf.png
icf.png (36.32 KiB) Viewed 1363 times
There doesn't appear to be a way to save the color filter into the list via scripting
You mean the list from Tools - List Management - Instant Color Filter...?
No, they are stored in the .ini file. You could write a filter there but you'd need to restart
XY to see it...
One of my scripts helped you out? Please donate via Paypal

neil9090
Posts: 64
Joined: 28 Jun 2014 00:09

Re: Instant Color Filter - toggle

Post by neil9090 »

I was looking in the scripting commands help section : colorfilter but it only appears to be mentioned in the index page (linked in the colorfilter description) just didn't notice the " If you activate the same filter again it is deactivated (toggle). "

btw: if I search for "instant color filters" it doesn't return the index page you have shown because its part of the "color filters" page, guess I thought it would have its own page.
Selecting on the index tab, searching for instant color filters it finds the page..

So I am guessing there no way to set an instant filter and save it to the list via a command.

colorfilter appears to be useful for a temporary and immediate thing, but I guess I need to use the GUI to save the customisation or use the Color Filters to do the same thing on a permanent basic.

Guess I could write something to update the INI, and at the same time set the current instant filter to what it needs to be, then when XY reloads it will be added to the list.

I am guessing there isn't a command for XY to reload a list of values without exiting the application like the tagload function e.g. listload.

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Instant Color Filter - toggle

Post by highend »

colorfilter appears to be useful for a temporary and immediate thing
It's meant only for this purpose
I am guessing there isn't a command for XY to reload a list of values without exiting the application
Nope
One of my scripts helped you out? Please donate via Paypal

Post Reply