Best to use screenshots to explain what wrong... but first, an assumption on my part that maybe isn't correct. The manual describes the LINE option for the Toolbar RAW command as such:
Honestly, I'm not entirely sure what this is really "supposed" to mean - but what I think is most intuitive would be that:
When STATE=top, that LINE=0 would be the top most toolbar, and LINE=1 would be the next toolbar BELOW LINE=0
When STATE=bottom, that LINE=0 would be the bottem most toolbar, and LINE=1 would be the next toolbar ABOVE LINE=0
When STATE=left, that LINE=0 would be the left most toolbar, and LINE=1 would be the next toolbar to the right of LINE=0
When STATE=right, that LINE=0 would be the right most toolbar, and LINE=1 would be the next toolbar to the left of LINE=0
So on one hand, I'm curious if my interpretation is right... But even if it's wrong, something still is not working right. Here's a test layout with a boat load of toolbars on every side:
Now, everything for the TOP toolbars works as I would expect based on my assumptions above. But look at what happens to the bottom toolbars from the following series of commands:
toolbar toggle name=tb06 state=bottom line=1,500 (result as expected, the TB06 toolbar toggles off - yeah, I know I don't need all the other args on there)
toolbar toggle name=tb06 state=bottom line=1,500 (again, to turn it back on)
As you can see, toolbar TB06 is opened on the bottom most toolbar (what I assumed to be LINE=0) next to toolbar TB04 instead of TB05.
So, on the assumption that my interpretation of how LINEs 0 and 1 are oriented on the bottom of the lister is wrong... I try the following after reverting to the original lister and toolbar arrangement:
toolbar toggle name=tb06 (result as expected, the TB06 toolbar toggles off - and I got rid of the superfluous options and args )
toolbar toggle name=tb06 state=bottom line=0,500 (again, to turn it back on)
...but changing the LINE=1 to LINE=0 results in the same arrangement as before, with toolbar TB06 being opened still next to TB04 at the bottom most line position.
So something seems wrong here on the BOTTOM. More to follow...
Things got more confusing when I tried the left/right toolbars. At first, I was getting the same (wrong) results on both left and right... but then the left started working as I expected. I have no idea why, but right now I'm seeing the following on the left side with the following commands and results:
Let's say three toolbars - AAA, BBB, and CCC - are currently open at the top of a lister.
Toolbar XXX opens the XXX toolbar below the last (CCC) toolbar. Toolbar XXX Line 0 opens the XXX toolbar above the first (AAA) toolbar. Toolbar XXX Line 1 opens the XXX toolbar above the second (BBB) toolbar. Toolbar XXX Line 2 opens the XXX toolbar above the third (CCC) toolbar.
This is all good and as expected. What's missing is support for Line -1, Line -2, etc., which would provide a generic method of positioning a new toolbar relative to the end of a group of current toolbars, no matter how many toolbars are currently there to start with. For example, Toolbar XXX Line -1 to force the new toolbar into second bottom position in the group.
I asked something similar for "bottom": If you already have a toolbar at the bottom, it's not possible to place a conditional toolbar below lister and above the existing toolbar. The answer was: Toolbar sets.
I'm all for enhancements, but at the moment - what we already have doesn't seem to work reliably for anything other than STATE=top toolbars, even when not complicating it with the use of conditional toolbars. This is sort of broken even just with doing everything through RAW commands after manually arranging the toolbars.
One of the reasons I was playing with this was to see if a script configured to run in response to Before and After FolderChange events might be able to be used to have more refined control of the sort of things some of you guys wanted to do with toolbar sets and folder formats; but where some use-cases like those suggested by Kundal and Sasa didn't seem quite possible. For what I had in mind to work, I figured you'd be able to figure out how to use script or RAW commands to arrange new toolbars based on what's already open and available in the Lister objects toolbar collection...
First steps were just to make sure RAW command toolbar arrangements worked well, but they don't seem to. I have no reason to think this is unique to v11, maybe it was just as wonky in v10... but without this working reliably there's no point in trying to do more elaborate things via a script until this works better.
With conditional toolbars and sets it's essential to place toolbars in every position desired. But the question is: How positioning different toolbars always to the wanted place when always toggling two or more of them?
E.g. "tb1" is set to line 3. Now you set "tb2" to line 3, too, and if "tb1" is activated, it should move to line 4. How to solve that?
The only solution I actual can imagine is using priorities. But funny how complex it will be on e.g. only 4 toolbars:
TB1 Line 2 Priority 1
TB2 Line 2 Priority 3
TB3 Line 2 Priority 2
TB4 Line 3 Priority 2
What will happen?
TB1: has got max. priority, so it will be placed on line 2.
TB2: has got lowest priority, so it will be placed on line 3.
TB3: has got higher priority than TB2, so it moves to line 3 and TB2 to line 4.
So far so good, we now have following situation:
TB1 is on line 2
TB2 is on line 4 and
TB3 is on line 3
Now what happens when we activate TB4?
TB3 has same priority, but lower line, so it moves to line 3 and TB4 to line 4.
Situation:
TB1 line 2
TB2 line 3
TB3 line 3
TB4 line 4
TB2 und 3 have same line! TB2 has lower priority than TB4, but higher line. What happens?
TB1 line 2
TB2 line 4
TB3 line 3
TB4 line 5 (because of line-priority).
You could use this with top, bottom, left and right. Two toolbars having same line and priority are also possible, but require a "x pixel from the left", so they would be placed next to each other and always on same line.
So we could have a command like this:
"Set MyToolbar Line 1 Pri 1 Pos 0"
"Line" has highest priority
"Pri" has secondary priority (if more than one toolbar uses same line)
"Pos" positions toolbar with same "Line"- and "Pri"-value next to each other.
Sorry, but I don't think you need priorities at all... I think you just need reliable and expected behavior behind what happens when you load a toolbar onto a line where one is already loaded. Should it bump the existing toolbar up, down, left or right?
And you can already stack toolbars (or are supposed to be able to, hence my original post) next to each other on the same line with LINE=<line_num>,<pixel_offset>.
There's also nothign stopping you from using arbitrary LINE values with greater range (10, 20, 30, etc).
I'm going to start playing with the lister->toolbar collection anyway now... If we an get a list of open toolbars WITH their LINE position... then with properly working and reliable toolbar LINE behavior, you should be able to easily arrange toolbars without additional arguments and priority controls.
And what happens if 2 toolbars uses same line and same "bump"?
You can have it easier: Just use - let's say - 10 lines, set TB1 to 1 and TB2 to 5 and TB3 to 10. Then set TB4 to 7 and it will appear between TB2 and TB3. Bingo.
An yes, I know that you can stack them together, but don't want to include that option in the solution!
Toolbars don't remember the line number you gave them. If you have three toolbars they are lines 0, 1 and 2. If you close the middle one they are now lines 0 and 1.
I don't understand what you mean. If you turn on ToolbarA at Line 3, then try and turn on ToolbarB at Line 3... as long as there is consistent behavior in what happens with the new toolbar (appears before or after the existing toolbar at the specified line number) I still don't understand why you think there needs to be any prioritization.
Actually... don't answer that ! Can we move this discussion into a separate topic? I opened this thread because it seems like the current commands are not working properly... I see Jon just replied, but not on anything to do with the apparent bug I think my results reveal (either bug or I'm waaaay misinterpreting the manual, or BOTH).
Focusing on the original report rather than the derailment, I don't think there is a problem here.
The first issue is simply a misunderstanding (as you guessed) of how the numbering works. Line 0 is always the first line (top/left) in any group. So line 0 at the bottom is the top-most toolbar in the bottom group.
The second issue does look like a bug when you test it as described, but the behaviour can be explained by looking at the layout that sets up the test. The three toolbars (TB10, TB11 and TB12) all start out as STATE=viewpane toolbars - you can see this for yourself by turning on the viewer pane in that Lister. With the viewer pane on the toolbars will appear between the file display and the viewer pane, not at the very right of the Lister. So toggling one off and back on again specifying STATE=right causes the toolbar to jump to the right, because the "right" group appears to the right of the "viewpane" group.
I'll retest the bottom after building the layout using the commands - something seemed wrong still there.
For the right-side bars... Didn't even think about the impact to dragging them manually to the right side of lister with what you said about the viewpane. Got it, thanks... I arranged them all manually by dragging the grabbies, rather than building the layout using the commands I later used to try modifying the layout. Thanks!
toolbar toggle name=tb11 state=right line=0
toolbar toggle name=tb12 state=right line=0,298
toolbar toggle name=tb10 state=right line=1[/code]
...then I get the toolbar arrangement I showed earlier, and having a look at the .oll file for the saved layout, there's no more "fdright" stuff happening, just "right".
That said... for the bottom toolbars, here's what happens after modifying the command to toggle toolbar TB06 based on your corrections to my misunderstanding of which directions the toolbar lines run: