FAQs: How to create an button

English support forum

Moderators: sheep, Hacker, Stefan2, white

Post Reply
User avatar
Power Member
Power Member
Posts: 2780
Joined: 2007-09-13, 22:20 UTC
Location: Europa

FAQs: How to create an button

Post by *Stefan2 »

How to create an button

Right click on the button bar at the top and select "Change..."
(or utilize “Configuration > Button bar…”)

In the "Change button bar" dialog, click "Add", then fill in the properties as follows:

Code: Select all

Start path: 
Tooltip: your text
Enable "[_]Run minimized" or "[_]Run maximized", if wanted.
Press F1 key while in dialog for more.
Then click OK to create the button.
Picture: https://image.ibb.co/e9H36J/Buttonbar_Change_Eng.png

- If you see no button bar, utilize menu "Configuration > Options..." and enable "Layout" > [X] Show button bar.

- While the button is open for modification, press F1-key for more help.

- You do not need to fill out all of the fields.
-- "Command" is mandatory, "Icon" too, else the button is not visible.
-- "Parameters" and "Start path" only if need.

- Always quote ("...") your paths and parameters, just in case your (path/file name/user name) contain spaces.
-- But then, some parameters are automaticaly quoted by TC if TC find space.
-- You have to try and test if you need to quote and or not to quote.
-- Also, different Interpreters / Applications / Coding languages have different rules if and how to quote.

More Information:

Code: Select all

Command    = 
<Your script or application with full or relative path (use %Commander_Path%). 
Or a TC internal CM_commands or user defined EM_commands "UDC" (see "Magnifying glass" symbol)>

Parameters = 
<Parameters for your application, if need. Or TCs parameter for your script (press F1 key for help)>

Start path = 
<If need. Or leave empty (recommended), as TC use current path as "Start path".>

Icon file  = 
For more Icon resources / libraries visit: https://ghisler.ch/board/viewtopic.php?f=3&t=43593&p=305387#p305387>

Tooltip    = 
<a hint for you, so you know what this button will do. Use pipe-symbol '|' to insert line breaks.>

Enable "[_]Run minimized" or "[_]Run maximized", if wanted.

Visible Command options:
Command: '-1' insert an separator between two buttons (an free space, and with option '[x]Flat Icons' a pipe-like symbol '|')
Command: '-2' insert a line break in button bar to get two rows.

ghisler(Author) wrote:
The button bar auto-wraps when it becomes too wide
Total Commander 7.5 will support both a user-defined line break in the bar (command: -2)
and an unlimited number of lines!


Code: Select all

Command    = cm_CopyNamesToClip
Parameters = 
Start path = 
Icon file  = WCMICONS.DLL
Tooltip    = Copy filenames to clipboard
See TOTALCMD.INC file for more commands.

Code: Select all

Command    = cmd /c
Parameters = FOR /F "tokens=*" %%a in ('type "%L"') DO call C:\temp\tc-test.cmd "%%a"
Start path = 
Icon file  = C:\Windows\system32\cmd.exe
Tooltip    = ForEachFile Do call tc-test.cmd

Code: Select all

Command    = "%Commander_Path%\TOOLs\IrfanView\i_view32.exe"
Parameters = "%P" /thumbs /ini="%Commander_Path%\TOOLs\IrfanView\INI-Thumbs500"
Start path = 
Icon file  = "%Commander_Path%\TOOLs\IrfanView\i_view32.exe"
Tooltip    = Launch i_view32 with "/THUMBs 500x500"

Code: Select all

Command    = "%Commander_Path%\Tests\xxx"
Parameters = "%WL"
Start path = 
Icon file  = WCMICONS.DLL
Tooltip    = Denotation|Description|Explanation

- - -

FAQs: TCs' internal commands - how-to find and use them

FAQs: How to create an button (((THIS post)))

FAQs: Button-code: How-to Copy Share Paste a button ('TOTALCMD#BAR#DATA')

FAQs: User-Defined Command (UDC) (usercmd.ini) em_command

- - -

Post Reply