Interpret buttonbar as menu

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

I thought, -S %S was TCMenu syntax, not internally TC Syntax. TCMenu requires the -Letter flag to handle %Letter

TCMenu:
Command: %APPDATA%\GHISLER\GUI\TCMenu.exe
PARAMS: %%APPDATA%%\GHISLER\GUI\ToolBars\EDIT.BAR -S %S

Without TCMenu, a button looks like:
Command: chp.exe cmd.exe /c MultiFileOpen.cmd
params:%S

Basically, the [..] is pretty much breaking most of the things I would continue to use TCMenu.exe for.

Even my scripts have to acknowledge when they receive nothing it means [..] and treat it as if it is actually the current active directory.

If TC would just send the active current directory when the cursor is on [..] I wouldn't even need to code an exception for it.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

Probably not clear. Its the syntax of TCMenu, but TC sends the command.

When the two files are selected TC executes the command:

Code: Select all

%APPDATA%\GHISLER\GUI\TCMenu.exe %APPDATA%\GHISLER\GUI\ToolBars\EDIT.BAR -S C:\File1.txt C:\File2.txt
If ".." is selected TC executes the command: (with no parameters)

Code: Select all

%APPDATA%\GHISLER\GUI\TCMenu.exe
Instead of (What you probably think):

Code: Select all

%APPDATA%\GHISLER\GUI\TCMenu.exe %APPDATA%\GHISLER\GUI\ToolBars\EDIT.BAR -S 
Edit: Seems like you already understood the problem before.
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

2Balderstrom
Sorry, but I really cannot do anything. :)
TCMenu need to substitute parameters and if some of them are missing - I cannot execute the command. You speak about very simple case only - when parameters field contains single parameter (%S). But what I have to do if there will be more complex parameters combination? (i.e. "abc=%P def=<%S> ghi=%T") What should be passed for execution if some parameters are present and some parameters are missing?

You can avoid TCMenu substitution if you define em_ command and put all parameters inside em_ command definition.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

@VadiMGP,
Thank you... It took a handful of trials to grok what you meant exactly, but I got it to work :-)

To make TCMenu work when the cursor is on [..] and your Button has a parameter, that TCMenu is expecting, ie %S ::

Button on Main ButtonBar
Command: %APPDATA%\GHISLER\GUI\TCMenu.exe
Parameters: %%APPDATA%%\GHISLER\GUI\ToolBars\EDIT.BAR
Contents of EDIT.BAR
[Buttonbar]
Buttoncount=2
button1=%APPDATA%\GHISLER\GUI\icons\Editors.icl,6
cmd1=em_openNotePad2
param1=
Contents of usercmd.ini
[em_openNotePad2]
button=
cmd=chp.exe cmd /c MultiFileOpen.cmd "%PROGRAMFILES%\¤EDITors\NotePad2K\notepad2.exe"
param=%S
Or when not doing something as seemingly obscure as the MultiFileOpen.cmd and using chp (CreateHiddenProcess), just place your executable path there, ie:
cmd=%PROGRAMFILES%\SomeProgram\SomeProgram.exe
Again, many thanks VadiMGP.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

I had a heck of a time getting %P and %T passed thru, quoting doesn't seem to be working right when there were 2 separate paths being sent.

I tried numerous things, the final that worked was including an asterisk and ONE quote; and passing the result to cmd.exe to process/strip out the asterisk (*).
Command: %TCDATA%\GUI\TCMenu.exe
Parameters: %%TCDATA%%\GUI\ToolBars\†\compareDirs.bar -D %X "%P*%T
Item#1 in compareDirs.bar
cmd1=%wuBIN%\exCMD\TCMenu_SyncTool.cmd
param1=%D
iconic1=1
button1=%TCmd%,32
menu1=Sync Dirs (L-R)

Code: Select all

::
:: TCMenu_SyncTool.cmd
::
FOR /F "usebackq tokens=1-2 delims=*" %%F IN ('%*') DO (
	START "" "%TCMD%" /S=S: /L="%%~F" /R="%%~G
)
Which sends:
START "" "C:\Program Files\TotalCMD\TotalCMD.exe" /S=S: /L="__LEFT-PATH__" /R="__RIGHT-PATH__"



NOTE: Some of the many things attempted:
Parameters: ... compareDirs.bar -X %X -P %P -T %T
Parameters: ... compareDirs.bar -D %X -P %P -T %T
Parameters: ... compareDirs.bar -D %X%P %T

And many different quoting placements, i.e. -D "%X%P %T, or "%P" "%T"
No matter what was tried I couldn't get both paths through unscathed.
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

2Balderstrom
Please, read again 1st post of this topic. :wink:
TCMenu fulfilled his destiny. RIP.
I think it is better to use built-in TC drop-down menu feature.

Christian, may be it is time to remove TCMenu from your tools page as obsolete tool?
http://www.ghisler.com/tools.htm
rilley
Junior Member
Junior Member
Posts: 48
Joined: 2008-08-24, 16:42 UTC

tcmenu 1.9

Post by *rilley »

Hello,

I hope I found the right thread to ask,

I am using TC 8 B 18 with tcmenu 1.9, I have a problem, If I need to use TCMENU under an archive, it gives me "This function cannot be use with packed files"

How can I make the TCMENU to work even if is in an archive file...

THANKS!
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

rilley, just specify %Z once anywhere in the parameter string of TCMenu. Don't forget that TCMenu bar's buttons requires another parameters lists.
rilley
Junior Member
Junior Member
Posts: 48
Joined: 2008-08-24, 16:42 UTC

Post by *rilley »

Thank you MVV, the %Z param did the trick

[em_set_tc1]
Cmd=%COMMANDER_PATH%\Plugins\Media\TCmenu\TCmenu.exe
Param="%%COMMANDER_PATH%%\skins\DEFAULT01.bar" -$ %Z

Another question: How about the position of the tcmenu object? How do you set it to start around the cursor mouse?

PS: my bar menu go to the middle of the screen, not the cursor position....
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

I don't believe that's possible. I was hoping MGP would release an updated version for TC8 (although I haven't tested under TC8 32bit)... Under Win7-64 and TC8 64bit all of the TCMenu's get aligned to the bottom of the screen.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
rilley
Junior Member
Junior Member
Posts: 48
Joined: 2008-08-24, 16:42 UTC

Post by *rilley »

Sorry, I was trying to say that it is align to the bottom of the screen,

And if could be a chance to align around the cursor position.....
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

I think it's probably because the ControlName of the buttonBar has changed in TC8-64 --- would likely be an easy fix.

Maybe MVV could mention it on the Russian TC boards, that's where VadiMGP hangs out...

I hate google-translating my requests for there as I've no idea how accurate it will be... I know when I've translated the thread there on TwinKey the machine language translators have some serious issues with Russian jokes/metaphors, nuances and various syntax - to the point where some posts made nearly no sense at all.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Balderstrom,
Well, usually machine translators convert EN to RU much better than RU to EN (EN requires specific word order and many other nuances while RU allows more flexibility because of variable word endings etc).

BTW I can't understand how TCMenu detects menu position. It works in same strange way for TC 7.04a, TC 8b19, TC 7.56a. Sometimes it is shown just under mouse cursor, sometimes only X position of cursor is used (menu is shown at the bottom of the screen)...

However it seems that problem has been fixed in last beta version (may be found here).
rilley
Junior Member
Junior Member
Posts: 48
Joined: 2008-08-24, 16:42 UTC

Post by *rilley »

@@However it seems that problem has been fixed in last beta version (may be found here).


I`ve tried tcmenu 2 beta 17, and is not fixed :(


PS: I am using win 7 64 bit, with TC 8 beta 18 32 bit version
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I have tested it with TC8b19x32 on Win7x64Pro SP1.
Post Reply