I have my drivebuttons set up as follow:
Go DRIVEBUTTONS=fixed,multifunc
How can I set the focus to the pane in which I opened a drive
I have my drivebuttons set up as follow:
Go DRIVEBUTTONS=fixed,multifunc
How can I set the focus to the pane in which I opened a drive
That doesn't seem possible at the moment. At least i couldn't find a way to achieve that.
@goselito
I don't exactly understand what you are trying to achieve? But for me it sounds like it maybe possible.
Does that make sense? o))
Well, in case you didn't solve it yet, consider giving some more details..
@tbone, i think it's following: with the multifunc option you can open a drive in the left file display using LMB, or in the right file display with the RMB.
Suppose, you have the right file display being the active one, und use the multifunc LMB. It will open the drive in the left file display, while the
active state stays on the right side without further action.
Ah ok, that "multifunc" was not on my mind. I think I got it now, thanks! o) At first I was about to agree with you, but then an idea popped up.
What about a script detecting folder changes and if it detects a root folder (drive) to be loaded (firstime?), it activates that tab and makes it source/have focus?
A script could be helpful, yes. Or, maybe some new option would be useful, like multifunc,followfocus, because we can assume, that if someone uses multifunc,
he's most likely about to use the chosen drive right after that.
[quote="abr"]A script could be helpful, yes. Or, maybe some new option would be useful, like multifunc,followfocus, because we can assume, that if someone uses multifunc,
he's most likely about to use the chosen drive right after that.[/quote]
Sorry for coming back so late to my own question. (Been away for the weekend)
@abr, I agree with something like multifunc,followfocus
That will be most helpfull
A new option for things which are doable by scripting is a questionable thing these days. o)
I still wonder a bit what usecase you have and why the file display needs to be "prefocused", I mean it's a drive root and you used your mouse to open it, so you probably click some folders there or select things. The file display would get focused automatically that way, I guess, no? There is another option btw. You could add some of these tripple-buttons, which open the drive left or right with the GO command and focus afterwards by using Set SOURCE=left/right. Is that an option?
Just tried
Go DRIVEBUTTONS=fixed
Set SOURCE=left
Doesn't work
If you're not willing to explain your usecase, I can keep things short as well. Multiple of these was, what I was thinking of (in a tripple button to emulate "multifunc").
Go D:\
Set SOURCE=left
@tbone: What you suggested will not work as expected. It will open D:\ wherever the source currently is and then set the source to left.
A better way to achieve what goselito wants is this:
Go D:\ OPENINLEFT
@tbone, sorry about that...
The reason I want it to set focus is because I use mouse gestures to perform various functions, but without the correct pane in focus the functions are performed on the wrong side.
Anyway, I suppose I could add buttons for every drive. It just seems an odd (and long) way to go about it
Ok, could you give an example for an action you perform with a gesture after opening a drive by mousebutton in left or right?
I hopefully do not anoy you, I'm just curious about how you use DO in that particular point. o)
Adding buttons for every drive would be the hard way, I admit, but you still have the scripting at hand, I probably would go that way. If you need help with that let me know.
@kundal
You're right, I was a bit too short with that post.. o)
I have 3 internal drives and 6 external and then occasionally one or two removables. (This is why I am looking for the short answer...lol)
Some of the drives are media drives, then I have a dedicated drive for new downloads etc.
One of the things I do with mouse gestures is to trigger filters in Dopus that removes files and folders that does not match the filter request of whichever filter I triggered. As such, at present those gestures will trigger the filter in the wrong pane.
I will probably go the scripting way with onafterfolderchanged. I am still learning the ropes with the new scripting engine, but detecting the root should not be that difficult. It just seems as if this is something that should be included in the Dopus command structure by default as I'm sure other people will have similar needs at one time or another.
Thanks for all the help. I am truly amazed at how helpful (and responsive) this community is.
Is this a bug or am I doing something wrong.
The Set Focus=Source command does nothing in the following code:
[code]' Called by Directory Opus to initialize the script
Function OnInit(initData)
initData.name = "DriveRoot"
initData.desc = "Sets focus to the pane where a drive was set with the go command"
initData.copyright = ""
initData.version = "1.0"
initData.default_enable = true
End Function
' Called after a new folder is read in a tab
Function OnAfterFolderChange(afterFolderChangeData)
If len(afterFolderChangeData.tab.path) < 4 Then
dim objCmd : Set objCmd = DOpus.NewCommand
objCmd.SetSource(afterFolderChangeData.tab.path)
objCmd.RunCommand("Set focus=source")
Set objCmd = Nothing
End If
End Function[/code]
I have tried all the other focus commands and they all work when the condition is met.
Try this version, it works here at least.
[code]Function OnAfterFolderChange(data)
If (data.tab.path.Root() <> false) Then Exit Function 'tab is not at root level
If (data.tab.source = true) Then Exit Function 'tab is source (has focus already)
dim objCmd : Set objCmd = DOpus.NewCommand
objCmd.SetSourceTab(data.tab) 'set current source tab as target
objCmd.RunCommand("Set FOCUS=dest") 'switch focus to dest tab
End Function[/code]
Your code may have little issues, one if it probably is the use of SetSource() instead of SetSourceTab() and the Set-command, don't know.
I'm not good at these button level builtin commands.
Thanks @tbone
This does exactly what I want
I'm glad to hear, thanks for giving feedback. o)