Single Button: Click -> OPENTABS, Ctrl+Click -> APPEND

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Rob Weinstein
Junior Member
Junior Member
Posts: 45
Joined: 2006-06-10, 21:41 UTC
Location: Arizona

Single Button: Click -> OPENTABS, Ctrl+Click -> APPEND

Post by *Rob Weinstein »

I would like to configure a single button in the button bar to have two functions:

1) Click runs OPENTABS
2) Ctrl+Click (or Alt+Click) runs APPENDTABS

Is this possible?

I have several buttons that run the OPENTABS command, one for each project I'm working on. I would like to change the operation of those buttons to either perform OPENTABS or APPENDTABS. I don't want to make separate APPENDTABS buttons for each project.

Thanks,

-Rob
User avatar
Horst.Epp
Power Member
Power Member
Posts: 7024
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

There is a tool ButtonBar eXtended from Samuel :
http://www.ghisler.ch/board/viewtopic.php?t=20274&postdays=0&postorder=asc&start=0

I use a much simpler older one from him, called Toolbar.exe (AHK compiled)
Which allows CTRL, Shift or Alt-Click options for a button.
I have the AHK source of it.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

You can use TCFS2 with TCFS2Tools and check if Ctrl or Alt is pressed in order to select desired command. Just add a line to TCFS2.ini:

Code: Select all

[Items]
loadtabs=if(pressedCtrl || pressedAlt, tem(`em_appendtabs `#1), tem(`em_opentabs `#1))
However you also need to add two TC usercommands in order to call OPENTABS and APPENDTABS from TCFS2: em_OpenTabs with command OPENTABS and parameter %A and em_AppendTabs with command APPENDTABS and parameter %A.

And then you can use a buttonbar button:

Code: Select all

Command: TCFS2.exe
Parameters: /ei loadtabs(`F:\rr.tab`)
Rob Weinstein
Junior Member
Junior Member
Posts: 45
Joined: 2006-06-10, 21:41 UTC
Location: Arizona

Post by *Rob Weinstein »

@Horst.Epp,

I tried ButtonBar eXtended and it works perfectly! Thanks for the suggestion.

@MVV,

I followed your instructions and I'm having some difficulty. When I click the new button, I get a popup containing this information:
TCFS2
Error:
Unavailable key

Items:
loadtabs

Terminate process?

[OK] [Cancel]
I tested the new em_ commands by simply typing them at the command line, i.e.,

Code: Select all

em_AppendTabs c:\totalcmd\rob_proj_tabs.tab
also

Code: Select all

em_OpenTabs c:\totalcmd\rob_proj_tabs.tab
and they both work.

Just to confirm my setup:

I added the following button:

Code: Select all

Command:  %COMMANDER_PATH%\downloads\TCFS2\TCFS2.exe
Parameters: /ei loadtabs(`c:\totalcmd\rob_proj_tabs.tab`)
Start path:  %COMMANDER_PATH%\downloads\TCFS2\TCFS2.exe
Icon file:  %COMMANDER_PATH%\downloads\TCFS2\
Tooltip:  TCFS2 Loadtabs
I modified the TCFS2.ini file to include this line:

Code: Select all

loadtabs=if(pressedCtrl || pressedAlt, tem(`em_AppendTabs `#1), tem(`em_OpenTabs `#1))
I did not install TCFS2Tools. Do I need TCFS2Tools for this?

Can you help me determine where I went wrong?

Thanks,

-Rob
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Rob Weinstein wrote:I followed your instructions and I'm having some difficulty. When I click the new button, I get a popup containing this information:
This message states that there loadtabs item is not found in [Items] section.
Rob Weinstein wrote:I modified the TCFS2.ini file to include this line:
Have you inserted this line into [Items] section or just added it at the end of file? Best place is just before the comment containing all functions and parameters:

Code: Select all

<- here

; Functions and parameters:
;
Or maybe you just haven't placed TCFS2.ini near TCFS2.exe?
Rob Weinstein wrote:I did not install TCFS2Tools. Do I need TCFS2Tools for this?
TCFS2Tools is required to check for pressed keys: pressedCtrl and pressedAlt macros call its function.
Rob Weinstein
Junior Member
Junior Member
Posts: 45
Joined: 2006-06-10, 21:41 UTC
Location: Arizona

Post by *Rob Weinstein »

I got it working by fixing the following:

1. Moved TCFS2.ini into the same directory with TCFS2.exe.
2. Loaded TCFS2Tools using method described in readme file.

It works beautifully!

Now for the problem... when I restart TC and try the new button, I get a popup that says:
Total Commander

Function not implemented!
65572

[OK]
I have to go back into Configuration -> Color -> Define colors by file type... -> Add, etc. to enable the plugin again. I have to do this each time I restart TC.

Your readme file says:
4. Loading module on TC start

There are at least two ways to load module on TC start. First way is to register TCFS2Tools.dll as WDX plugin and to define special 'color by file type' preset (Configuration, Color, by file type, Add, Define, Plugins tab, "TCFSTools.Autorun > 0", save with any name, apply all changes) to cause TC to load TCFS2Tools automatically.
I'm concerned that I didn't "register" the plugin correctly because it's listed as TCFS2Tools.dll but I specified the 64-bit version, TCFS2Tools.dll64. I "registered" the plugin using this procedure:

1. Configuration -> Options
2. Plugins -> Configure (Content plugins .WDX)
3. Add -> Filename: c:\path\to\TCFS2Tools.dll64

It accepts this, but then the Content plugins window shows the 32-bit version: c:\path\to\TCFS2Tools.dll

The wincmd.ini looks like this:

Code: Select all

[ContentPlugins]
0=C:\totalcmd\downloads\TCFS2Tools\TCFS2Tools.dll
0_detect=
[ContentPlugins64]
$checksum$=2174883106
0=1
I'm using TC 8.51a 64-bit on Win 7.

How do I get the 64-bit dll to install properly?

Thanks,

-Rob
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

It works beautifully!
Nice to hear that. :)
Now for the problem... when I restart TC and try the new button, I get a popup that says:
It means that TCFS2Tools doesn't intercept messages (because it is not loaded on TC start).
It accepts this, but then the Content plugins window shows the 32-bit version: c:\path\to\TCFS2Tools.dll
TC uses same configuration file for both 32- and 64-bit versions so it stores paths to 32-bit modules and 64-bit version appends '64'.
How do I get the 64-bit dll to install properly?
I started clean TCx64 copy (using /i option), installed TCFS2Tools.dll64 and added 'Autorun' color template with plugin condition 'TCFSTools.Autorun > 0', and TC loads module on start. It is very important to define colors template because TC will load the module in order to get colors for files.
Here is my small working wincmd.ini (works for me with TCx64):

Code: Select all

[Configuration]
FirstTime=0
[ContentPlugins]
0=D:\TOTALCMD\Addons\TCFS2Tools\TCFS2Tools.dll
0_detect=
[ContentPlugins64]
$checksum$=64033457
0=1
[searches]
Autorun_SearchFor=
Autorun_SearchIn=
Autorun_SearchText=
Autorun_SearchFlags=0|002002000020|||||||||0000|
Autorun_plugin=tcfs2tools.Autorun > 0
[Colors]
ColorFilter1=>Autorun
ColorFilter1Color=255
Rob Weinstein
Junior Member
Junior Member
Posts: 45
Joined: 2006-06-10, 21:41 UTC
Location: Arizona

Post by *Rob Weinstein »

It's all working now! Thanks for your patience.

Your wincmd.ini file gave me the clue. I was missing this:

Code: Select all

[Colors]
ColorFilter1=>TCFS2Tools
ColorFilter1Color=0
It turns out that I didn't follow the instructions to the letter. After I defined and saved the new color selection type, TCFS2Tools.Autorun > 0, when it asked me to choose a color, I cancelled that window because I thought I didn't need to choose a color but I was wrong. Your readme file clearly says:
(Configuration, Color, by file type, Add, Define, Plugins tab, "TCFSTools.Autorun > 0", save with any name, apply all changes)
Now my wincmd.ini looks like this:

Code: Select all

...
[Colors]
...
ColorFilter1=>TCFS2Tools
ColorFilter1Color=0
...
[searches]
TCFS2Tools_SearchFor=
TCFS2Tools_SearchIn=
TCFS2Tools_SearchText=
TCFS2Tools_SearchFlags=0|002002000020|||||||||0000|
TCFS2Tools_plugin=tcfs2tools.Autorun > 0
[ContentPlugins]
0=C:\totalcmd\downloads\TCFS2Tools\TCFS2Tools.dll
0_detect=
[ContentPlugins64]
$checksum$=2174883106
0=1
...
The plugin loads properly when I start TC and the new buttons work exactly as I had hoped.

Thanks again,

-Rob
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Great that it works now. I think I should notice in Readme that user have to choose any color.
Post Reply