Hi all, after reading through the manual I can't seem to find a way to define the size of dual display panes. I use the following command when Ctrl-Left Double Clicking on folders:
Go OPENINRIGHT=vert
However, each time I use this command the dual panes are each opened at 50%. If I manually resize the panes, the next time I use the command the panes are back at 50%. Is it possible to define the size of the destination pane? So for example, I would always want to have the destination pane at 20%, and the source pane at 80%. I thought to use layouts and styles, but they don't seem to work in remembering the exact position of the dual display panes. Any suggestions?
Layouts and Styles seem to remember the dual display size for me.
They remember the sizes as percentages of the window's width (or height if horizontal), not as absolute sizes. Is that what you don't like, or something else?
Yup, you're right By first configuring the dual panes, and then saving the layout, the position of the panes is remembered. However, the problem is that the layout also remembers opened folders at the time of saving, so if I'm working in a single pane display (which I usually do), switching to the saved layout will change all my currently opened folders and revert back to those saved along with the layout. Is there anyway to activate a layout without changing the currently opened folders? I'm guessing that styles are used for this purpose, but unfortunately, when saving a style, the position of the dual panes is not saved
Thanks Leo! Adjusting the position of the dual panes and then saving it as a style does in fact save the position of the panes I had removed the "Styles" tab button from my toolbar and completely forgot that I could save the current lister as a style, as opposed to manually configuring a style in the preferences (which does not allow you to set the size and position of the dual panes). So now I've got the following command on a button:
Prefs STYLE=Dual
Go FROMSEL OPENINRIGHT=vert
It works just as intended, but is it possible to toggle between two styles using the same button? So something like:
Prefs STYLE=Dual,Single,Toggle
The above command doesn't work because there isn't a toggle option for the "Prefs - Style" command. Is there another way to accomplish this?
As you've seen, the styles command won't let you toggle or cycle through like other commands. Feel free to submit a feature request / program suggestion through the official GPSoft Support Form...
In the meantime, maybe it won't be so bad if you make the one button you were going to use into a "Three Button" button? Left mouse click could run Prefs STYLE=Dual and right mouse click could run Prefs STYLE=Single?
Thanks all for the great suggestions I decided to whip up a quick autohotkey script that can allow switching between styles with just one hotkey. If a folder is selected in a lister, the hotkey will open a dual display pane showing the contents of the folder in the destination lister. However, if there is no folder selected and the hotkey is pressed while the mouse is hovering over the file display background, the hotkey will automatically switch the lister to a single display style:
Essentially, the ahk code above seems to be the only way to programatically detect whether a folder or file is selected in a Dopus lister. It checks to see what the current color is underneath the mouse. If the color doesn't equal white (the color of my lister display background), the script then knows that either a folder or file is selected. To ensure that the script knows you intended to have a folder or file selected, a left mouse click is sent at the position of the mouse cursor - if you intended to select something, the left click will highlight the folder or file underneath the mouse and we can be assured that the color will not be white. However, if the color under the mouse is white, meaning you did not intend to select a folder or file, the script takes another action (whatever you tell it to do). This is all done with a a single hotkey, simply making it context sensitive.
In case anyone is interested, two hotkeys were first configured within DOpus to switch between lister styles. These hotkeys are used in the script above:
^!F11 (Ctrl+Alt+F11 - used to set style to dual display)
Prefs STYLE=Dual
Go FROMSEL OPENINRIGHT=vert
Set FOCUS=Right
^!F12 (Ctrl+Alt+F12 - used to set style to single display)
Set FOCUS=Left FORMATLOCK=Off
Prefs STYLE=Single
The ahk script above is quite flexible and can be used for other purposes. I've found it to be extremely reliable and useful for doing various things quickly within DOpus.
I agree, it would be ideal to code the selection bit within DOpus, but the problem is that is even if "filepath" (or a similar command) is used, an external script can't use an "if" clause with it. Unless I've overlooked something, scripting languages like ahk don't understand "filepath" and also can't detect whether an item is selected within DOpus. So yes, using "filepath" within DOpus would work well if two hotkeys were assigned, but seeing as I'm abnormally lazy, I prefer to have only one hotkey used for two purposes Getting the pixel under the mouse may seem a bit awkward, but in actual use, it works quite well. The script does not constantly monitor the pixel color under the mouse - it simply gets the pixel color once when the hotkey is pressed. But if there is another way to assign two functions to one hotkey, making it context sensitive, I'm all ears
Leo is suggesting running a command in Opus, that invokes an external VBScript (or similar), which has {filepath} passed to it as an argument. The script could then determine if the passed path refered to a file or a folder, and act accordingly.
Mmmm....I'm trying to wrap my head around how that might work. I have limited experience with VBScript so I'm not sure where to start. Would it be possible to post a quick generic example of how that might work?
Also, I may have made my previous post unclear. The autohotkey code I posted above differentiates between having a file/folder selected vs having nothing selected. If {filepath} is passed to the external VBScript, could a conditional statement be created that works something like this:
If folder selected
(perform action 1)
Else If nothing selected
(perform action 2)
I'm always interested in making things more efficient, so I would be greatly interested in learning more about VBScript if it has the potential to integrate more tightly with DOpus (as opposed to using a scripting language like ahk). I've started to look at the basic elements of VBScript via the msdn site: http://msdn.microsoft.com/en-us/library/sx7b3k7y%28v=VS.85%29.aspx, but a quick generic example of how it might work with DOpus would be a big help
On a side note, would it be possible to add a "Scripts" section to the DOpus forum? I actually thought there was one, but then realized it was only for rename scripting. I notice that a lot of users are familiar with different scripting languages like VBScript and ahk, so it could be a great resource for users wishing to extend DOpus funtionality. Just a suggestion...