losing focus after moveto

Things you’d like to miss in the future...
Forum rules
When reporting a bug, please include the following information: your XYplorer version (e.g., v27.90.0047), your Windows version (e.g., Win 11), and your screen scaling percentage (e.g., 125%). We recommend adding your Windows version and screen scaling percentage to your profile or signature. This will make debugging much easier for us.
Post Reply
qwerty
Posts: 53
Joined: 03 Apr 2018 15:59

losing focus after moveto

Post by qwerty »

Basically I need to create a new folder and move 2 files "111.txt|222.txt" to it; then trigger the rename mode (with "F2") waiting for the user input. I have the script code below:

Code: Select all

        $selitems = "111.txt|222.txt";
        $create = "123";
        $new = new($create, "dir");
        moveto $new, $selitems;
        // focus;   // doesn't work
        selectitems $new;
        #172;
It worked in v25.xx. But since v26.xx it has an error message saying "Tree or List must have input focus.". Looks like it lost focus after the moveto command. selectitems can't get the focus back. I tried setting "BackgroundFileOps", 0;, but in vain. Any ideas?

P.S. focus doesn't work: although the error message is gone, it only selected the new folder and doesn't trigger the rename mode like this:
123.png
123.png (1.48 KiB) Viewed 1861 times

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

Re: losing focus after moveto

Post by highend »

Can't replicate in current beta when using
setting "BackgroundFileOps", 0;

You need to use that anyway, moveto is a command, not a function.

And in general: Why don't you ask via input for the folder name in the first place instead of going into rename mode?
One of my scripts helped you out? Please donate via Paypal

qwerty
Posts: 53
Joined: 03 Apr 2018 15:59

Re: losing focus after moveto

Post by qwerty »

Thanks for your reply.
Actually I found the difference (or bug?) in this new beta version and wanted to figure out what is going on. The basic idea is create a new folder with a "default" name (e.g. 123 in the example code). If the user is happy with it, just click anywhere else to accept the name; if not, just input the new name directly. input is too heavy for it, although it may work. Please help. :roll: :roll:
Below are the 2 gif files running the same code in v23 and v26 (the latest beta version).

v23 (comment setting "BackgroundFileOps", 0;, and it works):
v23.gif
v23.gif (62.12 KiB) Viewed 1826 times
v26 same effects with or without the setting
v26.gif
v26.gif (132.06 KiB) Viewed 1826 times

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

Re: losing focus after moveto

Post by highend »

Attach the XYplorer.ini (renamed to .xys) from that beta (remove license data before)
One of my scripts helped you out? Please donate via Paypal

qwerty
Posts: 53
Joined: 03 Apr 2018 15:59

Re: losing focus after moveto

Post by qwerty »

PM'ed to you. Thanks.

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

Re: losing focus after moveto

Post by highend »

This works with your .ini here...

Code: Select all

setting "BackgroundFileOps", 0;
    $selitems = "111.txt|222.txt";
    $create = "123";
    $new = new($create, "dir");
    moveto $new, $selitems;
    focus;
    selectitems $new;
    #172;
One of my scripts helped you out? Please donate via Paypal

qwerty
Posts: 53
Joined: 03 Apr 2018 15:59

Re: losing focus after moveto

Post by qwerty »

I tried it in a freshly downloaded beta version and it indeed works in it. However, in the upgraded non-installed version, I have the same issue. A Weird problem.
I noticed for the fresh download, the xyplorer.ini file is in the root folder of xyplorer, while in the upgraded version, which was coming since v20.xx, everything keeps the old settings, and all the user data including .ini, .dat, the scripts and the layouts, is stored in a separate folder called "\data". Is that the reason?
Thanks anyway :beer: :beer: . I will build it from the fresh version if I can't find why.

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

Re: losing focus after moveto

Post by highend »

I noticed for the fresh download, the xyplorer.ini file is in the root folder of xyplorer
What? The portable version will have it's data in the ".\Data" subfolder, not in the root...
One of my scripts helped you out? Please donate via Paypal

qwerty
Posts: 53
Joined: 03 Apr 2018 15:59

Re: losing focus after moveto

Post by qwerty »

Looks like I am in another parallel world. :oops: :oops:
11.png
11.png (146.82 KiB) Viewed 1774 times

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

Re: losing focus after moveto

Post by highend »

Obviously...
1.png
1.png (33.2 KiB) Viewed 1770 times
One of my scripts helped you out? Please donate via Paypal

qwerty
Posts: 53
Joined: 03 Apr 2018 15:59

Re: losing focus after moveto

Post by qwerty »

:tup: :tup: :tup:

Post Reply