assign a tool to a tool button

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
User avatar
webber123456
Posts: 50
Joined: Wed Jul 30, 2003 2:55 am

assign a tool to a tool button

Post by webber123456 »

Does anyone know how to change the tool reference and assign a specific tool to a specific button ?
shaqmeister
Posts: 18
Joined: Sun Feb 15, 2009 12:50 pm

Re: assign a tool to a tool button

Post by shaqmeister »

webber123456 wrote:Does anyone know how to change the tool reference and assign a specific tool to a specific button ?
Hi Webber

I think this is an issue that I can remember spending long evenings on way back with TextPad 4 what feels like nearly 10 years ago (can that be possible?). I'm now using 5.2, and it looks like the same issues are still there, and as far as I can see there is no straightforward way to do this. Still, I am more persistent now, and have since managed to swap button/tool references. Eventually I have come up with two ways that you could do this, neither of which is completely straightforward, and one involves a registry hack, which I am not recommending.

The problem is that the tools are added to the tool bar in the order in which you add the tools through Preferences, and they are assigned default numbered tool buttons from 1 to 16. Only ... though you can re-order how they appear in the list from the drop-down menu, this doesn't affect the ordering in the tool bar list. (You can drag a button to a different place on the Tools toolbar, but Tool 5 is still 5!). I can remember this frustrating me so much that I regularly used to bump all my tools out and then put them back in in an order I liked (say when I'd just added five C++ tools, and I want to add one more Java tool. Keeping them together is logical, right?)

I won't jump into the registry, because the first method is more direct and is done inside TextPad itself. And, this is for 5.2, and might not work in earlier 5.#s, and won't work the same in 4.#, I don't think. Think of it like this ...

A tool button is a tool button is a tool button ... only, the problem is in the numbering of the icons when we want to shift them around. So ... think "keep the assignments and swap the icons." This can be done, but we need a little "swap" algorithm.

So. Lets say you've just added your new tool Java as Tool 8, and you'd like to bump it down to number 4 next to the three default Java tools. You right-click anywhere on the tool bar area between the menu bar and the document tabs (actually ON a tool bar in 4.#) and choose "Customize..." Then, with this window open, you can go up to your toolbar and drag Tool 8 down to where you want it, but then (of course) your tool bar runs

1 | 2 | 3 | 8 | 4 | 5 | 6 | 7 | 9 | ...

This is not good! Still, you can edit and change the icons by (still with the customize dialog box open) right-clicking on the toolbar icon you want to change and selecting "Edit button image ..." This brings up a nice little tool with copying and pasting functionality. With a bit of work, this will do the trick for you, as you can use this to copy the image from the Tool 4 (now in the fifth position) button and paste it onto Tool 8 (which is now in position 4). But before you do, YOU DON'T WANT TO LOSE THE Tool 8 icon, do you? Because when you've shifted things around you'll want that to paste on your new Tool 8 and it won't be in the clip board anymore.

This is where you need your swap.

Still with the "Customize..." dialog open, select the "Commands" tab, select "Tools" on the left, and then scroll down the right window until you see the familiar "User Tool 1," "User Tool 2," etc. Now, choose any one of these and drag it onto the end of your toolbar. It will, of course, duplicate one already there, but we're only going to use it for a little trick, and then we'll just bump it out again. Let's call this our 'swap' button.

So, lets swap the icons on our Tool 8 (now pos 4) and, Tool 4. We don't want to lose the 8 because we will need to put it back somewhere (not necessarily on 4!), so we open up our little editor, copy 8, then open up the same editor on our 'swap' button and paste it there. Then (you get the picture) ... copy the image from 4 and paste it over the 8 on our moved button, ... then, we can either pick up the 8 icon from our swap button and put it where the 4 was (a straight swap), or we can 'chain' this process until everything is just how we want it. Then, when we're done, just drag the 'swap' button off the toolbar, close the "Customize..." dialog, and voila.

What this doesn't do, of course, is change the keyboard shortcut orderings, but this is possible too if you want those to match the tool ordering. (Also ... and this is the problem with doing it this way ... if you want in future to add your tool to another new toolbar, say, it will STILL be Tool 8 in the palette, and you'll have to change the icon again!)

The registry hack sorts this all out in one sweep by actually swapping the references for buttons, but unless you're comfortable with working with hex data ... you don't want to go there, do you!

Hope this helps.
User avatar
webber123456
Posts: 50
Joined: Wed Jul 30, 2003 2:55 am

Post by webber123456 »

thanks for the impressive lesson.

I was hoping TP had resolved this tool assignment problem but it appears they have not.
Xuxu
Posts: 1
Joined: Wed Aug 12, 2009 1:37 pm

change in registry

Post by Xuxu »

Open Windows registry in HKEY_CURRENT_USER\Software\Helios\TextPad 5\Tools. There is a list of folders 0, 1, 2 ... which contain all settings for your tools. For every tool you have an entry "Properties". It's a hexadecimal value.

Example: 00,00,00,00,56,80,00,00,40,00,00,00

The 56 means that it's assigned to tool 1. Changing this value change the assignment (remember: it's hexadecimal).

Code: Select all

value	position
56		1
57		2
58		3
59		4
5a		5
5b		6
5c		7
5d		8
5e		9
5f		10
60		11
...
Post Reply