Focus on the pop-up

Features wanted...
Post Reply
ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Focus on the pop-up

Post by ivan »

This feature request sort of arose now that I started to use the multi-combo script from Tips, Q&A section (put kindly together by TheQwerty 8) ).

Basically, it's to do with pop-ups triggered by XYplorer. If you have a look in the thread that I mean

http://www.xyplorer.com/xyfc/viewtopic.php?t=2605

This bit of code

Code: Select all

Msg("Press OK when WinRAR is finished.",1); 
throws up a message box. Now I image there are lots of files in that folder so the extraction process won't take seconds, but minutes. Do I sit staring until it's finished? No, surely not. So in the spirit of multitaskiness (quick, patent that word :lol: ) I flip over to do whatever in my browser or resume a Skype chat with a friend. Time passes by and I notice that WinRAR window disappeared from the taskbar, which means that extraction has finished. I click on the taskbar's "bar" for XYplorer to go back and click OK in the box. However, the niggling issue is that when you do so, the focus isn't automatically on the box with the buttons but on the main XYplorer window! It makes no sense in it being that way because as long as that pop-up box is there you can't do anything in XYplorer.

So, the questions are: is that inherent Windows behaviour (I have a feeling that that's the case because you click on the bar for the app and it focuses on the app regardless of the pop-up box) and, if it is, then can anything be done about it?

It's important to note that the pop-up using the code is generated by XYplorer and places "you can do nothing until you click" restrictions. However, later on in the code, there's a call to delete the folder, which prompts your typical "Do you want to move ... to Recycle Bin?" pop-up which has none of the restrictions XYplorer's one has.

So, 2 features wanted:

1. Auto-focus on the pop-up (if possible)
2. Removal of operating restrictions on XYplorer's pop-ups.

Cheers :)

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: Focus on the pop-up

Post by jacky »

ivan wrote:1. Auto-focus on the pop-up (if possible)
Yeah, I vote for that one too. I do use such scripts as well, and when reactivating XY by clicking on the Taksbar, its main window gets the focus, not the popup (same goes with input), which is a bit annoying. Not only that, but if you have an input window shown, since the focus isn't there but on XY pressing keys could trigger KS while you didn't expect it!
It the focus could be sent to the "modal" window, that'd be great indeed.
ivan wrote:2. Removal of operating restrictions on XYplorer's pop-ups.
Nope, that's not gonna happen : the aim of such popups is to stop any current set of actions (eg. script) and wait until the user made a decision (clicked Ok, or not...) then it continues (or not...). It has to work that way.
Proud XYplorer Fanatic

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Re: Focus on the pop-up

Post by ivan »

jacky wrote:Nope, that's not gonna happen : the aim of such popups is to stop any current set of actions (eg. script) and wait until the user made a decision (clicked Ok, or not...) then it continues (or not...). It has to work that way.
While having some things set in stone is good, having others isn't. At least, I would appreciate if an option to enable/disable restrictions is provided and maybe also "always on top" tickbox setting for those who choose to disable restrictions.

admin
Site Admin
Posts: 66316
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Focus on the pop-up

Post by admin »

jacky wrote:
ivan wrote:1. Auto-focus on the pop-up (if possible)
Yeah, I vote for that one too. I do use such scripts as well, and when reactivating XY by clicking on the Taksbar, its main window gets the focus, not the popup (same goes with input), which is a bit annoying. Not only that, but if you have an input window shown, since the focus isn't there but on XY pressing keys could trigger KS while you didn't expect it!
It the focus could be sent to the "modal" window, that'd be great indeed.
ivan wrote:2. Removal of operating restrictions on XYplorer's pop-ups.
Nope, that's not gonna happen : the aim of such popups is to stop any current set of actions (eg. script) and wait until the user made a decision (clicked Ok, or not...) then it continues (or not...). It has to work that way.
1. Yes, I agree: I will try to change it. I admit I was not even aware of this behavior of the MsgBox.

2. Agree with jacky.

admin
Site Admin
Posts: 66316
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Focus on the pop-up

Post by admin »

ivan wrote:So, the questions are: is that inherent Windows behaviour (I have a feeling that that's the case because you click on the bar for the app and it focuses on the app regardless of the pop-up box) and, if it is, then can anything be done about it?
Just checked for some minutes and it looks like the "behavior" is inherent to windows message boxes, and I personally would call this behavior a bug. I don't see any purpose in setting the input focus to a window that canot get any input because it has a modal child. Complete rubbish.

Fortunately, my own modal windows (e.g. the Step dialog) do not show this bug. So the solution would be to write an emulation of the message box. Exactly this, by coincidence (!), I have done half-way some days ago when I designed the Compare dialog (which in the next upload will have icons!).

Currently the button captions on the msgbox will be in your system language. In an emulated msgbox the buttons will probably be hard-coded to English.

This will happen only in about 6 weeks though (other stuff on the roadmap + 2 weeks on the beach in July!).

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Re: Focus on the pop-up

Post by ivan »

admin wrote:2. Agree with jacky.
Let's face it, we're all adults here (at least I hope so). If you screw something up, you accept the responsibility. So I guess what I'm saying is that it's hardly fair to "unintentionally" assume that all users are noobs and gonna screw something up while the script is executing. Sure, if you don't give them the choice then people won't make things wrong, but if you will give them the choice then there's every chance they'll make things right. It's not my call, but bullet-proofing XYplorer like that with no other choice doesn't really appeal to me.

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Post by j_c_hallgren »

I'm not involved in this issue but wanted to ask how this request is much different from the ability we have presently to decide if we want a "delete confirm prompt" or similar...as presented thus far, having the default behavior be that one gets the pop-up but having some method (optional parameter, etc) to bypass it for specified command only would seem to allow greater flexability in writing scripts...if user mucks it up, well, then, they took a risk and lost.

Can't have protection in every thing you do...once in a while, users have to live dangerously in order to get better productivity!
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Post by serendipity »

Yep, much like the Nuke button or ::#1054, user has to use caution.

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Post by ivan »

serendipity wrote:Yep, much like the Nuke button or ::#1054, user has to use caution.
And enabling restrictions doesn't allow a user to use caution, it does it for him. Now there's nothing wrong with that, but the less options (even if one of them means throwing caution to the wind) that are available the "less good" it is (worse is just the wrong word to use :lol: )

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Post by jacky »

There's also a huge difference: you're referring to Windows operations/dialog, not XY.

When executing a script, if you allow XY to let user do other stuff while the script it still waiting for user input, then (it means such popups must be tweaked to stop script execution yet allow more/other user interactions, and) things like many scripts running at once could happen, and this is not the way this is supposed to work, nor (I guess) it has been designed.

A script isn't supposed to be left hanging while you're working on something else, this isn't how it has been designed/thought (script were initially a way to automate XY, not run parallel operations/tasks), and quite frankly I don't really see what best this would allow, either... :roll:

(BTW, I know I'm all for options myself too, but I don't think I'd go as far as to say the more options the better, to have plenty of good, useful, well thought options is one thing, to have plenty of options for the sake of it is another.)
Proud XYplorer Fanatic

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Post by ivan »

Well it is possible to have multiple scripts run in a sequence so, I'd guess, potentially that leaves room for scripts to be run in parallel.

Having such restrictions isn't a big deal, more of an inconvenience that always reminds me of by constant pop-ups on some times and me not being able to do anything about it.

For sure, feature 1 is more important so I'll drop this one... 8)

admin
Site Admin
Posts: 66316
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Focus on the pop-up

Post by admin »

admin wrote:
ivan wrote:So, the questions are: is that inherent Windows behaviour (I have a feeling that that's the case because you click on the bar for the app and it focuses on the app regardless of the pop-up box) and, if it is, then can anything be done about it?
Just checked for some minutes and it looks like the "behavior" is inherent to windows message boxes, and I personally would call this behavior a bug. I don't see any purpose in setting the input focus to a window that canot get any input because it has a modal child. Complete rubbish.
I further researched this very interesting topic, and found, with the help of a German programming newsgroup, a probable fix! Since I'm not sure yet about any side effects, I will offer the fix as a tweak for the time being. See next upload...

Post Reply