vTBs or Vertical Toolbars

Discuss and share scripts and script files...
klownboy
Posts: 4137
Joined: 28 Feb 2012 19:27

vTBs or Vertical Toolbars

Post by klownboy »

Vertical Toolbar (vTB) script. As close as I can get it. I did make an icon only version, but there's additional space on the right side I can't remove.

- On the first run of vTB the script will automatically create a "vToolbar" folder (if not present) off <xydata> and present you with a list of all XY built-in toolbar buttons as well as all your Customized Toolbar Buttons (CTBs) whether you're using them or not. Those buttons, of both types, which you are actually using on the current "normal" XY toolbar will be marked with a •.

- Important: this script will never write to your "normal" XY toolbar buttons or to XYplorer.ini file in any way. It's totally independent other than reading what you have assigned as toolbar buttons...so no worries there.

- As personal preference, I keep the number of vTB buttons to a number of 20 or less of course that depends on your monitor's resolution. You don't have as much screen space vertically as horizontally.

- After the first run and your vTB is completed, you can use that exclusively or continue to generate additional vTBs. This can be accomplished from the main menu. You can also switch to a different vTB (i.e., load any of your saved vTBs) from the menu as well as Delete them. Note: the delete menu will inform you of your current vTB.

- Since v1.07 there's an option to modify existing toolbars. After selecting the vTB to modify, the complete list of toolbar buttons will display. The existing buttons on the selected vTB will be pre-checked at the top of the listing with the previous order maintained.

- You can assign the Vertical Toobar script to the Right Click on White Space in the List (or since v1.08 the Tree as well). The really nice thing about this option is: if you have multiple vTBs you can load them via the menu and whatever vTB is current will be the one loaded on right click on white space. So it ends up being quite easy to change menus displayed via right click on white.

- You can assign an "alternate" script to Right Click on White Space in the List or Tree. So if you have another script you use regularly you can assign that script via that menu. This will allow you to easily switch between the Vertical Toolbars script and another script of your choice.

- Keep in mind you may have as many as 64 CTBs and you probably don't use them all on your "normal" XY toolbar. So you can make a number of CTBs which you might only use to support the Vertical Toolbars. Why: all your CTBs whether they are being used or not, will be presented on the Generate vTB inputselect box and as I said previously, the currently used buttons will be flagged in the listing. You can make multiple vTBs each with different purposes and very quickly change between them.

- Since v1.08, you can toggle the extended or addon menu on and off. Most of the time we really don't need to see the extended menu. This can be accomplished through the menu (when it's displayed) or by holding down control & shift while left clicking on any menu item (not the extended menu). L-click of the mouse is still same as hitting the left click of the CTB . Control left click is the same as right click of the toolbar button. Shift left btton is now the Customized Toolbar dialog or Edit User button as applicable.

- You can set this up to run off a CTB or maybe a better idea is to assign a user command to run the script such that you only have to hit a key or key combination to bring up the VTB. I have vTB triggered by hitting alt-space.

vTB_v1.08_description.jpg
vTB_v1.08_description.jpg (113.88 KiB) Viewed 4423 times
Version 1.04 of vTB [Vertical Toolbar]. Changes since v1.03 include:
1) You can now load a specific vTB directly by using a load line like this:

Code: Select all

Global $vTB="Daffys_vTB"; load "<xyscripts>\vTB_v1.04.xys";
Please specify the vTB in the variable without the txt extension. You could have one CTB calling a specific vTB and another calling a different one. Or, you could set up a CTB such that the left click pulls up one vTB and right click a different one. Thanks kodyman for the suggestion.
You can use any previously saved vTB text file saved in the vToolbar folder of XYplorer and obviously you can still generate new vertical toolbars as you'd like.
if you'd rather keep using it in a manner similar to the old version 1.03, you can still do so by simply using load "<xyscripts>\vTB_v1.04.xys"; in the left or right click CTB menu or elsewhere. If you also use the LayCatTools script here, you could also use those toolbars (located in the Toolbars folder off XYplorer folder). However, some of those may be a bit long since they're horizontal toolbars for XY's toolbar versus vertical toolbars.
2) I've added an option also which allows you to either show or not show the AddOnMenu which has the Generate/Load/Delete addon menu on the end of the vTB menu. If you're all set and don't mess with the vTB menu items frequently or the menu is too long, set the variable $ShowMenuAddon to "0" in the "_Initialize" section. If you want to see the AddOnMenu, keep the variable set as the default of "1".
3) Under certain circumstances, SC replacelist was not working as I expected when there were repetitious words like 'copy'. This resulted in "Copy path" not being pre-checked as a current user buttons list when generating a new vTB as well as some other odd results. Per Sammay's suggestion, I ended having to use gettoken/gettokenindex as a replacement.

Version 1.05 of vTB.xys:
1) This update takes advantage of XYplorer's new capability to detect the modifier key pressed when you click on a menu item. This script is very well suited to use this feature in that now you'll be able to execute both the Left and Right actions of the user CTB's or XY built-in Toolbar buttons. So, that means in this version of the script:
- If you left click on a menu item with no modifier, the script brings up whatever you have assigned for the normal Left-click action of the CTB or in the case of an XY built toolbar button it will execute that button's function.
- If you left click a menu item with a modifier held down, either Shift or Control, the CTB's or XY TB button right click action will be performed.
- If you hold down both the control and shift while you left click on a menu item, the "Edit User Button" dialog opens for that CTB or if it's a standard XY button the Customize Toolbar dialog opens.
It's very helpful in using this vTB script, just as it is on the normal TB, if you clearly define in the CTB's caption the actions of both the Left and Right click of the mouse. For example [L] Layout Manager [R] Session Manager - see the picture above. You can even have the actions for caption/tooltip on separate lines if you edit the XYplorer.ini and put a "¶ " between the two.

Version 1.06 of vTB.xys:
It's been nearly 5 years since I last updated this script. V1.06 includes:

- Update for new built-in XYplorer user buttons
- Delete vToolbars menu item did not work for multiple vTBs - fixed
- Fixed errors encountered with XY's syntax checker on. Hopefully I got them all.
- I mentioned this on a previous version notes but remember after selecting your vTB menu items, you can drag and drop them to reorder items on the menu.
- Once you've made multiple vertical toolbars you can load them separately via a TB button or User Defined Command, etc using the one liner example shown in the details for version vTB_1.04 above

There are 2 versions of the script included in the compressed file..

- 1st verion (the standard verison), vTB_v106.xys executes the Toolbar menu item standard left click entry with the left click and the button's right click function is executed with a Control down left mouse button
- 2nd version, vTB_v106_L&R.xys executes the toolbar menu item standard left click entry with the left click and the button's right click function is executed with the right click mouse button. To use this version you need to incorporate right click in a menu detection using AHK. It's quite easy to do especially if you already use AHK for anything. See the link here viewtopic.php?f=7&t=18062 for easy setup. Once done you can use it in any XY script menu. It's ideally suited for this particular script since we are essentially using all XY built-in TB buttons and all your customized user buttons to make vertical toolbars. So the left and right click actions of your normal Toolbar buttons will be the same in your new vertical toolbar buttons and accomplished the same way with left and right clicks of the mouse.

Version 1.07 of vTB.xys

I wasn't originally thinking of making this update at least not this soon since the previous, but I'm glad I did. V1.07 includes:

- Provided an option to modify existing toolbars. The existing TBs will be pre-checked with the previous order maintained and will be located at the top of the listing.
- Added option to assign the Vertical Toolbar script to the Right Click on White Space in the List. The really nice thing about that with this type of script is: if you have multiple vTBs you can load them via the menu and whatever vTB is current will be the one loaded on right click on white space. So it ends up being quite easy to change menus displayed via right click on white.
- Added an additional option when you hold a modifier key like control or shift down when you click on the above new Right Click menu item. This option allows you to assign an alternate script to Right Click on White Space in the List. So if you have another script you use regularly you can assign that script via that menu. This will allow you to easily switch between the Vertical Toolbars script and another script of your choice.
- Cleaned up the button name in the inputselect dialog used for selecting buttons to only show description and not include the icon name in brackets. Recommended by highend.
Once again there are 2 versions of the script included in the compressed file.

vTB v1.08

This version allows the user to toggle the extended or addon menu on and off. Most of the time we really don't need to see the extended menu. This can be accomplished through the menu (when visible) or by holding down control & shift while left clicking on any menu item (not the extended menu). L-click of the mouse is still same as hitting the left click of the CTB . Control left click is the same as right click of the toolbar button. Shift left btton is now the Customized Toolbar dialog or Edit User button as applicable.

Hopefully I made the assignment of the vTB script or another script of your choice easier and more straight forward to accomplish for Right Click on White Space. You can now also make those choices for the tree as well as the list. Extended menu status (ON or OFF) and alternate right click on white space scripts are saved to a ini section of the script itself. Thanks to FluxTorpedoe for that idea.

I hope you enjoy it. Please let me know if you experience any problems. Thank you TheQwerty, highend, Sammay, and kodyman for all the help and suggestions you provided.
Note: Version 1.05 and later requires version 15.80.0002 or later of XYplorer.

Thanks,
Ken
vTB_v1.02.zip
(5.7 KiB) Downloaded 217 times
vTB_v1.03.zip
(5.8 KiB) Downloaded 213 times
vTB_v1.04.zip
(6.08 KiB) Downloaded 210 times
vTB_v1.05.zip
(4.66 KiB) Downloaded 247 times
vTB_v1.06.zip
(9.44 KiB) Downloaded 130 times
vTB_v1.07.zip
(11.96 KiB) Downloaded 139 times
vTB_v1.08.zip
(13.09 KiB) Downloaded 166 times
Last edited by klownboy on 03 Jun 2020 15:24, edited 16 times in total.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

highend
Posts: 13308
Joined: 06 Feb 2011 00:33

Re: vTB or Vertical Toolbars

Post by highend »

Nice idea :)

Problems:

On first startup of the script:
Unbenannt.png
Unbenannt.png (11.09 KiB) Viewed 7180 times
After saving the first toolbar:
All buttons that use a custom icon don't use it in the dropdown menu. Instead they are displayed with a orange triangle icon with an exclamation mark in it.

My buttons use this form of icon assignment:
<xyicons>\<name of the icon>.ico
One of my scripts helped you out? Please donate via Paypal

klownboy
Posts: 4137
Joined: 28 Feb 2012 19:27

Re: vTBs or Vertical Toolbars

Post by klownboy »

Hi highend thanks for the comments.
- Darn I thought I had checked the use of listfolder if/when the folder didn't exists. I went ahead and removed the listfolder check for the existence of a *.txt (vertical toolbar) and go with strictly the check for folder existence. Unfortunately you can't use wild cards with SC exists on a file.
- Wow I can't believe the second comment. I checked and everyone of my Customized Toolbar Buttons and the icon file had the full path and didn't use <xyicons> so I never picked up on the at issue. I'll have to recognized the use of <xyicons>...at least I hope I can.
Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: vTBs or Vertical Toolbars

Post by bdeshi »

nice!

Perhaps the best use for this is when you have the toolbar hidden. Assigned to a UDC or hotkey.

[ed]
re: icons, don't forget aliases; I have some icons defined like <get alias res>graphics\ui\align_just.ico ! (don't get angry at me :P )
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4137
Joined: 28 Feb 2012 19:27

Re: vTBs or Vertical Toolbars

Post by klownboy »

I uploaded another version which corrects the script for highends comment above...at least I hope so. Please let me know highend if you still have a problem. It gets a bit tricky because you can specify icons for CTBs with only the icon name with out the <xyicons> or you can have the full path spelled out, but of course you can't use an icon name without a path OR <xyicons> in a menu.

However, I just noticed Sammy's comment concerning aliases as well. I'll have to take a look at that. I want to revisit the upfront check again for the existence of the folder and also check that at least one toolbar exist as well...maybe the next change.

Thanks for testing and the comments.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

klownboy
Posts: 4137
Joined: 28 Feb 2012 19:27

Re: vTBs or Vertical Toolbars

Post by klownboy »

Hi Sammay , I've got little experience with aliases, but in your example above am I to assume that "<get alias res>" would be a path which would be the lead in for "graphics\ui\align_just.ico "? So, as an example, if get alias returned "D:\Icons\", the full expanded path would be something like "D:\Icons\graphics\ui\align_just.ico". Is this the way it would be written in the CTB icon block?

Code: Select all

<get alias res>graphics\ui\align_just.ico 
It looks like I could treat it similar to <xyicons> but would have to make the distinction.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: vTBs or Vertical Toolbars

Post by Filehero »

Hi Ken,

no time for installing and checking now, but the idea is worth a triple :tup: :tup: :tup:

Now there are a SessionManager, a ToolbarManager and now a vTBManager. :D

Cheers,
Filehero

highend
Posts: 13308
Joined: 06 Feb 2011 00:33

Re: vTBs or Vertical Toolbars

Post by highend »

v1.0.1

Still the same error (as long as vToolbars doesn't exists). It's even worse now, you get three script warnings instead of one :D

At least: Icons (format: <xyicons>\<icon name>.ico) is fixed :)
One of my scripts helped you out? Please donate via Paypal

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: vTBs or Vertical Toolbars

Post by Filehero »

highend wrote:...you get three script warnings instead of one :D
Da*n, at first I just had entered just one :tup:

:wink:

klownboy
Posts: 4137
Joined: 28 Feb 2012 19:27

Re: vTBs or Vertical Toolbars

Post by klownboy »

So sorry highend and Filehero. I tried multiple 'if' conditions including listfolder and before sending I forgot the second closing parenthesis on exist on line 9. So if you would go ahead and add it or re-download and hopefully it should work. I updated the file on the first post as well to v1.02. Thanks for testing. :oops:
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

highend
Posts: 13308
Joined: 06 Feb 2011 00:33

Re: vTBs or Vertical Toolbars

Post by highend »

v1.0.2

Ok, no further warnings, when the folder doesn't exist.

Suggested improvements:
- Don't display the internal icon names for XY buttons (e.g. [back], [fore], etc.). I don't think that they add any additional useful information to these entries in the menu
- The order of the toolbar buttons is not what is displayed in the menu. Ordering matters (at least for me).
I makes sense to display your "Vertical Toolbar Button Selection" inputselect window where you order all icons alphabetically (and CBT icons at the end) but it would be nice if you use a following loop that puts existing icons into it's correct order (as they are displayed in the toolbar) and put all additionally selected icons (not on the toolbar) at the end of it. Maybe with a separator line between them. Or as an alternative you could show all existing icons in the right order in the inputselect window and add all non existing (sorted) at the end of the list?

Btw, your initial line in the script states: "by knownboy" xD
One of my scripts helped you out? Please donate via Paypal

klownboy
Posts: 4137
Joined: 28 Feb 2012 19:27

Re: vTBs or Vertical Toolbars

Post by klownboy »

highend wrote:Ok, no further warnings, when the folder doesn't exist.
Thanks. I still would like to update this to ensure that not only a folder exists but at least one toolbar exists in it (i.e., you have a folder but no toolbar to read/list = problems).
highend wrote:Don't display the internal icon names for XY buttons (e.g. [back], [fore], etc.). I don't think that they add any additional useful information to these entries in the menu
I see what your saying and I did consider removing it, but elected not to. I'll revisit it. I suppose it would get rid of some unnecessary clutter. It means breaking apart that list one more time. It's used for the icons also [the bracketed section].
highend wrote:The order of the toolbar buttons is not what is displayed in the menu
You know, I really didn't want this to be a reflection of the normal XY toolbar. I want people to possibly make new CTBs to support it and really not have anything to do with XY toolbar at least as far as the layout. So I'm not sure about this one. Other than the above, I really can't see that it worth doing anything as far as order for the inputselect box. It's just a one time for each toolbar event, but I do like the idea of ordering for the actual toolbar display if I can.

Yes, it noticed the knownboy...but too late.

Thanks highend,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: vTBs or Vertical Toolbars

Post by bdeshi »

klownboy wrote:Hi Sammay , I've got little experience with aliases, but in your example above am I to assume that "<get alias res>" would be a path which would be the lead in for "graphics\ui\align_just.ico "? So, as an example, if get alias returned "D:\Icons\", the full expanded path would be something like "D:\Icons\graphics\ui\align_just.ico". Is this the way it would be written in the CTB icon block?

Code: Select all

<get alias res>graphics\ui\align_just.ico 
It looks like I could treat it similar to <xyicons> but would have to make the distinction.
Yes to all, and it's fixed now. :appl:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: vTBs or Vertical Toolbars

Post by bdeshi »

klownboy wrote:
highend wrote:Don't display the internal icon names for XY buttons (e.g. [back], [fore], etc.). I don't think that they add any additional useful information to these entries in the menu
I see what your saying and I did consider removing it, but elected not to.
Keep them. Or better yet, add a variable to control their display.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4137
Joined: 28 Feb 2012 19:27

Re: vTBs or Vertical Toolbars

Post by klownboy »

Hey Sammay, when you say
SammaySarkar wrote:...and it's fixed now.
are you saying the alias worked now along with the other fix? I made the change to support <xyicons>. So it's possible the change helped the use of alias as well.
SammaySarkar wrote:Keep them. Or better yet, add a variable to control their display.
The variable use sounds like a good idea, but the fact that we're dealing with inputselect pre-checks means numerous changes. I haven't decided yet.

@highend and Sammay, by the way do think it's within Don's power or should I say even possible to have XYplorer recognize whether someone has made a right click versus a left click on a menu item as he was able to do on CTBs. I can see much potential use for that well beyond this script. It would certainly make this script much more powerful. I may make wish at some point after he's recovered and got the next big thing behind him.

Thanks for the input.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Post Reply